PHPIntel
Auto-complete for PHP functions and objects
Details
Installs
- Total 186K
- Win 121K
- Mac 26K
- Linux 39K
Sep 26 | Sep 25 | Sep 24 | Sep 23 | Sep 22 | Sep 21 | Sep 20 | Sep 19 | Sep 18 | Sep 17 | Sep 16 | Sep 15 | Sep 14 | Sep 13 | Sep 12 | Sep 11 | Sep 10 | Sep 9 | Sep 8 | Sep 7 | Sep 6 | Sep 5 | Sep 4 | Sep 3 | Sep 2 | Sep 1 | Aug 31 | Aug 30 | Aug 29 | Aug 28 | Aug 27 | Aug 26 | Aug 25 | Aug 24 | Aug 23 | Aug 22 | Aug 21 | Aug 20 | Aug 19 | Aug 18 | Aug 17 | Aug 16 | Aug 15 | Aug 14 | Aug 13 | Aug 12 | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Windows | 0 | 8 | 9 | 7 | 9 | 10 | 5 | 8 | 8 | 7 | 9 | 3 | 14 | 13 | 7 | 9 | 3 | 12 | 8 | 9 | 12 | 16 | 13 | 9 | 9 | 5 | 4 | 5 | 7 | 4 | 6 | 6 | 12 | 8 | 13 | 7 | 7 | 6 | 5 | 8 | 9 | 12 | 7 | 5 | 7 | 3 |
Mac | 1 | 2 | 2 | 0 | 2 | 1 | 1 | 4 | 2 | 1 | 0 | 3 | 4 | 1 | 1 | 1 | 0 | 1 | 6 | 1 | 1 | 3 | 1 | 1 | 2 | 0 | 1 | 2 | 3 | 1 | 3 | 0 | 3 | 2 | 3 | 1 | 1 | 0 | 0 | 3 | 2 | 4 | 1 | 1 | 1 | 2 |
Linux | 4 | 0 | 0 | 3 | 4 | 2 | 2 | 1 | 3 | 1 | 3 | 3 | 2 | 2 | 4 | 4 | 2 | 1 | 1 | 3 | 2 | 3 | 2 | 3 | 2 | 3 | 6 | 3 | 0 | 2 | 1 | 1 | 2 | 1 | 1 | 4 | 1 | 0 | 0 | 0 | 4 | 1 | 2 | 3 | 1 | 2 |
Readme
- Source
- raw.githubusercontent.com
SublimePHPIntel
PHP code scanner and analyzer for code intelligence within PHP projects.
Sublime Text 3: Checkout branch st3
for Sublime Text 3 compatible version
Setup
- Install using Package Control
- Create or open a project with PHP files
- Run the PHPIntel: Scan Project command from the command palette
After the initial scan, PHP files will be automatically re-scanned whenever you save them.
Go to declaration
To open a class declaration, place your cursor on the class name and press Ctrl+f5
or Cmd+f5
Magic and factory methods
You can teach SublimePHPIntel about magic and factory methods using regular expression matching. Some expressions for Magento and the Yii framework are already included. Please send pull requests with additional expressions for other frameworks that you'd like to see included out of the box.
For example, your code might have a factory method that returns a model:
App::getModel('modelname')->doSomething();
To get code completion for this, define a template for the factory in the configuration settings (Preferences | Package Settings | SublimePHPIntel | Settings - User).
Factory patterns are defined like so:
{
"customfactories":
[
{ "pattern": "<Regular expression>", "class": "<Class name>", option, ..., option },
{ "pattern": "<Regular expression>", "class": "<Class name>", option, ..., option },
...
{ "pattern": "<Regular expression>", "class": "<Class name>", option, ..., option }
]
}
- Patterns are just regular expressions.
- Class names are strings with optional numbered expressions that match capturing groups in the regular expressions.
- You need to double escape backslashes to preserve them.
For example, this: “json { "pattern”: “getModel\('(.*?)'\)”, “class”: “Model_%1”, “capitalize”: true }
...will cause this:
```php
getModel('abc')
…to be interpreted as: “php Model_Abc
**Options**
capitalize: *true|false* — *Uppercase the first letter of the captured expression*
## Known issues
I'm working on these issues:
- Variable assignment is not detected (for example: <code>$var = CODE</code> where CODE returns an object.
- Files are not removed from the index when they are deleted. For now, you'll need to rescan to remove them.
- Files added to the project from outside of the editor are not added to the index. For now, you'll either need to open the file and save it or rescan the project.
- I'm not completely happy with the way it deals with cases where the same class is declared more than once. Need to do some research to see how others deal with that.