From 5ca060814bffa623e285d793becf4394dc87e6c5 Mon Sep 17 00:00:00 2001 From: Markus Staab Date: Sat, 13 Jun 2026 09:24:10 +0200 Subject: [PATCH 1/3] Setup PHPStan --- .github/CONTRIBUTING.md | 29 ++- .github/workflows/integrate.yaml | 43 +++++ Makefile | 10 +- composer.json | 8 +- composer.lock | 170 +++++++++++++++++- phpstan-baseline.neon | 295 +++++++++++++++++++++++++++++++ phpstan.neon.dist | 13 ++ 7 files changed, 564 insertions(+), 4 deletions(-) create mode 100644 phpstan-baseline.neon create mode 100644 phpstan.neon.dist diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index c00267ff51..28456451f9 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -74,6 +74,19 @@ about what you're working on, you can contact us via the ``` to automatically fix coding standard issues. +- Run + + ```shell + make static-analysis + ``` + + to run a static analysis or, if applicable, run + + ```shell + make static-analysis-baseline + ``` + + to regenerate the baseline. - Review the change once more just before submitting it. ## What happens after submitting contribution? @@ -134,6 +147,20 @@ Having said that, here are the organizational rules: make coding-standards ``` -6. Use reasonable commit messages. +6. Run + + ```shell + make static-analysis + ``` + +to run a static analysis or, if applicable, run + + ```shell + make static-analysis-baseline + ``` + +to regenerate the baseline. + +7. Use reasonable commit messages. Thank you for contributing to https://www.php.net! diff --git a/.github/workflows/integrate.yaml b/.github/workflows/integrate.yaml index 021babda87..be23042795 100644 --- a/.github/workflows/integrate.yaml +++ b/.github/workflows/integrate.yaml @@ -107,6 +107,49 @@ jobs: - name: "Validate XML files" run: "for a in $(find . -name '*.xml'); do xmllint --quiet --noout $a; done" + static-analysis: + name: "Static Analysis" + + runs-on: "ubuntu-latest" + + strategy: + matrix: + php-version: + - "8.2" + + dependencies: + - "locked" + + steps: + - name: "Checkout" + uses: "actions/checkout@v3" + + - name: "Set up PHP" + uses: "shivammathur/setup-php@v2" + with: + coverage: "none" + extensions: "none, curl, dom, json, mbstring, tokenizer, xml, xmlwriter, iconv" + php-version: "${{ matrix.php-version }}" + + - name: "Set up problem matchers for PHP" + run: "echo \"::add-matcher::${{ runner.tool_cache }}/php.json\"" + + - name: "Determine composer cache directory" + run: "echo \"COMPOSER_CACHE_DIR=$(composer config cache-dir)\" >> $GITHUB_ENV" + + - name: "Cache dependencies installed with composer" + uses: "actions/cache@v3" + with: + path: "${{ env.COMPOSER_CACHE_DIR }}" + key: "php-${{ matrix.php-version }}-composer-${{ hashFiles('composer.lock') }}" + restore-keys: "php-${{ matrix.php-version }}-composer-" + + - name: "Install dependencies with composer" + run: "composer install --ansi --no-interaction --no-progress" + + - name: "Run static analysis" + run: "vendor/bin/phpstan" + tests: name: "Tests" diff --git a/Makefile b/Makefile index 12de398fe1..724f253731 100644 --- a/Makefile +++ b/Makefile @@ -4,7 +4,7 @@ HTTP_HOST:=localhost:8080 CORES?=$(shell (nproc || sysctl -n hw.ncpu) 2> /dev/null) .PHONY: it -it: coding-standards tests ## Runs all the targets +it: coding-standards static-analysis tests ## Runs all the targets .PHONY: code-coverage code-coverage: vendor ## Collects code coverage from running unit tests with phpunit/phpunit @@ -18,6 +18,14 @@ coding-standards: vendor ## Fixes code style issues with friendsofphp/php-cs-fix help: ## Displays this list of targets with descriptions @grep -E '^[a-zA-Z0-9_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[32m%-30s\033[0m %s\n", $$1, $$2}' +.PHONY: static-analysis +static-analysis: vendor ## Runs a static code analysis + vendor/bin/phpstan + +.PHONY: static-analysis-baseline +static-analysis-baseline: vendor ## Generates a baseline for static analysis + vendor/bin/phpstan --generate-baseline + .PHONY: tests tests: vendor ## Runs unit and end-to-end tests with phpunit/phpunit vendor/bin/phpunit --configuration=tests/phpunit.xml --testsuite=unit diff --git a/composer.json b/composer.json index 3dab8c84cc..1c9de76f5c 100644 --- a/composer.json +++ b/composer.json @@ -13,6 +13,9 @@ "require-dev": { "ext-curl": "*", "friendsofphp/php-cs-fixer": "^3.95.4", + "phpstan/extension-installer": "^1.4", + "phpstan/phpstan": "^2.2", + "phpstan/phpstan-phpunit": "^2.0", "phpunit/phpunit": "^11.5.50" }, "autoload": { @@ -29,6 +32,9 @@ "platform": { "php": "8.2.0" }, - "sort-packages": true + "sort-packages": true, + "allow-plugins": { + "phpstan/extension-installer": true + } } } diff --git a/composer.lock b/composer.lock index 89ea0775ae..aab04bc5ad 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "280fe9d13360b92d08e3f0620566e9e1", + "content-hash": "1555eebf763d2b29f05d186dc8d3146c", "packages": [], "packages-dev": [ { @@ -811,6 +811,174 @@ }, "time": "2022-02-21T01:04:05+00:00" }, + { + "name": "phpstan/extension-installer", + "version": "1.4.3", + "source": { + "type": "git", + "url": "https://github.com/phpstan/extension-installer.git", + "reference": "85e90b3942d06b2326fba0403ec24fe912372936" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpstan/extension-installer/zipball/85e90b3942d06b2326fba0403ec24fe912372936", + "reference": "85e90b3942d06b2326fba0403ec24fe912372936", + "shasum": "" + }, + "require": { + "composer-plugin-api": "^2.0", + "php": "^7.2 || ^8.0", + "phpstan/phpstan": "^1.9.0 || ^2.0" + }, + "require-dev": { + "composer/composer": "^2.0", + "php-parallel-lint/php-parallel-lint": "^1.2.0", + "phpstan/phpstan-strict-rules": "^0.11 || ^0.12 || ^1.0" + }, + "type": "composer-plugin", + "extra": { + "class": "PHPStan\\ExtensionInstaller\\Plugin" + }, + "autoload": { + "psr-4": { + "PHPStan\\ExtensionInstaller\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "Composer plugin for automatic installation of PHPStan extensions", + "keywords": [ + "dev", + "static analysis" + ], + "support": { + "issues": "https://github.com/phpstan/extension-installer/issues", + "source": "https://github.com/phpstan/extension-installer/tree/1.4.3" + }, + "time": "2024-09-04T20:21:43+00:00" + }, + { + "name": "phpstan/phpstan", + "version": "2.2.2", + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpstan/phpstan/zipball/e5cc34d491a90e79c216d824f60fe21fd4d93bd6", + "reference": "e5cc34d491a90e79c216d824f60fe21fd4d93bd6", + "shasum": "" + }, + "require": { + "php": "^7.4|^8.0" + }, + "conflict": { + "phpstan/phpstan-shim": "*" + }, + "bin": [ + "phpstan", + "phpstan.phar" + ], + "type": "library", + "autoload": { + "files": [ + "bootstrap.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Ondřej Mirtes" + }, + { + "name": "Markus Staab" + }, + { + "name": "Vincent Langlet" + } + ], + "description": "PHPStan - PHP Static Analysis Tool", + "keywords": [ + "dev", + "static analysis" + ], + "support": { + "docs": "https://phpstan.org/user-guide/getting-started", + "forum": "https://github.com/phpstan/phpstan/discussions", + "issues": "https://github.com/phpstan/phpstan/issues", + "security": "https://github.com/phpstan/phpstan/security/policy", + "source": "https://github.com/phpstan/phpstan-src" + }, + "funding": [ + { + "url": "https://github.com/ondrejmirtes", + "type": "github" + }, + { + "url": "https://github.com/phpstan", + "type": "github" + } + ], + "time": "2026-06-05T09:00:01+00:00" + }, + { + "name": "phpstan/phpstan-phpunit", + "version": "2.0.16", + "source": { + "type": "git", + "url": "https://github.com/phpstan/phpstan-phpunit.git", + "reference": "6ab598e1bc106e6827fd346ae4a12b4a5d634c32" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpstan/phpstan-phpunit/zipball/6ab598e1bc106e6827fd346ae4a12b4a5d634c32", + "reference": "6ab598e1bc106e6827fd346ae4a12b4a5d634c32", + "shasum": "" + }, + "require": { + "php": "^7.4 || ^8.0", + "phpstan/phpstan": "^2.1.32" + }, + "conflict": { + "phpunit/phpunit": "<7.0" + }, + "require-dev": { + "nikic/php-parser": "^5", + "php-parallel-lint/php-parallel-lint": "^1.2", + "phpstan/phpstan-deprecation-rules": "^2.0", + "phpstan/phpstan-strict-rules": "^2.0", + "phpunit/phpunit": "^9.6" + }, + "type": "phpstan-extension", + "extra": { + "phpstan": { + "includes": [ + "extension.neon", + "rules.neon" + ] + } + }, + "autoload": { + "psr-4": { + "PHPStan\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "PHPUnit extensions and rules for PHPStan", + "keywords": [ + "static analysis" + ], + "support": { + "issues": "https://github.com/phpstan/phpstan-phpunit/issues", + "source": "https://github.com/phpstan/phpstan-phpunit/tree/2.0.16" + }, + "time": "2026-02-14T09:05:21+00:00" + }, { "name": "phpunit/php-code-coverage", "version": "11.0.12", diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon new file mode 100644 index 0000000000..e9ed039c3a --- /dev/null +++ b/phpstan-baseline.neon @@ -0,0 +1,295 @@ +parameters: + ignoreErrors: + - + message: '#^Variable \$version might not be defined\.$#' + identifier: variable.undefined + count: 1 + path: include/download-instructions/linux-debian-cli-community.php + + - + message: '#^Variable \$version might not be defined\.$#' + identifier: variable.undefined + count: 1 + path: include/download-instructions/linux-debian-web-community.php + + - + message: '#^Variable \$version might not be defined\.$#' + identifier: variable.undefined + count: 2 + path: include/download-instructions/linux-docker-cli-community.php + + - + message: '#^Variable \$version might not be defined\.$#' + identifier: variable.undefined + count: 2 + path: include/download-instructions/linux-docker-web-community.php + + - + message: '#^Variable \$multiversion might not be defined\.$#' + identifier: variable.undefined + count: 1 + path: include/download-instructions/linux-fedora-cli-community.php + + - + message: '#^Variable \$version might not be defined\.$#' + identifier: variable.undefined + count: 1 + path: include/download-instructions/linux-fedora-cli-community.php + + - + message: '#^Variable \$versionNoDot might not be defined\.$#' + identifier: variable.undefined + count: 1 + path: include/download-instructions/linux-fedora-cli-community.php + + - + message: '#^Variable \$multiversion might not be defined\.$#' + identifier: variable.undefined + count: 1 + path: include/download-instructions/linux-fedora-web-community.php + + - + message: '#^Variable \$version might not be defined\.$#' + identifier: variable.undefined + count: 1 + path: include/download-instructions/linux-fedora-web-community.php + + - + message: '#^Variable \$versionNoDot might not be defined\.$#' + identifier: variable.undefined + count: 1 + path: include/download-instructions/linux-fedora-web-community.php + + - + message: '#^Variable \$multiversion might not be defined\.$#' + identifier: variable.undefined + count: 1 + path: include/download-instructions/linux-redhat-cli-community.php + + - + message: '#^Variable \$version might not be defined\.$#' + identifier: variable.undefined + count: 1 + path: include/download-instructions/linux-redhat-cli-community.php + + - + message: '#^Variable \$versionNoDot might not be defined\.$#' + identifier: variable.undefined + count: 1 + path: include/download-instructions/linux-redhat-cli-community.php + + - + message: '#^Variable \$multiversion might not be defined\.$#' + identifier: variable.undefined + count: 1 + path: include/download-instructions/linux-redhat-web-community.php + + - + message: '#^Variable \$version might not be defined\.$#' + identifier: variable.undefined + count: 1 + path: include/download-instructions/linux-redhat-web-community.php + + - + message: '#^Variable \$versionNoDot might not be defined\.$#' + identifier: variable.undefined + count: 1 + path: include/download-instructions/linux-redhat-web-community.php + + - + message: '#^Variable \$version might not be defined\.$#' + identifier: variable.undefined + count: 1 + path: include/download-instructions/linux-ubuntu-cli-community.php + + - + message: '#^Variable \$version might not be defined\.$#' + identifier: variable.undefined + count: 1 + path: include/download-instructions/linux-ubuntu-web-community.php + + - + message: '#^Variable \$version might not be defined\.$#' + identifier: variable.undefined + count: 2 + path: include/download-instructions/osx-docker-cli.php + + - + message: '#^Variable \$version might not be defined\.$#' + identifier: variable.undefined + count: 2 + path: include/download-instructions/osx-docker-web.php + + - + message: '#^Variable \$version might not be defined\.$#' + identifier: variable.undefined + count: 2 + path: include/download-instructions/osx-homebrew-php.php + + - + message: '#^Variable \$version might not be defined\.$#' + identifier: variable.undefined + count: 2 + path: include/download-instructions/osx-homebrew.php + + - + message: '#^Variable \$version might not be defined\.$#' + identifier: variable.undefined + count: 2 + path: include/download-instructions/osx-macports.php + + - + message: '#^Variable \$versionNoDot might not be defined\.$#' + identifier: variable.undefined + count: 2 + path: include/download-instructions/osx-macports.php + + - + message: '#^Variable \$version might not be defined\.$#' + identifier: variable.undefined + count: 1 + path: include/download-instructions/windows-chocolatey.php + + - + message: '#^Variable \$version might not be defined\.$#' + identifier: variable.undefined + count: 2 + path: include/download-instructions/windows-docker-cli.php + + - + message: '#^Variable \$version might not be defined\.$#' + identifier: variable.undefined + count: 2 + path: include/download-instructions/windows-docker-web.php + + - + message: '#^Variable \$version might not be defined\.$#' + identifier: variable.undefined + count: 1 + path: include/download-instructions/windows-downloads.php + + - + message: '#^Variable \$version might not be defined\.$#' + identifier: variable.undefined + count: 1 + path: include/download-instructions/windows-native.php + + - + message: '#^Variable \$versionNoDot might not be defined\.$#' + identifier: variable.undefined + count: 1 + path: include/download-instructions/windows-scoop-versions.php + + - + message: '#^Variable \$version might not be defined\.$#' + identifier: variable.undefined + count: 4 + path: include/download-instructions/windows-winget.php + + - + message: '#^Variable \$MYSITE might not be defined\.$#' + identifier: variable.undefined + count: 1 + path: include/get-download.inc + + - + message: '#^Variable \$CSS might not be defined\.$#' + identifier: variable.undefined + count: 1 + path: include/header.inc + + - + message: '#^Variable \$MYSITE might not be defined\.$#' + identifier: variable.undefined + count: 9 + path: include/header.inc + + - + message: '#^Variable \$classes might not be defined\.$#' + identifier: variable.undefined + count: 1 + path: include/header.inc + + - + message: '#^Variable \$config might not be defined\.$#' + identifier: variable.undefined + count: 3 + path: include/header.inc + + - + message: '#^Variable \$curr might not be defined\.$#' + identifier: variable.undefined + count: 2 + path: include/header.inc + + - + message: '#^Variable \$lang might not be defined\.$#' + identifier: variable.undefined + count: 1 + path: include/header.inc + + - + message: '#^Variable \$shorturl might not be defined\.$#' + identifier: variable.undefined + count: 3 + path: include/header.inc + + - + message: '#^Variable \$title might not be defined\.$#' + identifier: variable.undefined + count: 1 + path: include/header.inc + + - + message: '#^Variable \$userPreferences might not be defined\.$#' + identifier: variable.undefined + count: 1 + path: include/langchooser.inc + + - + message: '#^Variable \$MYSITE might not be defined\.$#' + identifier: variable.undefined + count: 2 + path: include/layout.inc + + - + message: '#^Variable \$TOC might not be defined\.$#' + identifier: variable.undefined + count: 6 + path: include/layout.inc + + - + message: '#^Variable \$link might not be defined\.$#' + identifier: variable.undefined + count: 1 + path: include/layout.inc + + - + message: '#^Variable \$title might not be defined\.$#' + identifier: variable.undefined + count: 1 + path: include/layout.inc + + - + message: '#^Variable \$MYSITE might not be defined\.$#' + identifier: variable.undefined + count: 2 + path: include/mozopensearch.inc + + - + message: '#^Variable \$MYSITE might not be defined\.$#' + identifier: variable.undefined + count: 5 + path: include/mozsearch.inc + + - + message: '#^Variable \$LANG might not be defined\.$#' + identifier: variable.undefined + count: 1 + path: manual/index.php + + - + message: '#^Variable \$N might not be defined\.$#' + identifier: variable.undefined + count: 1 + path: manual/vote-note.php diff --git a/phpstan.neon.dist b/phpstan.neon.dist new file mode 100644 index 0000000000..e81fcf4243 --- /dev/null +++ b/phpstan.neon.dist @@ -0,0 +1,13 @@ +includes: + - phpstan-baseline.neon + +parameters: + level: 3 + paths: + - src + - tests + - manual + - include + fileExtensions: + - php + - inc From b71e53fa6df16836c061939d221beeff4c81194b Mon Sep 17 00:00:00 2001 From: Markus Staab Date: Sat, 13 Jun 2026 09:43:35 +0200 Subject: [PATCH 2/3] scan also in bin --- phpstan.neon.dist | 1 + 1 file changed, 1 insertion(+) diff --git a/phpstan.neon.dist b/phpstan.neon.dist index e81fcf4243..68790050a9 100644 --- a/phpstan.neon.dist +++ b/phpstan.neon.dist @@ -4,6 +4,7 @@ includes: parameters: level: 3 paths: + - bin - src - tests - manual From de1dab675bd41edefa3dfc36aaf1032133d7ac8f Mon Sep 17 00:00:00 2001 From: Markus Staab Date: Sat, 13 Jun 2026 09:52:42 +0200 Subject: [PATCH 3/3] scan everything but vendor/ --- phpstan-baseline.neon | 354 ++++++++++++++++++++++++++++++++++++++++++ phpstan.neon.dist | 10 +- 2 files changed, 359 insertions(+), 5 deletions(-) diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon index e9ed039c3a..ec3f0c6357 100644 --- a/phpstan-baseline.neon +++ b/phpstan-baseline.neon @@ -1,5 +1,227 @@ parameters: ignoreErrors: + - + message: '#^Variable \$SIDEBAR_DATA might not be defined\.$#' + identifier: variable.undefined + count: 1 + path: archive/1998.php + + - + message: '#^Variable \$SIDEBAR_DATA might not be defined\.$#' + identifier: variable.undefined + count: 1 + path: archive/1999.php + + - + message: '#^Variable \$SIDEBAR_DATA might not be defined\.$#' + identifier: variable.undefined + count: 1 + path: archive/2000.php + + - + message: '#^Variable \$SIDEBAR_DATA might not be defined\.$#' + identifier: variable.undefined + count: 1 + path: archive/2001.php + + - + message: '#^Variable \$SIDEBAR_DATA might not be defined\.$#' + identifier: variable.undefined + count: 1 + path: archive/2002.php + + - + message: '#^Variable \$SIDEBAR_DATA might not be defined\.$#' + identifier: variable.undefined + count: 1 + path: archive/2003.php + + - + message: '#^Variable \$SIDEBAR_DATA might not be defined\.$#' + identifier: variable.undefined + count: 1 + path: archive/2004.php + + - + message: '#^Variable \$SIDEBAR_DATA might not be defined\.$#' + identifier: variable.undefined + count: 1 + path: archive/2005.php + + - + message: '#^Variable \$SIDEBAR_DATA might not be defined\.$#' + identifier: variable.undefined + count: 1 + path: archive/2006.php + + - + message: '#^Variable \$SIDEBAR_DATA might not be defined\.$#' + identifier: variable.undefined + count: 1 + path: archive/2007.php + + - + message: '#^Variable \$SIDEBAR_DATA might not be defined\.$#' + identifier: variable.undefined + count: 1 + path: archive/2008.php + + - + message: '#^Variable \$SIDEBAR_DATA might not be defined\.$#' + identifier: variable.undefined + count: 1 + path: archive/2009.php + + - + message: '#^Variable \$SIDEBAR_DATA might not be defined\.$#' + identifier: variable.undefined + count: 1 + path: archive/2010.php + + - + message: '#^Variable \$SIDEBAR_DATA might not be defined\.$#' + identifier: variable.undefined + count: 1 + path: archive/2011.php + + - + message: '#^Variable \$SIDEBAR_DATA might not be defined\.$#' + identifier: variable.undefined + count: 1 + path: archive/2012.php + + - + message: '#^Variable \$SIDEBAR_DATA might not be defined\.$#' + identifier: variable.undefined + count: 1 + path: archive/2013.php + + - + message: '#^Variable \$SIDEBAR_DATA might not be defined\.$#' + identifier: variable.undefined + count: 1 + path: archive/2014.php + + - + message: '#^Variable \$SIDEBAR_DATA might not be defined\.$#' + identifier: variable.undefined + count: 1 + path: archive/2015.php + + - + message: '#^Variable \$SIDEBAR_DATA might not be defined\.$#' + identifier: variable.undefined + count: 1 + path: archive/2016.php + + - + message: '#^Variable \$SIDEBAR_DATA might not be defined\.$#' + identifier: variable.undefined + count: 1 + path: archive/2017.php + + - + message: '#^Variable \$SIDEBAR_DATA might not be defined\.$#' + identifier: variable.undefined + count: 1 + path: archive/2018.php + + - + message: '#^Variable \$SIDEBAR_DATA might not be defined\.$#' + identifier: variable.undefined + count: 1 + path: archive/2019.php + + - + message: '#^Variable \$SIDEBAR_DATA might not be defined\.$#' + identifier: variable.undefined + count: 1 + path: archive/2020.php + + - + message: '#^Variable \$SIDEBAR_DATA might not be defined\.$#' + identifier: variable.undefined + count: 1 + path: archive/2021.php + + - + message: '#^Variable \$SIDEBAR_DATA might not be defined\.$#' + identifier: variable.undefined + count: 1 + path: archive/2022.php + + - + message: '#^Variable \$SIDEBAR_DATA might not be defined\.$#' + identifier: variable.undefined + count: 1 + path: archive/2023.php + + - + message: '#^Variable \$SIDEBAR_DATA might not be defined\.$#' + identifier: variable.undefined + count: 1 + path: archive/2024.php + + - + message: '#^Variable \$SIDEBAR_DATA might not be defined\.$#' + identifier: variable.undefined + count: 1 + path: archive/2025.php + + - + message: '#^Variable \$SIDEBAR_DATA might not be defined\.$#' + identifier: variable.undefined + count: 1 + path: archive/2026.php + + - + message: '#^Variable \$cm might not be defined\.$#' + identifier: variable.undefined + count: 1 + path: cal.php + + - + message: '#^Variable \$cy might not be defined\.$#' + identifier: variable.undefined + count: 1 + path: cal.php + + - + message: '#^Variable \$MYSITE might not be defined\.$#' + identifier: variable.undefined + count: 2 + path: conferences/index.php + + - + message: '#^Variable \$LANG might not be defined\.$#' + identifier: variable.undefined + count: 2 + path: docs.php + + - + message: '#^Variable \$LANG might not be defined\.$#' + identifier: variable.undefined + count: 1 + path: download-docs.php + + - + message: '#^Variable \$MYSITE might not be defined\.$#' + identifier: variable.undefined + count: 1 + path: downloads.php + + - + message: '#^Variable \$LANG might not be defined\.$#' + identifier: variable.undefined + count: 8 + path: error.php + + - + message: '#^Variable \$userPreferences might not be defined\.$#' + identifier: variable.undefined + count: 1 + path: error.php + - message: '#^Variable \$version might not be defined\.$#' identifier: variable.undefined @@ -282,6 +504,30 @@ parameters: count: 5 path: include/mozsearch.inc + - + message: '#^Variable \$CONF_TEASER might not be defined\.$#' + identifier: variable.undefined + count: 1 + path: index.php + + - + message: '#^Variable \$MYSITE might not be defined\.$#' + identifier: variable.undefined + count: 5 + path: index.php + + - + message: '#^Variable \$MYSITE might not be defined\.$#' + identifier: variable.undefined + count: 1 + path: mailing-lists.php + + - + message: '#^Variable \$LANG might not be defined\.$#' + identifier: variable.undefined + count: 1 + path: manual-lookup.php + - message: '#^Variable \$LANG might not be defined\.$#' identifier: variable.undefined @@ -293,3 +539,111 @@ parameters: identifier: variable.undefined count: 1 path: manual/vote-note.php + + - + message: '#^Variable \$LAST_UPDATED might not be defined\.$#' + identifier: variable.undefined + count: 1 + path: mirror-info.php + + - + message: '#^Variable \$MYSITE might not be defined\.$#' + identifier: variable.undefined + count: 1 + path: mirror-info.php + + - + message: '#^Variable \$LAST_UPDATED might not be defined\.$#' + identifier: variable.undefined + count: 1 + path: mirror.php + + - + message: '#^Variable \$MYSITE might not be defined\.$#' + identifier: variable.undefined + count: 1 + path: mirror.php + + - + message: '#^Variable \$MIRRORS might not be defined\.$#' + identifier: variable.undefined + count: 1 + path: my.php + + - + message: '#^Variable \$userPreferences might not be defined\.$#' + identifier: variable.undefined + count: 11 + path: my.php + + - + message: '#^Variable \$QA_CHECKSUM_TYPES might not be defined\.$#' + identifier: variable.undefined + count: 1 + path: pre-release-builds.php + + - + message: '#^Variable \$QA_RELEASES might not be defined\.$#' + identifier: variable.undefined + count: 1 + path: pre-release-builds.php + + - + message: '#^Variable \$LANG might not be defined\.$#' + identifier: variable.undefined + count: 1 + path: quickref.php + + - + message: '#^Variable \$RELEASES might not be defined\.$#' + identifier: variable.undefined + count: 1 + path: releases/feed.php + + - + message: '#^Variable \$OLDRELEASES might not be defined\.$#' + identifier: variable.undefined + count: 3 + path: releases/index.php + + - + message: '#^Variable \$RELEASES might not be defined\.$#' + identifier: variable.undefined + count: 2 + path: releases/index.php + + - + message: '#^Variable \$LANG might not be defined\.$#' + identifier: variable.undefined + count: 2 + path: search.php + + - + message: '#^Variable \$MYSITE might not be defined\.$#' + identifier: variable.undefined + count: 3 + path: search.php + + - + message: '#^Variable \$COUNTRIES might not be defined\.$#' + identifier: variable.undefined + count: 1 + path: submit-event.php + + - + message: '#^Variable \$COUNTRIES might not be defined\.$#' + identifier: variable.undefined + count: 1 + path: thanks.php + + - + message: '#^Variable \$historical_mirrors might not be defined\.$#' + identifier: variable.undefined + count: 1 + path: thanks.php + + - + message: '#^Variable \$MYSITE might not be defined\.$#' + identifier: variable.undefined + count: 19 + path: urlhowto.php diff --git a/phpstan.neon.dist b/phpstan.neon.dist index 68790050a9..d924087d33 100644 --- a/phpstan.neon.dist +++ b/phpstan.neon.dist @@ -4,11 +4,11 @@ includes: parameters: level: 3 paths: - - bin - - src - - tests - - manual - - include + - . fileExtensions: - php - inc + + excludePaths: + analyse: + - vendor/