Latest news about Bitcoin and all cryptocurrencies. Your daily crypto news habit.
First we need to include a dependency for squizlabs/php_codesniffer in our composer.json file. For example:
{ "require-dev": { "squizlabs/php_codesniffer": "3.*" }}
Then let’s go to our project’s composer.json file in PHPStorm, and click “Install”.
This should run composer update for us and also setup PHP Code Sniffer(PHPCS) to our project.
Once that is complete we’ll have to enable PHPCS through the settings. File > Settings > Editor > Inspections > PHP > Quality Tools > PHP Code Sniffer Validation. Let’s tick the box and select our coding standard.
Now, it should give us a line by line analysis of the coding standard violations in the editor. We’ll get a yellow underline if it violates any rules. If we hover over the line, we’ll get the exact violation message.
Congratulations! We’ve set up PHPCS on PHPStorm! Yuh-hoo!
If you liked the article, give claps! :) Also feel free to share it with your friends in Facebook/Twitter.
If you’re interested, please do check out my other series on medium:
Cheers! :)
How to setup PHP Code Sniffer in PHPStorm was originally published in Hacker Noon on Medium, where people are continuing the conversation by highlighting and responding to this story.
Disclaimer
The views and opinions expressed in this article are solely those of the authors and do not reflect the views of Bitcoin Insider. Every investment and trading move involves risk - this is especially true for cryptocurrencies given their volatility. We strongly advise our readers to conduct their own research when making a decision.