Page:
workflows-static-analysis
Pages
AUTO-CREATE-ORG-PROJECTS
Branching-Strategy
CLI-AUTOMATION
Coding-Standards
DEPLOY-SCRIPTS
DOLIBARR-MODULE-IDS
DRY-RUN-PATTERN
Documentation-Standards
File-Header-Standards
JOOMLA-SYNC
LEGAL-DOC-GENERATOR-WEB-README
MONITORING-SCRIPTS
NEW-SCRIPTS
QUICKSTART-ORG-PROJECTS
RELEASE-MANAGEMENT
Version-Standard
WIKI-STANDARDS
api-maintenance-index
api-plugin-index
api-tests-index
api-tests-sample-index
automation-README
automation-branch-version-automation
automation-repo-cleanup
client-repos
unnamed
Clone
2
workflows-static-analysis
Jonathan Miller edited this page 2026-06-06 22:59:24 +00:00
← Home
PHPStan Static Analysis
Status: ✅ Active | Version: 01.00.00 | Last Updated: 2026-05-07
Overview
PHPStan static analysis is integrated into the Joomla Extension CI workflow as the static-analysis job. It runs after lint-and-validate passes and catches type errors, undefined methods, incorrect return types, and other bugs that PHP lint misses.
Configuration
Default Behavior (No Config File)
If no phpstan.neon exists in the repo, PHPStan runs at level 3 (type inference) against src/, htdocs/, or lib/.
Custom Config
Create phpstan.neon in the repo root:
parameters:
level: 5
paths:
- src
excludePaths:
- src/vendor
ignoreErrors:
- '#Call to an undefined method#'
Analysis Levels
| Level | What It Checks |
|---|---|
| 0 | Basic checks (unknown classes, functions, methods) |
| 1 | Possibly undefined variables |
| 2 | Unknown methods on $this |
| 3 | Default — return types, type inference |
| 4 | Dead code, always true/false |
| 5 | Argument types |
| 6-9 | Increasingly strict |
Behavior
- Non-blocking: Uses
continue-on-error: true— failures are reported but don't block PRs - Incremental adoption: Start at level 3, increase as codebase improves
- Auto-install: PHPStan is installed if not in composer dependencies
Related Documentation
Changelog
| Version | Date | Changes |
|---|---|---|
| 01.00.00 | 2026-05-07 | Initial release — level 3 default, non-blocking |
Pages
- AUTO-CREATE-ORG-PROJECTS
- Branching-Strategy
- CLI-AUTOMATION
- Coding-Standards
- DEPLOY-SCRIPTS
- DOLIBARR-MODULE-IDS
- DRY-RUN-PATTERN
- Documentation-Standards
- File-Header-Standards
- JOOMLA-SYNC
- LEGAL-DOC-GENERATOR-WEB-README
- MONITORING-SCRIPTS
- NEW-SCRIPTS
- QUICKSTART-ORG-PROJECTS
- RELEASE-MANAGEMENT
- Version-Standard
- WIKI-STANDARDS
- api-maintenance-index
- api-plugin-index
- api-tests-index
- api-tests-sample-index
- automation-README
- automation-branch-version-automation
- automation-repo-cleanup
- client-repos
- features
- operations
- reference
- standards
- templates
- unnamed
-
workflows
- workflows-README.-
- workflows-README
- workflows-auto-release.-
- workflows-auto-release
- workflows-branch-protection.-
- workflows-branch-protection
- workflows-build-release.-
- workflows-build-release
- workflows-cascade-dev.-
- workflows-cascade-dev
- workflows-changelog-management.-
- workflows-changelog-management
- workflows-demo-deployment.-
- workflows-demo-deployment
- workflows-dev-branch-tracking.-
- workflows-dev-branch-tracking
- workflows-dev-deployment.-
- workflows-dev-deployment
- workflows-index.-
- workflows-index
- workflows-release-system.-
- workflows-release-system
- workflows-renovate.-
- workflows-renovate
- workflows-reusable-workflows.-
- workflows-reusable-workflows
- workflows-rs-deployment.-
- workflows-rs-deployment
- workflows-secret-scanning.-
- workflows-secret-scanning
- workflows-shared-workflows.-
- workflows-shared-workflows
- workflows-standards-compliance.-
- workflows-standards-compliance
- workflows-static-analysis.-
- workflows-static-analysis
- workflows-sub-issue-management.-
- workflows-sub-issue-management
- workflows-update-server.-
- workflows-update-server
- workflows-workflow-architecture.-
- workflows-workflow-architecture