Skip to content

Add documentation for --static-analysis-tool=phpstan CLI option#282

Draft
Copilot wants to merge 3 commits intomasterfrom
copilot/fix-281
Draft

Add documentation for --static-analysis-tool=phpstan CLI option#282
Copilot wants to merge 3 commits intomasterfrom
copilot/fix-281

Conversation

Copy link

Copilot AI commented Aug 23, 2025

This PR adds comprehensive documentation for the --static-analysis-tool=phpstan CLI option that was introduced in #2098.

Changes Made

1. Added Missing CLI Option Documentation

Added documentation for the --static-analysis-tool option in src/guide/command-line-options.md that was previously missing. The documentation includes:

  • Clear explanation of what static analysis integration does
  • Usage examples with PHPStan
  • Step-by-step workflow description
  • Requirements and setup instructions
  • Performance benefits and optimization details

2. Enhanced Configuration Documentation

Updated src/guide/usage.md with:

  • Improved description of the staticAnalysisTool configuration option
  • New dedicated "Static Analysis Integration" section explaining the feature in detail
  • Comprehensive guide on why and how to use static analysis with mutation testing
  • PHPStan setup and configuration instructions
  • Example workflows and command usage

Key Features Documented

The documentation explains how static analysis integration:

  • Catches escaped mutants that test suites might miss
  • Identifies type violations, dead code, and unreachable code paths
  • Runs only on escaped mutants for optimal performance
  • Integrates seamlessly with existing Infection workflows

Example usage:

# Enable PHPStan integration
infection --static-analysis-tool=phpstan

# With additional options
infection --static-analysis-tool=phpstan --static-analysis-tool-options="--memory-limit=1G"

This addresses the documentation gap for a significant new feature that enhances mutation testing effectiveness by combining it with static analysis.

Fixes #281.


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copy link
Author

Copilot AI commented Aug 23, 2025

@maks-rafalko 👋 This repository doesn't have Copilot instructions. With Copilot instructions, I can understand the repository better, work faster and produce higher quality PRs.

I can generate a .github/copilot-instructions.md file for you automatically. Click here to open a pre-filled issue and assign it to me. I'll write the instructions, and then tag you for review.

Copilot AI and others added 2 commits August 23, 2025 10:29
Co-authored-by: maks-rafalko <3725595+maks-rafalko@users.noreply.github.com>
…I option

Co-authored-by: maks-rafalko <3725595+maks-rafalko@users.noreply.github.com>
Copilot AI changed the title [WIP] Write documentation for --static-analysis-tool=phpstan Add documentation for --static-analysis-tool=phpstan CLI option Aug 23, 2025
Copilot AI requested a review from maks-rafalko August 23, 2025 10:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Write documentation for --static-analysis-tool=phpstan

2 participants