Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Identifying PHP unused and undefied variables sublime

I am using sublimetext3 unregistered . I want to know how can I configure sublime to show unused and undefined variables in php .sublimelinter-phplint does some useful work but it cannot recognise autoloaded classes that can be very irritating while development .I am looking for some package that can do it with file scope.

I have following packages already installed

  1. sublimelinter
  2. phpcs

    3.sublime-phpcs

Is there anyother package that can be userful in developement ?

like image 286
alwaysLearn Avatar asked Feb 23 '15 17:02

alwaysLearn


2 Answers

http://phpmd.org will show unused code. there is a SublimeLinter-phpmd extension as well. Just install both SublimeLinter and this extension, open the User preferences for SublimeLinter, and reduce the phpmd rulesets to just "rulesets": "unusedcode" to avoid over reporting on conventions and such you might not use.

like image 62
Doug Johnson Avatar answered Oct 19 '22 21:10

Doug Johnson


SublimeLinter works quite well but for php I use an extension :

https://github.com/SublimeLinter/SublimeLinter-php

You need SublimeLinter 3 for this : http://sublimelinter.readthedocs.org/en/latest/installation.html Which i see you already have! ^^

Appart from that.. Another IDE ? ^^

A Note about another editor which has a LOT of tools.. ATOM

like image 32
Pogrindis Avatar answered Oct 19 '22 20:10

Pogrindis