Tool integration

PHPStan Integration Guide

PHP static analysis for finding bugs

Get a Free API Key

Integrate PHPStan with Vulnetix. Analyze PHP code for bugs and type errors with SARIF output via the sarif formatter.

PHPCLI toolSARIF

Install & scan

$ composer require --dev phpstan/phpstan
composer require --dev jbelien/phpstan-sarif-formatter
$ ./vendor/bin/phpstan analyse --error-format=sarif src/ > phpstan.sarif

Run PHPStan in CI

Scan on every push and upload the report as a workflow artifact:

- name: Install PHPStan
  run: |
    composer require --dev phpstan/phpstan
    composer require --dev jbelien/phpstan-sarif-formatter
- name: Run PHPStan
  run: ./vendor/bin/phpstan analyse --error-format=sarif src/ > phpstan.sarif
- name: Upload report
  uses: actions/upload-artifact@v6
  with:
    name: phpstan
    path: phpstan.sarif
    if-no-files-found: warn

Then one publish job hands every artifact in the run to Vulnetix, recorded under PHPStan's own name and version. Written once per workflow, however many scanners you run:

publish:
  name: Publish to Vulnetix
  runs-on: ubuntu-latest
  needs: [scan]        # every scanner job, or its report is never published
  if: always()         # or one failing scanner suppresses all the others
  permissions:
    contents: read
    actions: read      # required to list the run's artifacts
  env:
    VULNETIX_ORG_ID: ${{ secrets.VULNETIX_ORG_ID }}
    VULNETIX_API_KEY: ${{ secrets.VULNETIX_API_KEY }}
  steps:
    - uses: actions/checkout@v5
    - name: Install Vulnetix CLI
      run: |
        curl -fsSL https://cli.vulnetix.com/install.sh | sh -s -- --install-dir "$HOME/.local/bin"
        echo "$HOME/.local/bin" >> "$GITHUB_PATH"
    - name: Publish scanner reports
      env:
        GITHUB_TOKEN: ${{ github.token }}
      run: vulnetix gha upload --org-id "$VULNETIX_ORG_ID" --json

After the run, vulnetix gha status reports what was actually recorded.

How Vulnetix compares: better together

Vulnetix does not replace PHPStan. Keep running it. Vulnetix sits on top of PHPStan (and every other scanner you already own) turning disconnected tool outputs into one prioritised, fixable queue.

CapabilityVulnetixPHPStan
Security coverage
SAST (static code analysis)✓ Built-in rules + Semgrep augmentation~ Bug-focused PHP static analysis (type errors, dead code); no taint/security analysis, needs Psalm for injection detection (phpstan GH, appsecsanta)
SCA / dependencies✓ 40+ ecosystems, transitive graph✗
DAST (dynamic testing)~ Ingests DAST results; no native dynamic engine✗
Container & image✓ Image CVEs, base image, Dockerfile✗
IaC / misconfiguration✓ Terraform, k8s, CloudFormation✗
Secret scanning✓ 1,000+ rules, source + binary + git history✗
Cloud / CSPM✓ Cloud-posture findings, compliance tab✗
Mobile (MAST)~ Ingests mobile scanner output; no native mobile engine✗
License compliance✓ SPDX, copyleft/AGPL/SSPL policy✗
SBOM generation✓ CycloneDX 1.7 + SPDX 2.3, cosign-signable✗
Malware / supply-chain✓ De-duplicated corpus + install-time firewall (25+ registries)✗
Network / infra vuln~ Ingests network scanner output; no native network scanner✗
Fuzzing✗ Ingests fuzzing crashes; no native fuzzer✗
Pentest / bug bounty✗ Ingests pentest/bug-bounty findings; not a testing service✗
The Vulnetix orchestration layer
Cross-scanner dedup & one queue (ASPM)✓ Correlates every scanner into one prioritised queue with ownership routing✗
Exploit-intel prioritisation✓ EPSS, CISA KEV, Coalition ESS, CWSS, Vulnetix LEV✗
Reachability analysis✓ Tree-sitter + CVEAffected; direct/transitive/semantic✗
Versioned VEX + audit trail✓ Immutable OpenVEX/CycloneDX, cosign-signable✗
Safe Harbour autofix✓ Resolves + applies the nearest safe version✗
End-of-life policy✓ Flags/blocks past-EOL runtimes & packages✗
SSVC / risk-based policy✓ SSVC v2 + CISA/FedRAMP/Essential-8 presets✗

✓ full · ~ partial · ✗ not covered

What PHPStan does well

Where Vulnetix adds to it: PHPStan is a bug/type checker, not a security scanner. It lacks taint analysis and needs a community package (phpstan-sarif-formatter) just to emit SARIF. Vulnetix ingests that SARIF and adds the entire security layer PHPStan lacks: exploit-intel prioritisation, reachability, VEX, SSVC, and cross-scanner dedup, while pairing PHPStan with Vulnetix's own SAST/taint (Semgrep-backed) for actual vulnerability coverage.

No migration, no rip-and-replace. PHPStan keeps doing what it does best; Vulnetix adds the orchestration, exploit-intelligence prioritisation and remediation layer built for the way AppSec works today.

Centralise PHPStan results in Vulnetix

Upload PHPStan SARIF output to the Vulnetix platform to deduplicate findings, prioritise them with EPSS, CISA KEV and Coalition ESS exploit intelligence, and track remediation across every scanner in a single queue.

PHPStan documentation ↗  ·  Source repository ↗

Wire PHPStan into your CI/CD pipeline →