PHP Mess Detector Support in PhpStorm 6.0
PhpStorm has added one more tool to its list of external code quality validators: PHP Mess Detector.
Similarly to PHP Code Sniffer, the tool is not bundled with the IDE, you have to install it manually. Fortunately it’s not so difficult, in most cases it’s sufficient to follow the instructions here. Make sure that PHP Mess Detector works from command line and if run without parameters gives something like this:
Mandatory arguments: 1) A php source code filename or directory. Can be a comma-separated string 2) A report format 3) A ruleset filename or a comma-separated string of rulesetfilenames ...
Now we are ready to set it up in PhpStorm. Go to Settings | PHP | Mess Detector and specify tool’s startup script (phpmd) location and other parameters like timeout:
Click “Validate” at the end to make sure that a path to
phpmd is set correctly. You should get a message “PHPMD @package_version@ by Manuel Pichler”.
The next step is to set up PHP Mess Detector inspection. Choose Settings | Inspections | PHP | PHP Mess Detector Validation like it is shown on the picture below. Enable some built-in validation rules (code size, naming etc.) to start with.
Click “OK” in Settings and open some PHP file in the editor. At this point you may start getting some annotations with messages having “phpmd” prefix:
You can also set up your own custom rules by adding a
ruleset.xml file as shown below:
ruleset.xml files is possible too. If ruleset files are located under the project root, they can be shared with a team via VCS.
And basically this is it!
We would very much like to hear back from you about this feature and its implementation. Please add your bug reports and feature requests in YouTrack.
Develop with pleasure!
– JetBrains Web IDE Team
Working with Windows Azure SQL Database in PhpStorm
PhpStorm provides us the possibility to connect to Windows Azure SQL Database right from within the IDE. In this post, we’ll explore several options that are available for working with Windows Azure SQL Database (or database systems like SQL Server, MySQL, PostgreSQL or Oracle, for that matter): …
Change signature refactoring in PhpStorm
A very powerful refactoring is the Change signature refactoring in PhpStorm. It enables us to modify a function signature in many ways: we can change the function name, change its visibility, add, remove and reorder parameters as well as rename parameters. (more…)…
Folding for imports in PhpStorm 6.0
In PhpStorm 6, we've introduced code folding for imports. Any list of imports will now be folded into a single line. This greatly reduced clutter in your editor when having a lot of imports! (more…)…
Drag & Drop Project Files to Remote Hosts in PhpStorm
The Remote Host pane allows us to work directly on a remote server through FTP, FTPS, SFTP or a local/network folder. A lot of people asked us to add drag & drop to the Remote Host pane in PhpStorm. Good news: PhpStorm 6 comes with drag & drop as well as copy & paste support from the pro…