In order to submit extensions to Magento marketplace, source code needs to pass Magento Extension Quality Program Coding Standard checks. You can either do it manually, by following this guide in official Github repository, or by fixing things as you code, by setting up check in PHP Storm. Install and configure Code Sniffer on system. PhpStorm Magento 2 Plugin. Go to Settings Preferences in the PhpStorm IDE; Navigate to Plugins; Click the Browse repositories. Button and search for 'Magento PhpStorm'. Tools out of the box with Magento 2 in PHPSTORM 1. Tools out of the box with Magento 2 in PHPSTORM. In this case Magento 2 is a musical and the packages installed. PSR-1 / PSR-2 Hit CTRL-ALT-s to bring up the settings menu. Navigate to: Editor Code Style PHP Click “Set from” on the top right. I am in the process of evaluating phpStorm to replace eclipse. Here is my environment. Windows 7, php 5.6, xDebug, Magento 2.0.2, Composer. I installed Magento code using github from within phpStorm. When I tried to run index.php using 'Open in Browser' option, I get a blank screen. I am supposed to get a setup screen. Did anybody run into this.
In case you are working on Magento 2 project and for coding you are using PhpStorm, to create quality code as much as possible, is good to configure CodeSniffer validator.
In case of Magento 2 project it’s really easy to configure, because CodeSniffer is already part of Magento 2. In PhpStorm go to settings
And then navigate to section
Click on three dots next to Local select box. Then configure path to PHP CodeSniffer to location
You can click on Validate button to see, if everything is OK. Then click on Apply button and then OK.

Now in configuration window move to part
and tick checkbox next to option PHP Code Sniffer validation. Also look on the right side
and from Coding Standard select box choose PSR-2( you can choose also PSR-1, but PSR-2 is more strict and precise )
Apply button then OK and everything is set.
I admit, that first days coding with PSR-2 standards might be tough, but you can use to it really fast and you will be write more readable code.
Happy coding …
Table of Contents

In this second part of the series, I’m going to guide you how to start a debugging session, place a breakpoint and track the debugging progress. But before we begin, make sure that you have installed and set up Xdebug with PhpStorm.
If you don’t know how to do it, please visit our instructions on Part 1 here.

You can start a debugging session with PhpStorm either by clicking on the debug button (with a bug icon), or turn on debugging connection listening and let PhpStorm catch debugging requests from the browser. I personally prefer the second way, as it is convenient and easier to manage.
On the taskbar, go to Run -> Edit Configurations to enter the configuration window for your debug:

Click on the green plus button on the top left corner and choose PHP Web Application and fill in the necessary parameters. The Start URL is quite important, as it defines the start page when you start a new debug session with PhpStorm.
When it is done, click OK to save.
Now you can either:
For Chrome:
For Firefox:
In PhpStorm:
Now you will want to place a breakpoint where your code would stop. It looks like this:
When you runs the code, it would stop at the breakpoint and a debug window shows up.
As in the photo above, there is a white line that shows where your debug is, and the code in the white-line is not executed. On the bottom, the debug window show you all of the debugging flow, variables’ values, object’s properties, etc…
While working on debug window, if you want to:
Congrats! You just mastered an very important tool for developers. If you have any questions or problems about Xdebug, don’t mind leaving them in the comment section below.
