PHP Integrator is an open-source project that provides code analysis and utilities for PHP projects. It consists of a set of packages for the Atom editor, backed by a socket server that performs the heavy lifting, integrating a powerful development environment inside your text editor.
Code navigation allows you to effortlessly travel through your codebase by clicking the names of method calls, classes, interfaces, and other structural elements.
Navigating will immediately take you to the relevant location in your code base.
Annotations provide you with relevant information about your code, such as that a parent property is being overridden or an interface method is being implemented.
As an added bonus, clicking them will take you to the related element, whenever possible.
Tooltips display documentation for structural elements. Think extended docblock descriptions, method parameter descriptions, return type descriptions and exceptions thrown.
Refactoring is the component that has the most potential. Features currently include:
- Generating constructors
- Overriding existing methods
- Getter and setter generation
- Stubbing interface methods and abstract methods
Call Tips / Signature Help
Call tips are much like tooltips, but differ only in that they display items directly related to function or method calls, such as their expected parameters with their types and default values.
The list wouldn't be complete without a way to highlight errors before stumbling upon them whilst running the code. Finding nonexistent class names, docblock issues and missing global functions are all included in this process.
Awesome! What do I need?
To run, you will need at least:
- PHP 7.1 or higher * — The code you're actually writing can be anything ranging from PHP 5.2 up to (and including) PHP 7.1.
- php-sqlite and SQLite >= 3.7.11 — Required as back end for the indexing database.
- php-mbstring — Required as source code can contain Unicode characters in strings or comments.
- openssl — Required to fetch dependencies properly via Composer.
- atom-project-manager — Fire up your active project and go to Packages → PHP Integrator → Set Up Current Project (or use the command palette).
- Proper docblocks and type hinting - See our wiki for more information.
The following modules aren't directly used, but they may be required for installation in Atom via Composer or by dependencies:
* Still running PHP 5.6 or PHP 7.0? Look for the Atom packages suffixed with the text -legacy-php56, such as php-integrator-base-legacy-php56. These are unmaintained, but may provide a stopgap until you are able to update.
Wait, now I'm confused, what is it really?
At the moment, PHP Integrator itself consists of a set of Atom packages written in CoffeeScript, backed by a socket server written in PHP. The PHP server is separate from the Atom packages, but is installed automatically to make the process of installing it as painless as possible for Atom users.
Various additional functionalities, such as autocompletion and refactoring, can be installed as separate Atom packages as well. These packages interface with the base package via a CoffeeScript service. Most of the heavy lifting, such as indexing, analyzing types and static analysis is done by the PHP server.
Is it really exclusive to Atom?
The packages and CoffeeScript parts are dependent on Atom, but the PHP server, which does the heavy lifting, is not dependent on Atom at all. The PHP server was originally part of the base Atom package, but has been split off into a separate repository for reuse.
What about making it a language server?
The Language Server Protocol has gathered some interest of late. Currently the core is not a compliant language server, but it already is a socket server using JSON-RPC for communication. Becoming compliant with the protocol is on the roadmap and would make the core much more reusable for other editors.
Where is the code?