diff --git a/lizmap/modules/admin/controllers/landing_page_content.classic.php b/lizmap/modules/admin/controllers/landing_page_content.classic.php index 4aef6ccf3a..0791cdc749 100644 --- a/lizmap/modules/admin/controllers/landing_page_content.classic.php +++ b/lizmap/modules/admin/controllers/landing_page_content.classic.php @@ -28,6 +28,7 @@ public function index() // Create the form, or get the existing one if we are here because of // a failed check + /** @var null|jFormsBase $form */ $form = jForms::get('admin~landing_page_content'); if (!$form) { $form = jForms::create('admin~landing_page_content'); @@ -68,6 +69,8 @@ public function save() { try { $form = jForms::fill('admin~landing_page_content'); + + /** @var null|jFormsBase $form */ if (!$form || !$form->check()) { // no form... this was a direct call to the save action // or content is invalid diff --git a/lizmap/modules/lizmap/lib/App/AppContextInterface.php b/lizmap/modules/lizmap/lib/App/AppContextInterface.php index 7851577772..4a3fd57802 100644 --- a/lizmap/modules/lizmap/lib/App/AppContextInterface.php +++ b/lizmap/modules/lizmap/lib/App/AppContextInterface.php @@ -50,11 +50,10 @@ public function getCoord(); * * @param string $right the key of the right to check * @param string $resource the id of a resource if any - * @param mixed $role * * @return bool true if the right is ok */ - public function aclCheck($role, $resource = null); + public function aclCheck($right, $resource = null); /** * Retrieve the list of groups id, the current user is member of, @@ -98,9 +97,6 @@ public function aclUserPrivateGroup($login = null); * Retrieve the list of groups properties, the current user is member of, * in the acl system. * - * @param string $login login of the user. if not given, the current user - * is taken account - * * @return array list of groups objects */ public function aclUserGroupsInfo(); @@ -183,8 +179,7 @@ public function logMessage($message, $cat = 'default'); * Log an Exception. * * @param \Exception $exception The exception to log - * @param string The category of the logged Exception - * @param mixed $cat + * @param string $cat The category of the logged Exception */ public function logException($exception, $cat = 'default'); @@ -200,13 +195,11 @@ public function createVirtualProfile($category, $name, $params); /** * Return the properties of a profile. * - * @param string The profile category - * @param string the profile name - * @param bool If true and if the profile doesn't exist, throw an error * instead of getting the default profile - * @param mixed $category - * @param mixed $name - * @param mixed $noDefault + * + * @param string $category The profile category + * @param string $name the profile name + * @param bool $noDefault If true and if the profile doesn't exist, throw an error * * @return array properties */ @@ -215,10 +208,8 @@ public function getProfile($category, $name = '', $noDefault = false); /** * Send an application event. * - * @param string The name of the event - * @param array the parameters of the event - * @param mixed $eventName - * @param mixed $params + * @param string $eventName The name of the event + * @param array $params the parameters of the event * * @return object */ @@ -285,8 +276,7 @@ public function getUrl($selector); * Returns the absolute Url. * * @param string $selector The Jelix selector of the Url - * @param array an associative array with the parameters of the Url - * @param mixed $params + * @param array $params an associative array with the parameters of the Url */ public function getFullUrl($selector, $params = array()); diff --git a/lizmap/modules/lizmap/lib/App/JelixContext.php b/lizmap/modules/lizmap/lib/App/JelixContext.php index 01390a6b56..195cff1749 100644 --- a/lizmap/modules/lizmap/lib/App/JelixContext.php +++ b/lizmap/modules/lizmap/lib/App/JelixContext.php @@ -44,13 +44,12 @@ public function getCoord() * * @param string $right the key of the right to check * @param string $resource the id of a resource if any - * @param mixed $role * * @return bool The result of jAcl2::check() */ - public function aclCheck($role, $resource = null) + public function aclCheck($right, $resource = null) { - return \jAcl2::check($role, $resource); + return \jAcl2::check($right, $resource); } /** @@ -217,8 +216,7 @@ public function logMessage($message, $cat = 'default') * Log an Exception. * * @param \Exception $exception The exception to log - * @param string The category of the logged Exception - * @param mixed $cat + * @param string $cat The category of the logged Exception */ public function logException($exception, $cat = 'default') { @@ -254,13 +252,10 @@ public function createVirtualProfile($category, $name, $params) /** * Return the properties of a profile by calling jProfile::get(). * - * @param string The profile category - * @param string the profile name - * @param bool If true and if the profile doesn't exist, throw an error - * instead of getting the default profile - * @param mixed $category - * @param mixed $name - * @param mixed $noDefault + * @param string $category The profile category + * @param string $name the profile name + * @param bool $noDefault If true and if the profile doesn't exist, throw an error + * instead of getting the default profile * * @return array properties */ @@ -272,10 +267,8 @@ public function getProfile($category, $name = '', $noDefault = false) /** * Call jEvent::notify(). * - * @param string The name of the event - * @param array the parameters of the event - * @param mixed $name - * @param mixed $params + * @param string $name The name of the event + * @param array $params the parameters of the event * * @return \jEvent */ diff --git a/lizmap/modules/view/controllers/lizMap.classic.php b/lizmap/modules/view/controllers/lizMap.classic.php index 44716214e7..110d47953b 100644 --- a/lizmap/modules/view/controllers/lizMap.classic.php +++ b/lizmap/modules/view/controllers/lizMap.classic.php @@ -30,9 +30,6 @@ class lizMapCtrl extends jController /** * Load the map page for the given project. * - * @param string $repository name of the repository - * @param string $project name of the project - * * @return jResponseHtml|jResponseRedirect with map and content for the chose Qgis project */ public function index() diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon index e92ae5f733..b83cf3f269 100644 --- a/phpstan-baseline.neon +++ b/phpstan-baseline.neon @@ -1,41 +1,6 @@ parameters: ignoreErrors: - - - message: "#^Access to an undefined property jEvent\\:\\:\\$tpl\\.$#" - count: 1 - path: lizmap/modules/admin/classes/config.listener.php - - - - message: "#^Call to an undefined method jDaoFactoryBase\\:\\:getDetailRange\\(\\)\\.$#" - count: 1 - path: lizmap/modules/admin/controllers/logs.classic.php - - - - message: "#^Call to an undefined method jDaoFactoryBase\\:\\:getSortedCounter\\(\\)\\.$#" - count: 1 - path: lizmap/modules/admin/controllers/logs.classic.php - - - - message: "#^Access to an undefined property jDaoRecordBase\\:\\:\\$id_aclgrp\\.$#" - count: 1 - path: lizmap/modules/admin/controllers/maps.classic.php - - - - message: "#^Access to an undefined property jDaoRecordBase\\:\\:\\$name\\.$#" - count: 1 - path: lizmap/modules/admin/controllers/maps.classic.php - - - - message: "#^Call to an undefined method jDaoFactoryBase\\:\\:findAllPublicGroup\\(\\)\\.$#" - count: 2 - path: lizmap/modules/admin/controllers/maps.classic.php - - - - message: "#^Call to an undefined method jDaoFactoryBase\\:\\:findAllSubject\\(\\)\\.$#" - count: 2 - path: lizmap/modules/admin/controllers/maps.classic.php - - message: "#^Comparison operation \"\\=\\=\" between 0\\|0\\.0\\|''\\|'0'\\|array\\{\\}\\|false\\|null and 0 results in an error\\.$#" count: 1 @@ -365,25 +330,6 @@ parameters: count: 1 path: lizmap/modules/lizmap/controllers/edition.classic.php - - - message: "#^Access to an undefined property jDaoRecordBase\\:\\:\\$login\\.$#" - count: 1 - path: lizmap/modules/lizmap/controllers/geobookmark.classic.php - - - - message: "#^Access to an undefined property jDaoRecordBase\\:\\:\\$map\\.$#" - count: 1 - path: lizmap/modules/lizmap/controllers/geobookmark.classic.php - - - - message: "#^Access to an undefined property jDaoRecordBase\\:\\:\\$name\\.$#" - count: 1 - path: lizmap/modules/lizmap/controllers/geobookmark.classic.php - - - - message: "#^Access to an undefined property jDaoRecordBase\\:\\:\\$params\\.$#" - count: 1 - path: lizmap/modules/lizmap/controllers/geobookmark.classic.php - message: "#^Access to an undefined property jResponse\\:\\:\\$data\\.$#" @@ -455,91 +401,6 @@ parameters: count: 1 path: lizmap/modules/lizmap/install/upgrade_configjcommunity.php - - - message: "#^PHPDoc tag @param has invalid value \\(array an associative array with the parameters of the Url\\)\\: Unexpected token \"an\", expected variable at offset 125$#" - count: 1 - path: lizmap/modules/lizmap/lib/App/AppContextInterface.php - - - - message: "#^PHPDoc tag @param has invalid value \\(array the parameters of the event\\)\\: Unexpected token \"the\", expected variable at offset 108$#" - count: 1 - path: lizmap/modules/lizmap/lib/App/AppContextInterface.php - - - - message: """ - #^PHPDoc tag @param has invalid value \\(bool If true and if the profile doesn't exist, throw an error - instead of getting the default profile\\)\\: Unexpected token "If", expected variable at offset 153$# - """ - count: 1 - path: lizmap/modules/lizmap/lib/App/AppContextInterface.php - - - - message: "#^PHPDoc tag @param has invalid value \\(string The category of the logged Exception\\)\\: Unexpected token \"The\", expected variable at offset 114$#" - count: 1 - path: lizmap/modules/lizmap/lib/App/AppContextInterface.php - - - - message: "#^PHPDoc tag @param has invalid value \\(string The name of the event\\)\\: Unexpected token \"The\", expected variable at offset 66$#" - count: 1 - path: lizmap/modules/lizmap/lib/App/AppContextInterface.php - - - - message: "#^PHPDoc tag @param has invalid value \\(string The profile category\\)\\: Unexpected token \"The\", expected variable at offset 75$#" - count: 1 - path: lizmap/modules/lizmap/lib/App/AppContextInterface.php - - - - message: "#^PHPDoc tag @param has invalid value \\(string the profile name\\)\\: Unexpected token \"the\", expected variable at offset 117$#" - count: 1 - path: lizmap/modules/lizmap/lib/App/AppContextInterface.php - - - - message: "#^PHPDoc tag @param references unknown parameter\\: \\$login$#" - count: 1 - path: lizmap/modules/lizmap/lib/App/AppContextInterface.php - - - - message: "#^PHPDoc tag @param references unknown parameter\\: \\$right$#" - count: 1 - path: lizmap/modules/lizmap/lib/App/AppContextInterface.php - - - - message: "#^PHPDoc tag @param has invalid value \\(array the parameters of the event\\)\\: Unexpected token \"the\", expected variable at offset 104$#" - count: 1 - path: lizmap/modules/lizmap/lib/App/JelixContext.php - - - - message: """ - #^PHPDoc tag @param has invalid value \\(bool If true and if the profile doesn't exist, throw an error - instead of getting the default profile\\)\\: Unexpected token "If", expected variable at offset 180$# - """ - count: 1 - path: lizmap/modules/lizmap/lib/App/JelixContext.php - - - - message: "#^PHPDoc tag @param has invalid value \\(string The category of the logged Exception\\)\\: Unexpected token \"The\", expected variable at offset 114$#" - count: 1 - path: lizmap/modules/lizmap/lib/App/JelixContext.php - - - - message: "#^PHPDoc tag @param has invalid value \\(string The name of the event\\)\\: Unexpected token \"The\", expected variable at offset 62$#" - count: 1 - path: lizmap/modules/lizmap/lib/App/JelixContext.php - - - - message: "#^PHPDoc tag @param has invalid value \\(string The profile category\\)\\: Unexpected token \"The\", expected variable at offset 102$#" - count: 1 - path: lizmap/modules/lizmap/lib/App/JelixContext.php - - - - message: "#^PHPDoc tag @param has invalid value \\(string the profile name\\)\\: Unexpected token \"the\", expected variable at offset 144$#" - count: 1 - path: lizmap/modules/lizmap/lib/App/JelixContext.php - - - - message: "#^PHPDoc tag @param references unknown parameter\\: \\$right$#" - count: 1 - path: lizmap/modules/lizmap/lib/App/JelixContext.php - message: "#^Return type \\(Iterator\\) of method Lizmap\\\\App\\\\JelixContext\\:\\:aclUserGroupsInfo\\(\\) should be compatible with return type \\(array\\) of method Lizmap\\\\App\\\\AppContextInterface\\:\\:aclUserGroupsInfo\\(\\)$#" @@ -786,12 +647,4 @@ parameters: count: 1 path: lizmap/modules/view/controllers/lizMap.classic.php - - - message: "#^PHPDoc tag @param references unknown parameter\\: \\$project$#" - count: 1 - path: lizmap/modules/view/controllers/lizMap.classic.php - - - message: "#^PHPDoc tag @param references unknown parameter\\: \\$repository$#" - count: 1 - path: lizmap/modules/view/controllers/lizMap.classic.php diff --git a/phpstan.neon b/phpstan.neon index 4f2d54cc3d..19f01432d9 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -11,3 +11,8 @@ parameters: paths: - lizmap/modules tmpDir: .phpstan.cache + ignoreErrors: + - '#^Call to an undefined method jDaoFactoryBase#' + universalObjectCratesClasses: + - jDaoRecordBase + - jEvent \ No newline at end of file