PhpStorm 2020: The Ultimate IDE for PHP Developers
PhpStorm is a powerful and smart integrated development environment (IDE) for PHP and web development. It offers a rich set of features, such as code completion, refactoring, debugging, testing, and more. PhpStorm also supports the latest technologies and standards, such as PHP 8, PHPStan, Psalm, Tailwind CSS, and Xdebug 3.
In this article, we will explore some of the new and improved features of PhpStorm 2020 that make it the ultimate IDE for PHP developers.
PHP 8 is a major update to the language that introduces many new features and improvements. PhpStorm 2020 fully supports PHP 8 and helps you verify that your code is compatible with it, update your codebase more quickly, and take advantage of the latest language enhancements.
Some of the PHP 8 features supported by PhpStorm 2020 are:
Named arguments: You can pass function and method arguments by specifying a parameter name. PhpStorm checks that argument names are correct and adds them automatically with a quick-fix.
Constructor property promotion: You can reduce the amount of boilerplate code when you initialize variables through a constructor. PhpStorm can convert constructor-initialized properties into promoted properties or change them back with a quick-fix.
Nullsafe operator: You can build chains of calls with implicit checks for null for each element. PhpStorm makes sure that the operator is being used correctly.
Match expression: You can use a type-safe and compact alternative to the switch statement. PhpStorm can determine whether a switch block can be converted to a match expression and do it automatically with a quick-fix.
New functions for strings: You can use str_contains(), str_starts_with(), and str_ends_with() functions to work with strings. PhpStorm draws your attention to any usages of strpos() or substr() that can be replaced with these new functions.
Other PHP 8 features supported by PhpStorm 2020 include trailing comma after the last parameter in a function call and in the use section of closures, non-capturing catches, throw as an expression, and $object::class syntax.
PHPStan and Psalm Support
PHPStan and Psalm are static analysis tools that can help you find bugs and improve the quality of your code. PhpStorm 2020 integrates with both tools and provides highlighting, code completion, finding usages, refactorings, and other coding assistance for working with them.
You can configure PHPStan or Psalm as quality tools in PhpStorm settings and run them on your project or on a specific file. You can also see the results of the analysis in a dedicated tool window and navigate to the problematic code locations.
Tailwind CSS Support
Tailwind CSS is a utility-first CSS framework that allows you to create custom designs without writing any CSS. PhpStorm 2020 supports Tailwind CSS and provides code completion, navigation, documentation lookup, and other features for working with it.
You can install Tailwind CSS via npm or yarn and enable it in PhpStorm settings. You can also use the Tailwind CSS plugin for PostCSS to get additional benefits, such as linting, minification, and purging unused classes.
Xdebug 3 Support
Xdebug is a popular debugging tool for PHP that allows you to inspect variables, set breakpoints, step through code, and more. Xdebug 3 is a major update that brings significant performance improvements and changes to configuration options.
PhpStorm 2020 supports Xdebug 3 and helps you set up and use it in your projects. You can configure Xdebug settings in PhpStorm preferences and start debugging sessions from the IDE. You can also use the new Xdebug Helper browser extension to toggle debugging mode on or off.
Code With Me
Code With Me is a new collaborative development service that allows you to share your project with others and work on it together in real time. You can invite anyone to join your session via a link or an email and give them different levels of access rights. You can also use voice and video calls, chat messages, code reviews, and other features to communicate and collaborate effectively. 29c81ba772