# php-code-review

Runs PhpStorm's code inspections on PHP files so you can check quality and fix problems the IDE flags.

Skill by JetBrains. Category: Code quality.

## Install

Project (for this project only):

```sh
npx skills add jetbrains/phpstorm-claude-marketplace --skill php-code-review
```

Works with: Claude Code, Codex CLI, Cursor, Antigravity, Copilot CLI, opencode.

Global (for every project on this machine):

```sh
npx skills add jetbrains/phpstorm-claude-marketplace --skill php-code-review -g
```

Works with: Claude Code, Codex CLI, Cursor, Antigravity, Copilot CLI, opencode.

## Tags

- Runs on your computer: It runs as a program on your machine, with your access.

## Security audits

- Gen Agent Trust Hub: Pass
- Socket: Pass
- Snyk: Pass

Installs: 5. Installs counted by skills.sh. [Open on skills.sh](https://www.skills.sh/jetbrains/phpstorm-claude-marketplace/php-code-review)

## Source

[Open the source](https://github.com/jetbrains/phpstorm-claude-marketplace/tree/HEAD/skills/php-code-review). Checked 2026-10-10. This summary may contain AI-generated text, so it can be wrong. Check the source before you rely on it.

## SKILL.md

````markdown
---
name: php-code-review
description: Review PHP code using PhpStorm inspections. Use when editing PHP files, reviewing code quality, fixing PHP issues, or when asked about PHP best practices.
---

# PHP Code Review Skill

Use PhpStorm's inspection engine to ensure PHP code quality. This skill provides access to the same inspections shown in the IDE editor.

## When to Use

- After editing PHP files (`.php`, `.phtml`)
- When user asks to review PHP code quality
- When fixing PHP-related issues
- When asked about PHP best practices for this codebase

## Workflow

### 1. Run Inspections

Call `get_inspections` to analyze a PHP file:

```
get_inspections(
  filePath: "path/to/file.php",
  minSeverity: "WEAK_WARNING"  # or ERROR, WARNING, INFORMATION
)
```

Returns problems with:
- **severity**: ERROR > WARNING > WEAK_WARNING > INFORMATION
- **line/column**: Exact location (1-based)
- **description**: What's wrong
- **quickFixes**: Available automated fixes (name + description)

### 2. Evaluate Results

- **ERROR**: Must fix - code may not work correctly
- **WARNING**: Should fix - potential bugs or bad practices
- **WEAK_WARNING**: Consider fixing - style or minor issues
- **INFORMATION**: Optional - suggestions for improvement

### 3. Apply Fixes

For issues with quick fixes, use `apply_quick_fix`:

```
apply_quick_fix(
  filePath: "path/to/file.php",
  line: 42,
  column: 10,
  quickFixName: "Safe delete '$unusedVar'"
)
```

**Note**: The `quickFixName` must match exactly what was returned by `get_inspections`. The tool re-runs highlighting at the specified location to find and apply the matching fix.

For issues without quick fixes, edit the file manually.

### 4. Verify

Re-run inspections to confirm issues are resolved.
````

- Previous: [org-search](https://syn4pse.dev/terminal/org-search.md)
- Next: [php-project-guide](https://syn4pse.dev/terminal/php-project-guide.md)
- [Terminal](https://syn4pse.dev/terminal.md)
- [Suggest a change](mailto:terminal@syn4pse.dev?subject=Terminal%20suggestion)
