From 31f94064ef5173dfa422c7f51159173b0cef1dfb Mon Sep 17 00:00:00 2001 From: Laurent Jouanneau Date: Fri, 18 Oct 2024 15:45:52 +0200 Subject: [PATCH] Fix phpstan --- .github/workflows/php-stan.yml | 3 ++- lizmap/modules/lizmap/classes/lizmap.class.php | 4 ++-- phpstan-baseline.neon | 4 ---- 3 files changed, 4 insertions(+), 7 deletions(-) diff --git a/.github/workflows/php-stan.yml b/.github/workflows/php-stan.yml index 2da3cf7935..7f410c93db 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 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..9f7aadfaa2 100644 --- a/phpstan-baseline.neon +++ b/phpstan-baseline.neon @@ -608,7 +608,3 @@ parameters: 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