From 871afead089b416b2ae658c78858b35d65b92ffa Mon Sep 17 00:00:00 2001 From: Laurent Jouanneau Date: Fri, 18 Oct 2024 13:04:51 +0200 Subject: [PATCH 1/3] New Lizmap\App\LocalesLoader to load locales for JS A new static method LocalesLoader::getLocalesFrom() is provided for Lizmap and modules, when we want to retrieve all translated files of a locales file. --- .../modules/lizmap/lib/App/LocalesBundle.php | 40 +++++++++++ .../modules/lizmap/lib/App/LocalesLoader.php | 72 +++++++++++++++++++ .../view/controllers/translate.classic.php | 36 ++-------- 3 files changed, 119 insertions(+), 29 deletions(-) create mode 100644 lizmap/modules/lizmap/lib/App/LocalesBundle.php create mode 100644 lizmap/modules/lizmap/lib/App/LocalesLoader.php diff --git a/lizmap/modules/lizmap/lib/App/LocalesBundle.php b/lizmap/modules/lizmap/lib/App/LocalesBundle.php new file mode 100644 index 0000000000..2aad816016 --- /dev/null +++ b/lizmap/modules/lizmap/lib/App/LocalesBundle.php @@ -0,0 +1,40 @@ +charset; + } + if (!in_array($charset, $this->_loadedCharset)) { + $this->_loadLocales($charset); + } + + return $this->_strings[$charset]; + } +} diff --git a/lizmap/modules/lizmap/lib/App/LocalesLoader.php b/lizmap/modules/lizmap/lib/App/LocalesLoader.php new file mode 100644 index 0000000000..f28ff1216f --- /dev/null +++ b/lizmap/modules/lizmap/lib/App/LocalesLoader.php @@ -0,0 +1,72 @@ +getAllKeys(); + } + + // with Jelix 1.8 + try { + $file = new \jSelectorLoc($key, $locale); + } catch (\jExceptionSelector $e) { + // the file is not found + if ($e->getCode() == 12) { + // unknown module.. + throw $e; + } + + throw new \Exception('(212)No locale file found for the given locale key "'.$key + .'" in any other default languages'); + } + + $locale = $file->locale; + $keySelector = $file->module.'~'.$file->fileKey; + + if (!isset(self::$bundles[$keySelector][$locale])) { + self::$bundles[$keySelector][$locale] = new LocalesBundle($file, $locale); + } + + $bundle = self::$bundles[$keySelector][$locale]; + + return $bundle->getAllKeys(); + } +} diff --git a/lizmap/modules/view/controllers/translate.classic.php b/lizmap/modules/view/controllers/translate.classic.php index 6a9087f3b1..e02aa080b7 100644 --- a/lizmap/modules/view/controllers/translate.classic.php +++ b/lizmap/modules/view/controllers/translate.classic.php @@ -1,4 +1,7 @@ param('lang'); if (!$lang) { - $lang = jLocale::getCurrentLang().'_'.jLocale::getCurrentCountry(); + $lang = jLocale::getCurrentLocale(); } - $data = array(); - $path = jApp::appPath().'modules/view/locales/en_US/dictionnary.UTF-8.properties'; - if (file_exists($path)) { - $lines = file($path); - foreach ($lines as $lineNumber => $lineContent) { - if (!empty($lineContent) and $lineContent != '\n') { - $exp = explode('=', trim($lineContent)); - if (!empty($exp[0])) { - $data[$exp[0]] = jLocale::get('view~dictionnary.'.$exp[0], null, $lang); - } - } - } - } + $data = LocalesLoader::getLocalesFrom('view~dictionnary', $lang); $rep->content = 'var lizDict = '.json_encode($data).';'; return $rep; @@ -68,23 +59,10 @@ public function getDictionary() $lang = $this->param('lang'); if (!$lang) { - $lang = jLocale::getCurrentLang().'_'.jLocale::getCurrentCountry(); + $lang = jLocale::getCurrentLocale(); } - $data = array(); - $path = jApp::appPath().'modules/view/locales/'.$lang.'/'.$property.'.UTF-8.properties'; - if (file_exists($path)) { - $lines = file($path); - foreach ($lines as $lineNumber => $lineContent) { - if (!empty($lineContent) and $lineContent != '\n') { - $exp = explode('=', trim($lineContent)); - if (!empty($exp[0])) { - $data[$exp[0]] = jLocale::get('view~dictionnary.'.$exp[0], null, $lang); - } - } - } - } - $rep->data = $data; + $rep->data = LocalesLoader::getLocalesFrom('view~'.$property, $lang); return $rep; } From 52f7279e3ee1258e71fa3a7a9375d659376807ed Mon Sep 17 00:00:00 2001 From: Laurent Jouanneau Date: Fri, 18 Oct 2024 15:38:50 +0200 Subject: [PATCH 2/3] Fix phpstan errors --- phpstan-baseline.neon | 8 ++++++++ tests/units/composer.json | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon index 05e533d8e3..44d4477391 100644 --- a/phpstan-baseline.neon +++ b/phpstan-baseline.neon @@ -604,3 +604,11 @@ parameters: message: "#^Inner named functions are not supported by PHPStan\\. Consider refactoring to an anonymous function, class method, or a top\\-level\\-defined function\\. See issue \\#165 \\(https\\://github\\.com/phpstan/phpstan/issues/165\\) for more details\\.$#" count: 1 path: lizmap/modules/view/controllers/lizMap.classic.php + - + message: "#^Call to an undefined static method jLocale::getBundle\\(\\)\\.$#" + count: 1 + path: lizmap/modules/lizmap/lib/App/LocalesLoader.php + - + message: "#^Unreachable statement - code above always terminates\\.$#" + count: 2 + path: lizmap/modules/lizmap/classes/lizmap.class.php \ No newline at end of file diff --git a/tests/units/composer.json b/tests/units/composer.json index 3aa2a26c90..7793edb4d5 100644 --- a/tests/units/composer.json +++ b/tests/units/composer.json @@ -10,7 +10,7 @@ "require": { "php": ">=7.3.0", "phpunit/phpunit": "^10.5.29", - "phpstan/phpstan": "^1.10.1" + "phpstan/phpstan": "1.11.11" }, "autoload": { "classmap": ["../../lizmap/modules/lizmap/classes/" ], From 8bed5fcfc63978db93b9378f4a59234536d94293 Mon Sep 17 00:00:00 2001 From: Laurent Jouanneau Date: Fri, 18 Oct 2024 15:45:52 +0200 Subject: [PATCH 3/3] Fix phpstan --- .github/workflows/php-stan.yml | 5 +- .../modules/lizmap/classes/lizmap.class.php | 4 +- phpstan-baseline.neon | 1235 +++++++++-------- phpstan-ci.neon | 5 + phpstan.neon | 16 - 5 files changed, 632 insertions(+), 633 deletions(-) create mode 100644 phpstan-ci.neon diff --git a/.github/workflows/php-stan.yml b/.github/workflows/php-stan.yml index 2da3cf7935..9e27c21515 100644 --- a/.github/workflows/php-stan.yml +++ b/.github/workflows/php-stan.yml @@ -30,8 +30,9 @@ jobs: uses: shivammathur/setup-php@v2 # About the PHP version, do not forget to change in PHP Unit as well with: - php-version: '8.0' + php-version: '8.2' tools: phpstan:1.11.11 + ini-values: error_reporting=22527 - name: Cache dependencies uses: actions/cache@v4 @@ -50,7 +51,7 @@ jobs: - name: Run PHPStan id: test-phpstan - run: phpstan analyse -c ../phpstan.neon + run: phpstan analyse -c ../phpstan-ci.neon - name: Notify in case of failure uses: peter-evans/commit-comment@v3 diff --git a/lizmap/modules/lizmap/classes/lizmap.class.php b/lizmap/modules/lizmap/classes/lizmap.class.php index 1b93aa2db9..b960106179 100644 --- a/lizmap/modules/lizmap/classes/lizmap.class.php +++ b/lizmap/modules/lizmap/classes/lizmap.class.php @@ -137,7 +137,7 @@ public static function getRepositoryList() public static function getRepositoryProperties() { trigger_error('This method is deprecated. Please use the lizmapRepository::getProperties() method.', E_DEPRECATED); - + // @phpstan-ignore deadCode.unreachable return lizmapRepository::$properties; } @@ -150,7 +150,7 @@ public static function getRepositoryProperties() public static function getRepositoryPropertiesOptions() { trigger_error('This method is deprecated. Please use the lizmapRepository::getPropertiesOptions() method.', E_DEPRECATED); - + // @phpstan-ignore deadCode.unreachable return lizmapRepository::$propertiesOptions; } diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon index 44d4477391..92d9de7b51 100644 --- a/phpstan-baseline.neon +++ b/phpstan-baseline.neon @@ -1,614 +1,623 @@ parameters: - ignoreErrors: - - - - message: "#^Comparison operation \"\\=\\=\" between 0\\|0\\.0\\|''\\|'0'\\|array\\{\\}\\|false\\|null and 0 results in an error\\.$#" - count: 1 - path: lizmap/modules/dataviz/classes/datavizPlot.class.php - - - - message: "#^Offset float does not exist on array\\{\\}\\.$#" - count: 2 - path: lizmap/modules/dataviz/classes/datavizPlot.class.php - - - - message: "#^Offset float\\|int\\<0, max\\> does not exist on array\\{\\}\\.$#" - count: 1 - path: lizmap/modules/dataviz/classes/datavizPlot.class.php - - - - message: "#^Method filterConfig\\:\\:__construct\\(\\) with return type void returns false but should not return anything\\.$#" - count: 3 - path: lizmap/modules/filter/classes/filterConfig.class.php - - - - message: "#^Property filterConfig\\:\\:\\$lproj is never read, only written\\.$#" - count: 1 - path: lizmap/modules/filter/classes/filterConfig.class.php - - - - message: "#^Property filterConfig\\:\\:\\$project is never read, only written\\.$#" - count: 1 - path: lizmap/modules/filter/classes/filterConfig.class.php - - - - message: "#^Property filterConfig\\:\\:\\$repository is never read, only written\\.$#" - count: 1 - path: lizmap/modules/filter/classes/filterConfig.class.php - - - - message: "#^Call to an undefined method qgisMapLayer\\:\\:getDatasourceConnection\\(\\)\\.$#" - count: 1 - path: lizmap/modules/filter/classes/filterDatasource.class.php - - - - message: "#^Call to an undefined method qgisMapLayer\\:\\:getDatasourceParameters\\(\\)\\.$#" - count: 1 - path: lizmap/modules/filter/classes/filterDatasource.class.php - - - - message: "#^Method filterDatasource\\:\\:__construct\\(\\) with return type void returns mixed but should not return anything\\.$#" - count: 2 - path: lizmap/modules/filter/classes/filterDatasource.class.php - - - - message: "#^Property filterDatasource\\:\\:\\$data is unused\\.$#" - count: 1 - path: lizmap/modules/filter/classes/filterDatasource.class.php - - - - message: "#^Property filterDatasource\\:\\:\\$layerId is unused\\.$#" - count: 1 - path: lizmap/modules/filter/classes/filterDatasource.class.php - - - - message: "#^Property filterDatasource\\:\\:\\$layername is never read, only written\\.$#" - count: 1 - path: lizmap/modules/filter/classes/filterDatasource.class.php - - - - message: "#^Property filterDatasource\\:\\:\\$project is never read, only written\\.$#" - count: 1 - path: lizmap/modules/filter/classes/filterDatasource.class.php - - - - message: "#^Property filterDatasource\\:\\:\\$repository is never read, only written\\.$#" - count: 1 - path: lizmap/modules/filter/classes/filterDatasource.class.php - - - - message: "#^Property serviceCtrl\\:\\:\\$config is never read, only written\\.$#" - count: 1 - path: lizmap/modules/filter/controllers/service.classic.php - - - - message: "#^Property serviceCtrl\\:\\:\\$project is never read, only written\\.$#" - count: 1 - path: lizmap/modules/filter/controllers/service.classic.php - - - - message: "#^Property serviceCtrl\\:\\:\\$repository is never read, only written\\.$#" - count: 1 - path: lizmap/modules/filter/controllers/service.classic.php - - - - message: "#^Unreachable statement \\- code above always terminates\\.$#" - count: 4 - path: lizmap/modules/filter/controllers/service.classic.php - - - - message: "#^If condition is always true\\.$#" - count: 1 - path: lizmap/modules/lizmap/classes/lizmap.class.php - - - - message: "#^Left side of && is always true\\.$#" - count: 1 - path: lizmap/modules/lizmap/classes/lizmap.class.php - - - - message: "#^Negated boolean expression is always false\\.$#" - count: 2 - path: lizmap/modules/lizmap/classes/lizmap.class.php - - - - message: "#^Static property lizmap\\:\\:\\$lizmapServicesInstance \\(lizmapServices\\) in isset\\(\\) is not nullable\\.$#" - count: 1 - path: lizmap/modules/lizmap/classes/lizmap.class.php - - - - message: "#^If condition is always true\\.$#" - count: 1 - path: lizmap/modules/lizmap/classes/lizmapLog.listener.php - - - - message: "#^Property Lizmap\\\\Request\\\\OGCRequest\\:\\:\\$project \\(Lizmap\\\\Project\\\\Project\\) does not accept lizmapProject\\.$#" - count: 1 - path: lizmap/modules/lizmap/classes/lizmapOGCRequest.class.php - - - - message: "#^Method lizmapServices\\:\\:getLizmapRepository\\(\\) should return lizmapRepository but returns false\\.$#" - count: 1 - path: lizmap/modules/lizmap/classes/lizmapServices.class.php - - - - message: "#^Strict comparison using \\=\\=\\= between int\\|false and '1' will always evaluate to false\\.$#" - count: 1 - path: lizmap/modules/lizmap/classes/lizmapServices.class.php - - - - message: "#^Strict comparison using \\=\\=\\= between int\\|false and 'true' will always evaluate to false\\.$#" - count: 1 - path: lizmap/modules/lizmap/classes/lizmapServices.class.php - - - - message: "#^Strict comparison using \\=\\=\\= between string and null will always evaluate to false\\.$#" - count: 1 - path: lizmap/modules/lizmap/classes/lizmapServices.class.php - - - - message: "#^Variable \\$data in isset\\(\\) always exists and is not nullable\\.$#" - count: 1 - path: lizmap/modules/lizmap/classes/lizmapServices.class.php - - - - message: "#^Result of \\|\\| is always false\\.$#" - count: 1 - path: lizmap/modules/lizmap/classes/qgisExpressionUtils.class.php - - - - message: "#^Strict comparison using \\=\\=\\= between jFormsBase and null will always evaluate to false\\.$#" - count: 1 - path: lizmap/modules/lizmap/classes/qgisExpressionUtils.class.php - - - - message: "#^Strict comparison using \\=\\=\\= between qgisAttributeEditorElement and null will always evaluate to false\\.$#" - count: 1 - path: lizmap/modules/lizmap/classes/qgisExpressionUtils.class.php - - - - message: "#^Strict comparison using \\=\\=\\= between string and null will always evaluate to false\\.$#" - count: 1 - path: lizmap/modules/lizmap/classes/qgisExpressionUtils.class.php - - - - message: "#^Cannot access property \\$geomtype on bool\\|object\\.$#" - count: 1 - path: lizmap/modules/lizmap/classes/qgisVectorLayer.class.php - - - - message: "#^Cannot access property \\$type on object\\|true\\.$#" - count: 1 - path: lizmap/modules/lizmap/classes/qgisVectorLayer.class.php - - - - message: "#^Cannot access property \\$v on object\\|true\\.$#" - count: 3 - path: lizmap/modules/lizmap/classes/qgisVectorLayer.class.php - - - - message: "#^Method qgisVectorLayer\\:\\:getConstraints\\(\\) should return array\\ but returns array\\\\.$#" - count: 1 - path: lizmap/modules/lizmap/classes/qgisVectorLayer.class.php - - - - message: "#^Method qgisVectorLayer\\:\\:getConstraints\\(\\) should return array\\ but returns string\\.$#" - count: 1 - path: lizmap/modules/lizmap/classes/qgisVectorLayer.class.php - - - - message: "#^Method qgisVectorLayer\\:\\:getDatasourceConnection\\(\\) should return jDbConnection but returns null\\.$#" - count: 1 - path: lizmap/modules/lizmap/classes/qgisVectorLayer.class.php - - - - message: "#^Negated boolean expression is always false\\.$#" - count: 4 - path: lizmap/modules/lizmap/classes/qgisVectorLayer.class.php - - - - message: "#^Unreachable statement \\- code above always terminates\\.$#" - count: 1 - path: lizmap/modules/lizmap/classes/qgisVectorLayer.class.php - - - - message: "#^Variable \\$sql might not be defined\\.$#" - count: 1 - path: lizmap/modules/lizmap/classes/qgisVectorLayer.class.php - - - - message: "#^Access to an undefined property jResponse\\:\\:\\$content\\.$#" - count: 3 - path: lizmap/modules/lizmap/controllers/ban.classic.php - - - - message: "#^Access to an undefined property jResponse\\:\\:\\$mimeType\\.$#" - count: 1 - path: lizmap/modules/lizmap/controllers/ban.classic.php - - - - message: "#^Access to an undefined property jResponse\\:\\:\\$outputFileName\\.$#" - count: 1 - path: lizmap/modules/lizmap/controllers/ban.classic.php - - - - message: "#^Binary operation \"\\+\" between string and \\(float\\|int\\) results in an error\\.$#" - count: 2 - path: lizmap/modules/lizmap/controllers/ban.classic.php - - - - message: "#^Binary operation \"\\-\" between string and string results in an error\\.$#" - count: 2 - path: lizmap/modules/lizmap/controllers/ban.classic.php - - - - message: "#^Method banCtrl\\:\\:search\\(\\) should return jResponseBinary but returns jResponse\\.$#" - count: 3 - path: lizmap/modules/lizmap/controllers/ban.classic.php - - - - - message: "#^Access to an undefined property jFormsControl\\:\\:\\$datasource\\.$#" - count: 2 - path: lizmap/modules/lizmap/controllers/edition.classic.php - - - - - message: "#^Access to an undefined property jResponse\\:\\:\\$content\\.$#" - count: 2 - path: lizmap/modules/lizmap/controllers/edition.classic.php - - - - message: "#^Access to an undefined property jResponse\\:\\:\\$data\\.$#" - count: 1 - path: lizmap/modules/lizmap/controllers/edition.classic.php - - - - - message: "#^Call to an undefined method qgisMapLayer\\:\\:getDbFieldsInfo\\(\\)\\.$#" - count: 1 - path: lizmap/modules/lizmap/controllers/edition.classic.php - - - - message: "#^Call to an undefined method qgisMapLayer\\:\\:getRealEditionCapabilities\\(\\)\\.$#" - count: 1 - path: lizmap/modules/lizmap/controllers/edition.classic.php - - - - message: "#^Call to an undefined method qgisMapLayer\\:\\:unlinkChild\\(\\)\\.$#" - count: 1 - path: lizmap/modules/lizmap/controllers/edition.classic.php - - - - message: "#^If condition is always true\\.$#" - count: 1 - path: lizmap/modules/lizmap/controllers/edition.classic.php - - - - message: "#^Negated boolean expression is always false\\.$#" - count: 6 - path: lizmap/modules/lizmap/controllers/edition.classic.php - - - - message: "#^Property editionCtrl\\:\\:\\$layer \\(qgisVectorLayer\\) does not accept default value of type string\\.$#" - count: 1 - path: lizmap/modules/lizmap/controllers/edition.classic.php - - - - message: "#^Property editionCtrl\\:\\:\\$layer \\(qgisVectorLayer\\) does not accept qgisMapLayer\\|null\\.$#" - count: 1 - path: lizmap/modules/lizmap/controllers/edition.classic.php - - - - message: "#^Property editionCtrl\\:\\:\\$layerXml \\(SimpleXMLElement\\) does not accept default value of type string\\.$#" - count: 1 - path: lizmap/modules/lizmap/controllers/edition.classic.php - - - - message: "#^Access to an undefined property jResponse\\:\\:\\$data\\.$#" - count: 2 - path: lizmap/modules/lizmap/controllers/geobookmark.classic.php - - - - message: "#^Call to an undefined method jResponse\\:\\:addContent\\(\\)\\.$#" - count: 1 - path: lizmap/modules/lizmap/controllers/geobookmark.classic.php - - - - message: "#^Variable \\$params might not be defined\\.$#" - count: 2 - path: lizmap/modules/lizmap/controllers/geobookmark.classic.php - - - - message: "#^Access to an undefined property jResponse\\:\\:\\$content\\.$#" - count: 2 - path: lizmap/modules/lizmap/controllers/osm.classic.php - - - - message: "#^Access to an undefined property jResponse\\:\\:\\$mimeType\\.$#" - count: 1 - path: lizmap/modules/lizmap/controllers/osm.classic.php - - - - message: "#^Access to an undefined property jResponse\\:\\:\\$outputFileName\\.$#" - count: 1 - path: lizmap/modules/lizmap/controllers/osm.classic.php - - - - message: "#^Method osmCtrl\\:\\:nominatim\\(\\) should return jResponseBinary but returns jResponse\\.$#" - count: 2 - path: lizmap/modules/lizmap/controllers/osm.classic.php - - - - message: "#^Access to an undefined property jResponse\\:\\:\\$content\\.$#" - count: 1 - path: lizmap/modules/lizmap/controllers/search.classic.php - - - - message: "#^Access to an undefined property jResponse\\:\\:\\$mimeType\\.$#" - count: 1 - path: lizmap/modules/lizmap/controllers/search.classic.php - - - - message: "#^Access to an undefined property jResponse\\:\\:\\$outputFileName\\.$#" - count: 1 - path: lizmap/modules/lizmap/controllers/search.classic.php - - - - message: "#^Method searchCtrl\\:\\:get\\(\\) should return jResponseBinary but returns jResponse\\.$#" - count: 6 - path: lizmap/modules/lizmap/controllers/search.classic.php - - - - message: "#^Call to an undefined method qgisMapLayer\\:\\:getWfsTypeName\\(\\)\\.$#" - count: 1 - path: lizmap/modules/lizmap/controllers/service.classic.php - - - - message: "#^Property serviceCtrl\\:\\:\\$services \\(lizmapServices\\) does not accept default value of type string\\.$#" - count: 1 - path: lizmap/modules/lizmap/controllers/service.classic.php - - - - message: "#^Access to property \\$mailer on an unknown class StdObj\\.$#" - count: 1 - path: lizmap/modules/lizmap/install/upgrade_configjcommunity.php - - - - - message: "#^Return type \\(Iterator\\) of method Lizmap\\\\App\\\\JelixContext\\:\\:aclUserGroupsInfo\\(\\) should be compatible with return type \\(array\\) of method Lizmap\\\\App\\\\AppContextInterface\\:\\:aclUserGroupsInfo\\(\\)$#" - count: 1 - path: lizmap/modules/lizmap/lib/App/JelixContext.php - - - - message: "#^Access to an undefined property jFormsControl\\:\\:\\$datasource\\.$#" - count: 2 - path: lizmap/modules/lizmap/lib/Form/QgisForm.php - - - - message: "#^Access to an undefined property jICoordPlugin\\:\\:\\$config\\.$#" - count: 2 - path: lizmap/modules/lizmap/lib/Form/QgisForm.php - - - - message: "#^Method Lizmap\\\\Form\\\\QgisForm\\:\\:saveToDb\\(\\) should return array\\|int\\|false but returns true\\.$#" - count: 1 - path: lizmap/modules/lizmap/lib/Form/QgisForm.php - - - - message: "#^Negated boolean expression is always false\\.$#" - count: 1 - path: lizmap/modules/lizmap/lib/Form/QgisForm.php - - - - message: "#^PHPDoc tag @param references unknown parameter\\: \\$cnx$#" - count: 1 - path: lizmap/modules/lizmap/lib/Form/QgisForm.php - - - - message: "#^Result of && is always false\\.$#" - count: 2 - path: lizmap/modules/lizmap/lib/Form/QgisForm.php - - - - message: "#^Right side of && is always true\\.$#" - count: 1 - path: lizmap/modules/lizmap/lib/Form/QgisForm.php - - - - message: "#^Strict comparison using \\!\\=\\= between 0 and 0 will always evaluate to false\\.$#" - count: 1 - path: lizmap/modules/lizmap/lib/Form/QgisForm.php - - - - message: "#^Strict comparison using \\!\\=\\= between 0\\.0 and 0\\.0 will always evaluate to false\\.$#" - count: 1 - path: lizmap/modules/lizmap/lib/Form/QgisForm.php - - - - message: "#^Strict comparison using \\=\\=\\= between jFormsControl and null will always evaluate to false\\.$#" - count: 1 - path: lizmap/modules/lizmap/lib/Form/QgisForm.php - - - - message: "#^Strict comparison using \\=\\=\\= between non\\-empty\\-string and null will always evaluate to false\\.$#" - count: 1 - path: lizmap/modules/lizmap/lib/Form/QgisForm.php - - - - message: "#^Unreachable statement \\- code above always terminates\\.$#" - count: 1 - path: lizmap/modules/lizmap/lib/Form/QgisForm.php - - - - message: "#^Access to an undefined property jFormsControl\\:\\:\\$datasource\\.$#" - count: 2 - path: lizmap/modules/lizmap/lib/Form/QgisFormControl.php - - - - message: "#^Access to an undefined property jFormsControl\\:\\:\\$valueOnCheck\\.$#" - count: 1 - path: lizmap/modules/lizmap/lib/Form/QgisFormControl.php - - - - message: "#^Access to an undefined property jFormsControl\\:\\:\\$valueOnUncheck\\.$#" - count: 1 - path: lizmap/modules/lizmap/lib/Form/QgisFormControl.php - - - - message: "#^If condition is always true\\.$#" - count: 3 - path: lizmap/modules/lizmap/lib/Form/QgisFormControl.php - - - - message: "#^PHPDoc tag @param references unknown parameter\\: \\$aliasXml$#" - count: 1 - path: lizmap/modules/lizmap/lib/Form/QgisFormControl.php - - - - message: "#^Unreachable statement \\- code above always terminates\\.$#" - count: 3 - path: lizmap/modules/lizmap/lib/Form/QgisFormControl.php - - - - message: "#^Call to an undefined method qgisMapLayer\\:\\:getWfsTypeName\\(\\)\\.$#" - count: 2 - path: lizmap/modules/lizmap/lib/Form/QgisFormValueRelationDynamicDatasource.php - - - - message: "#^Method Lizmap\\\\Form\\\\QgisFormValueRelationDynamicDatasource\\:\\:getLabel2\\(\\) should return string but returns null\\.$#" - count: 1 - path: lizmap/modules/lizmap/lib/Form/QgisFormValueRelationDynamicDatasource.php - - - - message: "#^Result of && is always true\\.$#" - count: 1 - path: lizmap/modules/lizmap/lib/Form/QgisFormValueRelationDynamicDatasource.php - - - - message: "#^Method Lizmap\\\\Logger\\\\Config\\:\\:getLogItem\\(\\) should return Lizmap\\\\Logger\\\\Item but returns null\\.$#" - count: 1 - path: lizmap/modules/lizmap/lib/Logger/Config.php - - - - message: "#^Cannot access property \\$sequence_name on object\\|true\\.$#" - count: 1 - path: lizmap/modules/lizmap/lib/Logger/MigratorFromSqlite.php - - - - message: "#^Access to an undefined property object\\:\\:\\$id\\.$#" - count: 6 - path: lizmap/modules/lizmap/lib/Project/Project.php - - - - message: "#^Access to an undefined property object\\:\\:\\$name\\.$#" - count: 1 - path: lizmap/modules/lizmap/lib/Project/Project.php - - - - message: "#^PHPDoc tag @param for parameter \\$xml with type SimpleXMLElement is incompatible with native type Lizmap\\\\Project\\\\QgisProject\\.$#" - count: 1 - path: lizmap/modules/lizmap/lib/Project/Project.php - - - - message: "#^Property Lizmap\\\\Project\\\\Project\\:\\:\\$printCapabilities \\(object\\) does not accept default value of type array\\.$#" - count: 1 - path: lizmap/modules/lizmap/lib/Project/Project.php - - - - message: "#^PHPDoc tag @param has invalid value \\(int the life time of the cache, in seconds\\)\\: Unexpected token \"the\", expected variable at offset 153$#" - count: 1 - path: lizmap/modules/lizmap/lib/Project/ProjectCache.php - - - - message: "#^PHPDoc tag @param references unknown parameter\\: \\$props$#" - count: 1 - path: lizmap/modules/lizmap/lib/Project/ProjectCache.php - - - - message: "#^Left side of && is always true\\.$#" - count: 1 - path: lizmap/modules/lizmap/lib/Project/ProjectConfig.php - - - - message: "#^Negated boolean expression is always false\\.$#" - count: 1 - path: lizmap/modules/lizmap/lib/Project/ProjectConfig.php - - - - message: "#^Property Lizmap\\\\Project\\\\ProjectConfig\\:\\:\\$layers \\(object\\) in isset\\(\\) is not nullable\\.$#" - count: 1 - path: lizmap/modules/lizmap/lib/Project/ProjectConfig.php - - - - message: "#^Variable \\$layerId in empty\\(\\) always exists and is not falsy\\.$#" - count: 1 - path: lizmap/modules/lizmap/lib/Project/ProjectConfig.php - - - - message: "#^Variable \\$name in empty\\(\\) always exists and is not falsy\\.$#" - count: 2 - path: lizmap/modules/lizmap/lib/Project/ProjectConfig.php - - - - message: "#^Variable \\$shortName in empty\\(\\) always exists and is not falsy\\.$#" - count: 1 - path: lizmap/modules/lizmap/lib/Project/ProjectConfig.php - - - - message: "#^Variable \\$title in empty\\(\\) always exists and is not falsy\\.$#" - count: 1 - path: lizmap/modules/lizmap/lib/Project/ProjectConfig.php - - - - message: "#^Variable \\$typeName in empty\\(\\) always exists and is not falsy\\.$#" - count: 1 - path: lizmap/modules/lizmap/lib/Project/ProjectConfig.php - - - - message: "#^Cannot access property \\$sequence_name on object\\|true\\.$#" - count: 1 - path: lizmap/modules/lizmap/lib/Users/MigratorFromSqlite.php - - - - message: "#^If condition is always true\\.$#" - count: 1 - path: lizmap/modules/lizmap/lib/Users/MigratorFromSqlite.php - - - - message: "#^Part \\$profile \\(array\\{\\}\\) of encapsed string cannot be cast to string\\.$#" - count: 1 - path: lizmap/modules/lizmap/lib/Users/MigratorFromSqlite.php - - - - message: "#^Unreachable statement \\- code above always terminates\\.$#" - count: 1 - path: lizmap/modules/lizmap/lib/Users/MigratorFromSqlite.php - - - - message: "#^Unreachable statement \\- code above always terminates\\.$#" - count: 1 - path: lizmap/modules/view/classes/lizmapMapDockItem.class.php - - - - message: "#^PHPDoc tag @param references unknown parameter\\: \\$repository$#" - count: 1 - path: lizmap/modules/view/controllers/default.classic.php - - - - message: "#^Inner named functions are not supported by PHPStan\\. Consider refactoring to an anonymous function, class method, or a top\\-level\\-defined function\\. See issue \\#165 \\(https\\://github\\.com/phpstan/phpstan/issues/165\\) for more details\\.$#" - count: 1 - path: lizmap/modules/view/controllers/lizAjax.classic.php - - - - message: "#^Inner named functions are not supported by PHPStan\\. Consider refactoring to an anonymous function, class method, or a top\\-level\\-defined function\\. See issue \\#165 \\(https\\://github\\.com/phpstan/phpstan/issues/165\\) for more details\\.$#" - count: 1 - path: lizmap/modules/view/controllers/lizMap.classic.php - - - message: "#^Call to an undefined static method jLocale::getBundle\\(\\)\\.$#" - count: 1 - path: lizmap/modules/lizmap/lib/App/LocalesLoader.php - - - message: "#^Unreachable statement - code above always terminates\\.$#" - count: 2 - path: lizmap/modules/lizmap/classes/lizmap.class.php \ No newline at end of file + bootstrapFiles: + - lizmap/vendor/autoload.php + - lizmap/vendor/jelix/jelix/lib/jelix/init.php + - lizmap/app/responses/AbstractLizmapHtmlResponse.php + scanDirectories: + - lizmap/vendor/ + level: 4 + paths: + - lizmap/modules + tmpDir: .phpstan.cache + universalObjectCratesClasses: + - jDaoRecordBase + - jEvent + ignoreErrors: + - '#^Call to an undefined method jDaoFactoryBase#' + - + message: "#^Comparison operation \"\\=\\=\" between 0\\|0\\.0\\|''\\|'0'\\|array\\{\\}\\|false\\|null and 0 results in an error\\.$#" + count: 1 + path: lizmap/modules/dataviz/classes/datavizPlot.class.php + + - + message: "#^Offset float does not exist on array\\{\\}\\.$#" + count: 2 + path: lizmap/modules/dataviz/classes/datavizPlot.class.php + + - + message: "#^Offset float\\|int\\<0, max\\> does not exist on array\\{\\}\\.$#" + count: 1 + path: lizmap/modules/dataviz/classes/datavizPlot.class.php + + - + message: "#^Method filterConfig\\:\\:__construct\\(\\) with return type void returns false but should not return anything\\.$#" + count: 3 + path: lizmap/modules/filter/classes/filterConfig.class.php + + - + message: "#^Property filterConfig\\:\\:\\$lproj is never read, only written\\.$#" + count: 1 + path: lizmap/modules/filter/classes/filterConfig.class.php + + - + message: "#^Property filterConfig\\:\\:\\$project is never read, only written\\.$#" + count: 1 + path: lizmap/modules/filter/classes/filterConfig.class.php + + - + message: "#^Property filterConfig\\:\\:\\$repository is never read, only written\\.$#" + count: 1 + path: lizmap/modules/filter/classes/filterConfig.class.php + + - + message: "#^Call to an undefined method qgisMapLayer\\:\\:getDatasourceConnection\\(\\)\\.$#" + count: 1 + path: lizmap/modules/filter/classes/filterDatasource.class.php + + - + message: "#^Call to an undefined method qgisMapLayer\\:\\:getDatasourceParameters\\(\\)\\.$#" + count: 1 + path: lizmap/modules/filter/classes/filterDatasource.class.php + + - + message: "#^Method filterDatasource\\:\\:__construct\\(\\) with return type void returns mixed but should not return anything\\.$#" + count: 2 + path: lizmap/modules/filter/classes/filterDatasource.class.php + + - + message: "#^Property filterDatasource\\:\\:\\$data is unused\\.$#" + count: 1 + path: lizmap/modules/filter/classes/filterDatasource.class.php + + - + message: "#^Property filterDatasource\\:\\:\\$layerId is unused\\.$#" + count: 1 + path: lizmap/modules/filter/classes/filterDatasource.class.php + + - + message: "#^Property filterDatasource\\:\\:\\$layername is never read, only written\\.$#" + count: 1 + path: lizmap/modules/filter/classes/filterDatasource.class.php + + - + message: "#^Property filterDatasource\\:\\:\\$project is never read, only written\\.$#" + count: 1 + path: lizmap/modules/filter/classes/filterDatasource.class.php + + - + message: "#^Property filterDatasource\\:\\:\\$repository is never read, only written\\.$#" + count: 1 + path: lizmap/modules/filter/classes/filterDatasource.class.php + + - + message: "#^Property serviceCtrl\\:\\:\\$config is never read, only written\\.$#" + count: 1 + path: lizmap/modules/filter/controllers/service.classic.php + + - + message: "#^Property serviceCtrl\\:\\:\\$project is never read, only written\\.$#" + count: 1 + path: lizmap/modules/filter/controllers/service.classic.php + + - + message: "#^Property serviceCtrl\\:\\:\\$repository is never read, only written\\.$#" + count: 1 + path: lizmap/modules/filter/controllers/service.classic.php + + - + message: "#^Unreachable statement \\- code above always terminates\\.$#" + count: 4 + path: lizmap/modules/filter/controllers/service.classic.php + + - + message: "#^If condition is always true\\.$#" + count: 1 + path: lizmap/modules/lizmap/classes/lizmap.class.php + + - + message: "#^Left side of && is always true\\.$#" + count: 1 + path: lizmap/modules/lizmap/classes/lizmap.class.php + + - + message: "#^Negated boolean expression is always false\\.$#" + count: 2 + path: lizmap/modules/lizmap/classes/lizmap.class.php + + - + message: "#^Static property lizmap\\:\\:\\$lizmapServicesInstance \\(lizmapServices\\) in isset\\(\\) is not nullable\\.$#" + count: 1 + path: lizmap/modules/lizmap/classes/lizmap.class.php + + - + message: "#^If condition is always true\\.$#" + count: 1 + path: lizmap/modules/lizmap/classes/lizmapLog.listener.php + + - + message: "#^Property Lizmap\\\\Request\\\\OGCRequest\\:\\:\\$project \\(Lizmap\\\\Project\\\\Project\\) does not accept lizmapProject\\.$#" + count: 1 + path: lizmap/modules/lizmap/classes/lizmapOGCRequest.class.php + + - + message: "#^Method lizmapServices\\:\\:getLizmapRepository\\(\\) should return lizmapRepository but returns false\\.$#" + count: 1 + path: lizmap/modules/lizmap/classes/lizmapServices.class.php + + - + message: "#^Strict comparison using \\=\\=\\= between int\\|false and '1' will always evaluate to false\\.$#" + count: 1 + path: lizmap/modules/lizmap/classes/lizmapServices.class.php + + - + message: "#^Strict comparison using \\=\\=\\= between int\\|false and 'true' will always evaluate to false\\.$#" + count: 1 + path: lizmap/modules/lizmap/classes/lizmapServices.class.php + + - + message: "#^Strict comparison using \\=\\=\\= between string and null will always evaluate to false\\.$#" + count: 1 + path: lizmap/modules/lizmap/classes/lizmapServices.class.php + + - + message: "#^Variable \\$data in isset\\(\\) always exists and is not nullable\\.$#" + count: 1 + path: lizmap/modules/lizmap/classes/lizmapServices.class.php + + - + message: "#^Result of \\|\\| is always false\\.$#" + count: 1 + path: lizmap/modules/lizmap/classes/qgisExpressionUtils.class.php + + - + message: "#^Strict comparison using \\=\\=\\= between jFormsBase and null will always evaluate to false\\.$#" + count: 1 + path: lizmap/modules/lizmap/classes/qgisExpressionUtils.class.php + + - + message: "#^Strict comparison using \\=\\=\\= between qgisAttributeEditorElement and null will always evaluate to false\\.$#" + count: 1 + path: lizmap/modules/lizmap/classes/qgisExpressionUtils.class.php + + - + message: "#^Strict comparison using \\=\\=\\= between string and null will always evaluate to false\\.$#" + count: 1 + path: lizmap/modules/lizmap/classes/qgisExpressionUtils.class.php + + - + message: "#^Cannot access property \\$geomtype on bool\\|object\\.$#" + count: 1 + path: lizmap/modules/lizmap/classes/qgisVectorLayer.class.php + + - + message: "#^Cannot access property \\$type on object\\|true\\.$#" + count: 1 + path: lizmap/modules/lizmap/classes/qgisVectorLayer.class.php + + - + message: "#^Cannot access property \\$v on object\\|true\\.$#" + count: 3 + path: lizmap/modules/lizmap/classes/qgisVectorLayer.class.php + + - + message: "#^Method qgisVectorLayer\\:\\:getConstraints\\(\\) should return array\\ but returns array\\\\.$#" + count: 1 + path: lizmap/modules/lizmap/classes/qgisVectorLayer.class.php + + - + message: "#^Method qgisVectorLayer\\:\\:getConstraints\\(\\) should return array\\ but returns string\\.$#" + count: 1 + path: lizmap/modules/lizmap/classes/qgisVectorLayer.class.php + + - + message: "#^Method qgisVectorLayer\\:\\:getDatasourceConnection\\(\\) should return jDbConnection but returns null\\.$#" + count: 1 + path: lizmap/modules/lizmap/classes/qgisVectorLayer.class.php + + - + message: "#^Negated boolean expression is always false\\.$#" + count: 4 + path: lizmap/modules/lizmap/classes/qgisVectorLayer.class.php + + - + message: "#^Unreachable statement \\- code above always terminates\\.$#" + count: 1 + path: lizmap/modules/lizmap/classes/qgisVectorLayer.class.php + + - + message: "#^Variable \\$sql might not be defined\\.$#" + count: 1 + path: lizmap/modules/lizmap/classes/qgisVectorLayer.class.php + + - + message: "#^Access to an undefined property jResponse\\:\\:\\$content\\.$#" + count: 3 + path: lizmap/modules/lizmap/controllers/ban.classic.php + + - + message: "#^Access to an undefined property jResponse\\:\\:\\$mimeType\\.$#" + count: 1 + path: lizmap/modules/lizmap/controllers/ban.classic.php + + - + message: "#^Access to an undefined property jResponse\\:\\:\\$outputFileName\\.$#" + count: 1 + path: lizmap/modules/lizmap/controllers/ban.classic.php + + - + message: "#^Binary operation \"\\+\" between string and \\(float\\|int\\) results in an error\\.$#" + count: 2 + path: lizmap/modules/lizmap/controllers/ban.classic.php + + - + message: "#^Binary operation \"\\-\" between string and string results in an error\\.$#" + count: 2 + path: lizmap/modules/lizmap/controllers/ban.classic.php + + - + message: "#^Method banCtrl\\:\\:search\\(\\) should return jResponseBinary but returns jResponse\\.$#" + count: 3 + path: lizmap/modules/lizmap/controllers/ban.classic.php + + + - + message: "#^Access to an undefined property jFormsControl\\:\\:\\$datasource\\.$#" + count: 2 + path: lizmap/modules/lizmap/controllers/edition.classic.php + + + - + message: "#^Access to an undefined property jResponse\\:\\:\\$content\\.$#" + count: 2 + path: lizmap/modules/lizmap/controllers/edition.classic.php + + - + message: "#^Access to an undefined property jResponse\\:\\:\\$data\\.$#" + count: 1 + path: lizmap/modules/lizmap/controllers/edition.classic.php + + + - + message: "#^Call to an undefined method qgisMapLayer\\:\\:getDbFieldsInfo\\(\\)\\.$#" + count: 1 + path: lizmap/modules/lizmap/controllers/edition.classic.php + + - + message: "#^Call to an undefined method qgisMapLayer\\:\\:getRealEditionCapabilities\\(\\)\\.$#" + count: 1 + path: lizmap/modules/lizmap/controllers/edition.classic.php + + - + message: "#^Call to an undefined method qgisMapLayer\\:\\:unlinkChild\\(\\)\\.$#" + count: 1 + path: lizmap/modules/lizmap/controllers/edition.classic.php + + - + message: "#^If condition is always true\\.$#" + count: 1 + path: lizmap/modules/lizmap/controllers/edition.classic.php + + - + message: "#^Negated boolean expression is always false\\.$#" + count: 6 + path: lizmap/modules/lizmap/controllers/edition.classic.php + + - + message: "#^Property editionCtrl\\:\\:\\$layer \\(qgisVectorLayer\\) does not accept default value of type string\\.$#" + count: 1 + path: lizmap/modules/lizmap/controllers/edition.classic.php + + - + message: "#^Property editionCtrl\\:\\:\\$layer \\(qgisVectorLayer\\) does not accept qgisMapLayer\\|null\\.$#" + count: 1 + path: lizmap/modules/lizmap/controllers/edition.classic.php + + - + message: "#^Property editionCtrl\\:\\:\\$layerXml \\(SimpleXMLElement\\) does not accept default value of type string\\.$#" + count: 1 + path: lizmap/modules/lizmap/controllers/edition.classic.php + + - + message: "#^Access to an undefined property jResponse\\:\\:\\$data\\.$#" + count: 2 + path: lizmap/modules/lizmap/controllers/geobookmark.classic.php + + - + message: "#^Call to an undefined method jResponse\\:\\:addContent\\(\\)\\.$#" + count: 1 + path: lizmap/modules/lizmap/controllers/geobookmark.classic.php + + - + message: "#^Variable \\$params might not be defined\\.$#" + count: 2 + path: lizmap/modules/lizmap/controllers/geobookmark.classic.php + + - + message: "#^Access to an undefined property jResponse\\:\\:\\$content\\.$#" + count: 2 + path: lizmap/modules/lizmap/controllers/osm.classic.php + + - + message: "#^Access to an undefined property jResponse\\:\\:\\$mimeType\\.$#" + count: 1 + path: lizmap/modules/lizmap/controllers/osm.classic.php + + - + message: "#^Access to an undefined property jResponse\\:\\:\\$outputFileName\\.$#" + count: 1 + path: lizmap/modules/lizmap/controllers/osm.classic.php + + - + message: "#^Method osmCtrl\\:\\:nominatim\\(\\) should return jResponseBinary but returns jResponse\\.$#" + count: 2 + path: lizmap/modules/lizmap/controllers/osm.classic.php + + - + message: "#^Access to an undefined property jResponse\\:\\:\\$content\\.$#" + count: 1 + path: lizmap/modules/lizmap/controllers/search.classic.php + + - + message: "#^Access to an undefined property jResponse\\:\\:\\$mimeType\\.$#" + count: 1 + path: lizmap/modules/lizmap/controllers/search.classic.php + + - + message: "#^Access to an undefined property jResponse\\:\\:\\$outputFileName\\.$#" + count: 1 + path: lizmap/modules/lizmap/controllers/search.classic.php + + - + message: "#^Method searchCtrl\\:\\:get\\(\\) should return jResponseBinary but returns jResponse\\.$#" + count: 6 + path: lizmap/modules/lizmap/controllers/search.classic.php + + - + message: "#^Call to an undefined method qgisMapLayer\\:\\:getWfsTypeName\\(\\)\\.$#" + count: 1 + path: lizmap/modules/lizmap/controllers/service.classic.php + + - + message: "#^Property serviceCtrl\\:\\:\\$services \\(lizmapServices\\) does not accept default value of type string\\.$#" + count: 1 + path: lizmap/modules/lizmap/controllers/service.classic.php + + - + message: "#^Access to property \\$mailer on an unknown class StdObj\\.$#" + count: 1 + path: lizmap/modules/lizmap/install/upgrade_configjcommunity.php + + + - + message: "#^Return type \\(Iterator\\) of method Lizmap\\\\App\\\\JelixContext\\:\\:aclUserGroupsInfo\\(\\) should be compatible with return type \\(array\\) of method Lizmap\\\\App\\\\AppContextInterface\\:\\:aclUserGroupsInfo\\(\\)$#" + count: 1 + path: lizmap/modules/lizmap/lib/App/JelixContext.php + + - + message: "#^Access to an undefined property jFormsControl\\:\\:\\$datasource\\.$#" + count: 2 + path: lizmap/modules/lizmap/lib/Form/QgisForm.php + + - + message: "#^Access to an undefined property jICoordPlugin\\:\\:\\$config\\.$#" + count: 2 + path: lizmap/modules/lizmap/lib/Form/QgisForm.php + + - + message: "#^Method Lizmap\\\\Form\\\\QgisForm\\:\\:saveToDb\\(\\) should return array\\|int\\|false but returns true\\.$#" + count: 1 + path: lizmap/modules/lizmap/lib/Form/QgisForm.php + + - + message: "#^Negated boolean expression is always false\\.$#" + count: 1 + path: lizmap/modules/lizmap/lib/Form/QgisForm.php + + - + message: "#^PHPDoc tag @param references unknown parameter\\: \\$cnx$#" + count: 1 + path: lizmap/modules/lizmap/lib/Form/QgisForm.php + + - + message: "#^Result of && is always false\\.$#" + count: 2 + path: lizmap/modules/lizmap/lib/Form/QgisForm.php + + - + message: "#^Right side of && is always true\\.$#" + count: 1 + path: lizmap/modules/lizmap/lib/Form/QgisForm.php + + - + message: "#^Strict comparison using \\!\\=\\= between 0 and 0 will always evaluate to false\\.$#" + count: 1 + path: lizmap/modules/lizmap/lib/Form/QgisForm.php + + - + message: "#^Strict comparison using \\!\\=\\= between 0\\.0 and 0\\.0 will always evaluate to false\\.$#" + count: 1 + path: lizmap/modules/lizmap/lib/Form/QgisForm.php + + - + message: "#^Strict comparison using \\=\\=\\= between jFormsControl and null will always evaluate to false\\.$#" + count: 1 + path: lizmap/modules/lizmap/lib/Form/QgisForm.php + + - + message: "#^Strict comparison using \\=\\=\\= between non\\-empty\\-string and null will always evaluate to false\\.$#" + count: 1 + path: lizmap/modules/lizmap/lib/Form/QgisForm.php + + - + message: "#^Unreachable statement \\- code above always terminates\\.$#" + count: 1 + path: lizmap/modules/lizmap/lib/Form/QgisForm.php + + - + message: "#^Access to an undefined property jFormsControl\\:\\:\\$datasource\\.$#" + count: 2 + path: lizmap/modules/lizmap/lib/Form/QgisFormControl.php + + - + message: "#^Access to an undefined property jFormsControl\\:\\:\\$valueOnCheck\\.$#" + count: 1 + path: lizmap/modules/lizmap/lib/Form/QgisFormControl.php + + - + message: "#^Access to an undefined property jFormsControl\\:\\:\\$valueOnUncheck\\.$#" + count: 1 + path: lizmap/modules/lizmap/lib/Form/QgisFormControl.php + + - + message: "#^If condition is always true\\.$#" + count: 3 + path: lizmap/modules/lizmap/lib/Form/QgisFormControl.php + + - + message: "#^PHPDoc tag @param references unknown parameter\\: \\$aliasXml$#" + count: 1 + path: lizmap/modules/lizmap/lib/Form/QgisFormControl.php + + - + message: "#^Unreachable statement \\- code above always terminates\\.$#" + count: 3 + path: lizmap/modules/lizmap/lib/Form/QgisFormControl.php + + - + message: "#^Call to an undefined method qgisMapLayer\\:\\:getWfsTypeName\\(\\)\\.$#" + count: 2 + path: lizmap/modules/lizmap/lib/Form/QgisFormValueRelationDynamicDatasource.php + + - + message: "#^Method Lizmap\\\\Form\\\\QgisFormValueRelationDynamicDatasource\\:\\:getLabel2\\(\\) should return string but returns null\\.$#" + count: 1 + path: lizmap/modules/lizmap/lib/Form/QgisFormValueRelationDynamicDatasource.php + + - + message: "#^Result of && is always true\\.$#" + count: 1 + path: lizmap/modules/lizmap/lib/Form/QgisFormValueRelationDynamicDatasource.php + + - + message: "#^Method Lizmap\\\\Logger\\\\Config\\:\\:getLogItem\\(\\) should return Lizmap\\\\Logger\\\\Item but returns null\\.$#" + count: 1 + path: lizmap/modules/lizmap/lib/Logger/Config.php + + - + message: "#^Cannot access property \\$sequence_name on object\\|true\\.$#" + count: 1 + path: lizmap/modules/lizmap/lib/Logger/MigratorFromSqlite.php + + - + message: "#^Access to an undefined property object\\:\\:\\$id\\.$#" + count: 6 + path: lizmap/modules/lizmap/lib/Project/Project.php + + - + message: "#^Access to an undefined property object\\:\\:\\$name\\.$#" + count: 1 + path: lizmap/modules/lizmap/lib/Project/Project.php + + - + message: "#^PHPDoc tag @param for parameter \\$xml with type SimpleXMLElement is incompatible with native type Lizmap\\\\Project\\\\QgisProject\\.$#" + count: 1 + path: lizmap/modules/lizmap/lib/Project/Project.php + + - + message: "#^Property Lizmap\\\\Project\\\\Project\\:\\:\\$printCapabilities \\(object\\) does not accept default value of type array\\.$#" + count: 1 + path: lizmap/modules/lizmap/lib/Project/Project.php + + - + message: "#^PHPDoc tag @param has invalid value \\(int the life time of the cache, in seconds\\)\\: Unexpected token \"the\", expected variable at offset 153$#" + count: 1 + path: lizmap/modules/lizmap/lib/Project/ProjectCache.php + + - + message: "#^PHPDoc tag @param references unknown parameter\\: \\$props$#" + count: 1 + path: lizmap/modules/lizmap/lib/Project/ProjectCache.php + + - + message: "#^Left side of && is always true\\.$#" + count: 1 + path: lizmap/modules/lizmap/lib/Project/ProjectConfig.php + + - + message: "#^Negated boolean expression is always false\\.$#" + count: 1 + path: lizmap/modules/lizmap/lib/Project/ProjectConfig.php + + - + message: "#^Property Lizmap\\\\Project\\\\ProjectConfig\\:\\:\\$layers \\(object\\) in isset\\(\\) is not nullable\\.$#" + count: 1 + path: lizmap/modules/lizmap/lib/Project/ProjectConfig.php + + - + message: "#^Variable \\$layerId in empty\\(\\) always exists and is not falsy\\.$#" + count: 1 + path: lizmap/modules/lizmap/lib/Project/ProjectConfig.php + + - + message: "#^Variable \\$name in empty\\(\\) always exists and is not falsy\\.$#" + count: 2 + path: lizmap/modules/lizmap/lib/Project/ProjectConfig.php + + - + message: "#^Variable \\$shortName in empty\\(\\) always exists and is not falsy\\.$#" + count: 1 + path: lizmap/modules/lizmap/lib/Project/ProjectConfig.php + + - + message: "#^Variable \\$title in empty\\(\\) always exists and is not falsy\\.$#" + count: 1 + path: lizmap/modules/lizmap/lib/Project/ProjectConfig.php + + - + message: "#^Variable \\$typeName in empty\\(\\) always exists and is not falsy\\.$#" + count: 1 + path: lizmap/modules/lizmap/lib/Project/ProjectConfig.php + + - + message: "#^Cannot access property \\$sequence_name on object\\|true\\.$#" + count: 1 + path: lizmap/modules/lizmap/lib/Users/MigratorFromSqlite.php + + - + message: "#^If condition is always true\\.$#" + count: 1 + path: lizmap/modules/lizmap/lib/Users/MigratorFromSqlite.php + + - + message: "#^Part \\$profile \\(array\\{\\}\\) of encapsed string cannot be cast to string\\.$#" + count: 1 + path: lizmap/modules/lizmap/lib/Users/MigratorFromSqlite.php + + - + message: "#^Unreachable statement \\- code above always terminates\\.$#" + count: 1 + path: lizmap/modules/lizmap/lib/Users/MigratorFromSqlite.php + + - + message: "#^Unreachable statement \\- code above always terminates\\.$#" + count: 1 + path: lizmap/modules/view/classes/lizmapMapDockItem.class.php + + - + message: "#^PHPDoc tag @param references unknown parameter\\: \\$repository$#" + count: 1 + path: lizmap/modules/view/controllers/default.classic.php + + - + message: "#^Inner named functions are not supported by PHPStan\\. Consider refactoring to an anonymous function, class method, or a top\\-level\\-defined function\\. See issue \\#165 \\(https\\://github\\.com/phpstan/phpstan/issues/165\\) for more details\\.$#" + count: 1 + path: lizmap/modules/view/controllers/lizAjax.classic.php + + - + message: "#^Inner named functions are not supported by PHPStan\\. Consider refactoring to an anonymous function, class method, or a top\\-level\\-defined function\\. See issue \\#165 \\(https\\://github\\.com/phpstan/phpstan/issues/165\\) for more details\\.$#" + count: 1 + path: lizmap/modules/view/controllers/lizMap.classic.php + - + message: "#^Call to an undefined static method jLocale::getBundle\\(\\)\\.$#" + count: 1 + path: lizmap/modules/lizmap/lib/App/LocalesLoader.php diff --git a/phpstan-ci.neon b/phpstan-ci.neon new file mode 100644 index 0000000000..d5184df5e5 --- /dev/null +++ b/phpstan-ci.neon @@ -0,0 +1,5 @@ +includes: + - phpstan-baseline.neon + +parameters: + reportUnmatchedIgnoredErrors: false diff --git a/phpstan.neon b/phpstan.neon index 308c66bc37..56dbf9cbc4 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -1,19 +1,3 @@ includes: - phpstan-baseline.neon -parameters: - bootstrapFiles: - - lizmap/vendor/autoload.php - - lizmap/vendor/jelix/jelix/lib/jelix/init.php - - lizmap/app/responses/AbstractLizmapHtmlResponse.php - scanDirectories: - - lizmap/vendor/ - level: 4 - paths: - - lizmap/modules - tmpDir: .phpstan.cache - ignoreErrors: - - '#^Call to an undefined method jDaoFactoryBase#' - universalObjectCratesClasses: - - jDaoRecordBase - - jEvent