vscode php development setup php intelephense and phpcs

1.2k views Asked by At

I want to setup my development environment using vscode. However, I am confused on that would be the difference between intelephense and phpcs. I have the code in Github from my company and it has the .phpcs.xml.dist. I believe this file is for phpcs. It works already but I missed the intelephense code formatting and autocomplete feature. Can someone help in elaborate more on the difference between these 2 and do they conflicting each other should I installed both of them in my vscode.

TIA

Hery

1

There are 1 answers

0
chudasamachirag On

Intelephens have lots of feature, but most people use it for auto format code file.

Intelephens uses PSR12 as default standard Sortcut Key [Shit + Alt+ F] it also format HTML, Css, Js. It detect PHP version from your Host envirment and show you code warnings and systex error.

If your Dev team use PHPCS then you may need to use PHPCS vscode extension.

Not sure about Intelephens can detect .phpcs.xml.dist from your project. Your team may have CICD Pipline to check code stadarad (via phpcs) and fix them (via phpcsf) or reject PR via Bot!

Both are the best way to reduce None standard code.

if you are using opensource then use styleci it's free for public repository.