Thank you for reading my blog posts, I am no longer publishing new content on this platform. You can find my latest content on either mainawycliffe.dev or All Things Typescript Newsletter (✉️)
Visual Studio Code is one of the best free text editors out there. Right out of the box, Visual Studio Code offers basic PHP support but nothing more than that. To enjoy a fruitful PHP development, you need to install PHP extensions. Today, I am going to highlight 5 extensions you might want to consider. If you would like to try out Visual Studio Code, you can download it here.
This extension offers an interface for PHP CodeSniffer. PHP CodeSniffer scans the PHP files in your workspace to detect and offer suggestions and fixes for violations of a defined set of PHP standards. It’s an excellent extension that will ensure you strictly follow standard for PHP.
You can learn more about PHP standard here. For you to use this extension, you need to install PHP CodeSniffer globally into your development machine. You can install PHP CodeSniffer using either PEAR or Composer as shown below.
// PEAR
pear install PHP_CodeSniffer
// Composer:
composer require --dev squizlabs/php_codesniffer
To install PHPCS, press F1 on Visual Studio and type the following command:
ext install phpcs
You can learn more about this extension here.
To use the creator’s words, PHP Intellisense Crane is a productivity enhancement extension for Visual Studio Code that provides code-completion for PHP. It has zero dependencies and largely works with projects of any size. The extension is active in development and you can raise issues and make feature suggestion on GitHub. This extension offers the following features: Code Completion, Go To and Peek Definition on classes, interfaces and traits and document workspace symbol provides. To install PHP Intellisense Crane, press F1 on Visual Studio Code, and type the command below.
ext install crane
Once installation is complete, wait for it to parse all PHP files in your workspace. You will see a progress bar at the status bar.
You can learn more about PHP Intellisense Crane here.
This is one of the best PHP Extension I have ever used. It provides a tonne of useful features without affecting negatively the performance of Visual Studio Code. It also has no external dependencies. It has the following features:
To install this extension, press F1 and type in the command below:
ext install bmewburn.vscode-intelephense-client
You can learn more about this extension here.
Just like the name suggests, it offers Intellisense autocompletion for PHP. This extension depends on PHP Language Server to work. The extension just provides an interface to the PHP Language Server. To use this extension, first install the PHP Language Server using composer as show below:
composer require felixfbecker/language-server
If you have multiple projects, you can install PHP Language Server globally as follows:
composer global require felixfbecker/language-server
You also need to have PHP7 installed in your system. Then go ahead and install the extension on Visual Studio Code. Press F1 and type in the following command:
ext install php-intellisense
You can learn more about the extension here.
This extension is an adapter for XDebug extension for PHP. XDebug is an extension for PHP that assists with debugging and development of PHP projects. To use this application, you need to install XDebug and PHP into your system.
You can follow the instruction found in the extension page here. To install this extension, press F1 and type in the command below.
ext install php-debug.
Visual Studio Code or VSCode is one of the best text editors out there. It is feature rich out of the box and has a lot of extensions which …
Read MoreIntroduction A PHP Framework in simple terms is a platform used by developers to create web applications – obviously made by PHP. They help …
Read More