Identifying PHP unused and undefied variables sublime
Asked Answered
P

2

7

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 ?

Proa answered 23/2, 2015 at 17:12 Comment(0)
D
7

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.

Dependable answered 1/5, 2015 at 16:19 Comment(2)
yes you have to add first the plugin and then the interface to the plugin. It works great!Palmation
Agree with @giuseppe, it is vital for ST PHP developement. You can configure phpmd rules with SublimeLinter. Just go to ST Preferences->Package Settings->SublimeLinter->Settings, find linters JSON section in the opened settings file (see the default settings section on the left pane) and add "phpmd": { "rulesets": "codesize,controversial,design,naming,unusedcode" }. Delete the rulesets as you like to lower the detector strictness. Here is phpmd rulesets doc.Flection
P
2

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

Priscian answered 23/2, 2015 at 17:16 Comment(5)
Installed it but cannt see it working .. what should I check out there ?Proa
I think you have to make sure you update your settings : sublimelinter.readthedocs.org/en/latest/settings.html sublimelinter.com/en/latest/global_settings.html?highlight=phpPriscian
I tried using atom but it is still getting maintained and misses lots of thing that sublime provides :) I was using netbeans but because my project demands jsx I am forced to switch my editorProa
Can I use svn with atom ?Feature I am really missing there , and what is the scope of autocomplete in atom ?Proa
@Proa personally i use tortoise SVN when I need to, i don't know of any SVN plugin so far for atom, but its very easy to develop one for atom. As for scope of autocomplete, they have a huge amount of plugins available for it.. Packages -> Settings View -> Install Packages searchable package repo list.. incredible amount of them,Priscian

© 2022 - 2024 — McMap. All rights reserved.