The new implementation enables the usage of a baseline and the exclusion of files from inspections and mappings. PhpStorm 2023.2 has revised the approach to running inspections with third-party code quality tools. With the inspection enabled, issues detected by Laravel Pint will be highlighted in any opened PHP file or reported in the Problems tool window. To enable Laravel Pint as a PhpStorm inspection, go to Settings | Editor | Inspections and select the checkbox for Laravel Pint validation under PHP | Quality Tools. This would enable the fixing of all issues detected by Laravel Pint in one go with the Reformat Code ( ⌘⌥ L/ Ctrl+Alt+L) action. Here, you can also set Laravel Pint as your external formatter of choice. To configure the integration with Laravel Pint, go to Settings | PHP | Quality Tools and expand the Laravel Pint section. Code style issues reported by Laravel Pint can now be treated like PhpStorm’s own code inspections. PhpStorm has added Laravel Pint to the list of supported quality tools. # attribute for the objects that already have properties assigned to them. The other way around, you can use a PhpStorm quick-fix Alt+Enter to generate object shapes in a PHPDoc comment or an The syntax is supported for nested objects as well. Now you can define the structure of an arbitrary object in a PHPDoc comment, and PhpStorm will parse the object shape and display a code completion tooltip during assignment of object properties. While you would normally define objects via declared properties, you may also need proper code completion for dynamic properties with classes like stdClass or functions like _get()/ _set() or json_decode(). In this release, we are adding the ability to define the structure of generic objects via shape annotation, similar to how it is done for array shapes. If this is something you are waiting for, please upvote the issue here. There are still more IDE actions that could benefit from this improvement, such as the Generate PHPDoc intention and the Update PHPDoc Comment quick-fix. This quick-fix is available on doc comments even if the inspection has a No highlighting severity level. The new Remove all redundant PHPDoc tags quick-fix removes only redundant tags from a PHPDoc block.Previously, it only worked if the whole block was redundant. The Redundant PHPDoc comment inspection has been extended to report PHPDoc comments that contain at least one redundant tag.Previously generated PHPDoc blocks have been addressed as well: To invoke the generation of getter and setter methods, use the Add getter/setter intention ( Alt+Enter) or the generate code action ( ⌘N / Alt+Insert on Windows). PhpStorm now drops redundant declarations from auto-generated PHPDoc blocks in a larger number of its actions and reports on specific redundant PHPDoc tags in doc comments. PhpStorm now provides code completion for these where applicable. With generic annotations, you can fully benefit from decorator and other patterns for injecting behavior into objects. We’ve finally implemented it in this release but will continue to work on making PHP generics support the best it can possibly be going forward. One of the most highly anticipated features in this area has been support for static references in generic templates. Support for the `static` type in generics Press Shift+F6 while on a generic type to start renaming it and PhpStorm will automatically update the name throughout your whole codebase.Īnother way to do the same is by pressing Ctrl+T and then choosing Rename. PHP Generics in PHP New Rename generic refactoring This release is a major update that includes improvements for generics in PHP, Laravel Pint support, native support for PHP assertions, AI Assistant (Limited access), GitLab integration, text search in Search Everywhere, and much more.įor a quick video overview, check out this roundup of the key changes from our Developer Advocate, Brent.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |