JUBELBUILD — DEVELOPER TOOLS

PHPStan

Static analysis gate for JubelBuild — generates PHPStan and GitHub Actions CI configuration, with an optional local run.

Static analysis — without breaking your host

PHPStan is an add-on that extends JubelBuild with static code analysis. Deliberate architectural decision: PHPStan does not run synchronously in the browser build. Typical WordPress hosts lack the memory and execution time, exec is often disabled, and Composer plus WP stubs are required — so the analysis is CI-centric: the heavy lifting happens in GitHub Actions on every push and pull request.

How it works

  • CI config generator: produces phpstan.neon.dist, .github/workflows/phpstan.yml and PHPSTAN-SETUP.md — written straight into your generated FREE, PRO and DEV packages so PHPStan runs in GitHub Actions on every push and pull request.
  • WordPress-aware: the generated config includes the szepeviktor/phpstan-wordpress extension and a note on working with a baseline.
  • One consolidated workflow: the gate ("Static Analysis") and the "PHPStan Pool" run as two jobs in a single phpstan.yml — the pool job skips pull requests and uploads its results as an artifact.
  • Optional local run: if a vendor/bin/phpstan exists in the build directory and exec is available, PHPStan runs locally and returns findings in the same format as the Parallel Lint add-on. Not blocking by default — enable blocking explicitly if you want the build gated.
  • Workspace preview: view the generated CI configuration directly in the JubelBuild workspace before it ships.

What PHPStan finds that a linter can't

Syntax checks confirm your code parses — static analysis confirms it makes sense. PHPStan flags perfectly valid PHP that will still fail at runtime: undefined variables and functions, type mismatches, impossible conditions and dead code. Combined with Parallel Lint and the PHP Lexer, your builds are covered from raw structure to semantics.

Requirements

  • WordPress 6.0 or higher (tested up to 6.8).
  • PHP 7.4 or higher.
  • The active core plugin JubelBuild (Pro).
  • A GitHub repository for the CI-based analysis; a local vendor/bin/phpstan + exec only for the optional local run.
  • Current version 1.0.5 · GPLv2 or later.

FAQ

Why doesn't PHPStan run in the browser build?

By design. Full static analysis needs memory, time, Composer and WP stubs — resources typical WordPress hosts don't provide, and exec is often disabled anyway. The add-on generates a complete CI setup instead, so the analysis runs where it belongs: in GitHub Actions.

Can it still block a build locally?

Yes, optionally. If vendor/bin/phpstan is present in the build directory and exec is available, the local gate runs and can block the build — but only when blocking is explicitly enabled in the options. By default it reports without blocking.

Which files does it add to my packages?

phpstan.neon.dist, .github/workflows/phpstan.yml and PHPSTAN-SETUP.md — generated per build and written into the FREE, PRO and DEV packages, so every deployed repo carries its own working CI analysis out of the box.

Does it require JubelBuild?

Yes. PHPStan integrates into the JubelBuild build pipeline and deployer and requires the active core plugin (Pro).

Ship code that makes sense — not just code that parses

Every push and pull request analyzed in CI — with a config generated and shipped by your build, automatically.

s2Member®
Nach oben scrollen