Skip to content

Firehed/php-lsp

Repository files navigation

php-lsp

A minimal Language Server Protocol (LSP) server for PHP.

Requirements

  • PHP 8.3+

Installation

composer require firehed/php-lsp

Usage

The server communicates via stdio:

./vendor/bin/php-lsp

Current Capabilities

  • Completion - Member access ($this->, $var->), static access (Class::), new expressions, function calls, variable names
  • Hover - Type information and docblocks for methods, properties, functions, and classes
  • Go to Definition - Jump to method, property, function, and class definitions
  • Signature Help - Parameter hints when calling functions and methods

Development

# Install dependencies
composer install

# Generate test fixture autoload
composer dump-autoload --working-dir=tests/Fixtures

# Run tests, static analysis, and linters
composer test

# Run just tests
composer unit

# Run just static analysis
composer phpstan

# Run just linters
composer phpcs

Editor Integration

See the docs directory for editor-specific setup guides.

License

MIT

About

PHP Language Server: completion, hover, jump to definition, and more.

Topics

Resources

Stars

Watchers

Forks

Releases

Contributors

Languages