New Inspections and Quick Fixes in PhpStorm 2017.1
PhpStorm 2017.1 brings the usual improvements to inspections and quick fixes, let’s take a brief look at what was introduced.
PHP 7 deprecated the old PHP 4 style class constructors, where the name of the constructor method was the same as the class name. With these constructors being removed entirely in PHP 8, PhpStorm 2017.1 includes an inspection that will warn you if you’re using the old style constructor, along with a quick fix to correct the problem for you.
If you have a legacy codebase that uses this frequently, don’t forget that like any inspection, you can run this across your entire codebase and fix everything in one go by using Code | Run inspection by name… and then selecting Old style constructor usage.
When using an anonymous function I often forget to pass in any variables from outside the scope of the closure using the `use` keyword. While PhpStorm has always warned you of this, the new quick fix will solve the problem for you by prompting you to Add to closure ‘use’ construct.
Lastly, when using the Add field or Add method quick fix to generate properties or methods of a class, PhpStorm will now generate the visibility using the most suitable access modifier (`private`, `protected` or `public`), and will allow you to overtype a different modifier if the generated one isn’t suitable.
– Gary & The PhpStorm Team
Subscribe to Blog updates
Thanks, we've got you!
Qodana Clone Finder: Early Access Program
In December 2020, we announced the EAP for Qodana, which is rapidly evolving into a comprehensive platform that allows companies to perform multi-level evaluations of the quality of code they own, contract, or purchase. Qodana helps you detect bugs without relying on an IDE, either on a local machi…
PhpStorm 2020.2 EAP #3
The Early Access Program for PhpStorm 2020.2 is in full swing and today we’ve got the third build of the 2020.2 EAP for you. In this blog post, you can read about improvements for Git installed in WSL2 and Search Everywhere. Download PhpStorm 2020.2 EAP (more…)…
PhpStorm 2019.3.3 Preview
We’ve just rolled out a preview for the third minor update for PhpStorm 2019.3. Please give the PhpStorm 2019.3.3 Preview build 193.6494.5 a try and share your feedback with us. (more…)…
How to Upgrade to PHP 7.4 with PhpStorm
Check out our fresh video with a few nice tips and tricks on how to update your codebase to PHP 7.4. It combines materials from the PhpStorm 2019.2 and PhpStorm 2019.3 releases, with a few cool bonuses to boot. Nikita drew our attention to the fact that setters are slower than assigning prop…