https://github.com/zircote/php-lsp
Claude Code plugin for PHP development with intelephense LSP, php-cs-fixer, and phpstan
https://github.com/zircote/php-lsp
claude-code-plugin code-quality lsp php web
Last synced: 3 months ago
JSON representation
Claude Code plugin for PHP development with intelephense LSP, php-cs-fixer, and phpstan
- Host: GitHub
- URL: https://github.com/zircote/php-lsp
- Owner: zircote
- License: mit
- Created: 2026-01-02T21:03:29.000Z (6 months ago)
- Default Branch: main
- Last Pushed: 2026-03-30T15:37:20.000Z (3 months ago)
- Last Synced: 2026-03-30T17:35:59.276Z (3 months ago)
- Topics: claude-code-plugin, code-quality, lsp, php, web
- Language: PHP
- Size: 20.5 KB
- Stars: 1
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# php-lsp
[](CHANGELOG.md)
[](LICENSE)
[](https://docs.anthropic.com/en/docs/claude-code/plugins)
[](https://github.com/zircote/lsp-marketplace)
[](https://www.php.net/)
A Claude Code plugin providing comprehensive PHP development support through:
- **Phpactor** LSP integration for IDE-like features
- **Automated hooks** for linting, formatting, static analysis, and testing
- **PHP ecosystem** integration (PHP-CS-Fixer, PHPStan, Psalm, PHPUnit)
## Quick Setup
```bash
# Run the setup command (after installing the plugin)
/setup
```
Or manually:
```bash
# Install Phpactor LSP
composer global require phpactor/phpactor
# Install development tools
composer global require friendsofphp/php-cs-fixer
composer global require phpstan/phpstan
composer global require squizlabs/php_codesniffer
```
## Features
### LSP Integration
The plugin configures Phpactor for Claude Code via `.lsp.json`:
```json
{
"php": {
"command": "phpactor",
"args": ["language-server"],
"extensionToLanguage": {
".php": "php",
".phtml": "php"
},
"transport": "stdio"
}
}
```
**Capabilities:**
- Go to definition / references
- Hover documentation
- Code completion
- Refactoring support
- Real-time diagnostics
### Automated Hooks
| Hook | Trigger | Description |
|------|---------|-------------|
| `php-syntax-check` | `**/*.php` | PHP syntax validation |
| `php-cs-fixer` | `**/*.php` | Code style formatting |
| `phpstan-check` | `**/*.php` | Static analysis |
| `phpcs-lint` | `**/*.php` | PSR-12 compliance |
| `php-todo-fixme` | `**/*.php` | Surface TODO/FIXME comments |
## Required Tools
| Tool | Installation | Purpose |
|------|--------------|---------|
| `phpactor` | `composer global require phpactor/phpactor` | LSP server |
| `php-cs-fixer` | `composer global require friendsofphp/php-cs-fixer` | Formatting |
| `phpstan` | `composer global require phpstan/phpstan` | Static analysis |
| `phpcs` | `composer global require squizlabs/php_codesniffer` | Linting |
## Project Structure
```
php-lsp/
├── .claude-plugin/
│ └── plugin.json # Plugin metadata
├── .lsp.json # Phpactor configuration
├── commands/
│ └── setup.md # /setup command
├── hooks/
│ └── scripts/
│ └── php-hooks.sh
├── tests/
│ └── SampleTest.php # Test file
├── CLAUDE.md # Project instructions
└── README.md # This file
```
## License
MIT