3/1/2024 0 Comments Phpstorm discount codePhpStorm 2023.3 brings various improvements for Symfony developers. PHP 8.3 introduces a few deprecations, and PhpStorm has you covered with corresponding inspections to spot them. Type redeclaration checks when overriding a constant in a child class.Compatibility checks with the default value’s type.Suggestions to insert the appropriate types.All type declarations can be used except for void, callable, and never.įor typed class constants, PhpStorm provides: In PHP 8.3, you can declare types for class constants. This can be beneficial if you only need to know whether the input is valid JSON, since it uses less memory compared to decoding the string. PhpStorm can detect these patterns and suggest replacing them with a json_validate() function call. Previously, the only way to validate whether a string was valid JSON was to decode it and detect whether any errors were thrown. PHP 8.3 adds the new json_validate() function to the standard library. PhpStorm also suggests adding the # attribute when applicable. PhpStorm 2023.3 gives you a warning about such cases in advance. The PHP engine is able to check whether a method marked with # actually overrides the parent method, throwing an exception if this is not the case. It can be used to explicitly show your intent when overriding a method. Most of the changes in the IDE will be integrated organically into your PhpStorm workflow without you even noticing them, so we’ll only mention the new features you’ll need to know about in order to benefit from them. PhpStorm 2023.3 comes with full support for PHP 8.3. PhpStorm can help you find usages of custom expectations and help you rename them. In Pest, you can write custom expectations to reduce boilerplate checks in your tests. It also improves autocompletion in test functions, so you can see what assertions are available as you type. With this new Pest support, you can write assertions by calling functions or methods on $this. You can place the caret in the file but not inside any particular test to trigger all the tests in that file. When you place your caret inside a test and trigger the run window, a run configuration will be created for that specific test. Just like PHPUnit tests, Pest tests can now be run directly from PhpStorm. You can read the details in our recent blog post. We recently agreed with the original author of the Pest plugin to take over its development and bundle it in PhpStorm. PhpStorm now supports the Pest test framework out of the box. Use AI Assistant in PhpStorm as a supplemental feature with a JetBrains AI Service subscription. Click the Explain with AI button in a stack trace or error message to get an AI-generated explanation. AI Assistant can help you determine the root cause of the issue. Sometimes, when you execute a PHP script or run configuration, or run a Composer action, the job fails for some reason. AI-based error explanations in the console Once you do, AI Assistant will provide suggestions, and you can accept part or all of them. ![]() You will be asked to enter a description of the code you wish to generate. Now there is an AI Assistant | Generate code… action that opens a prompt right inside the editor. Previously, you could use AI chat to generate code snippets. With the caret placed on the class method you wish to cover with unit tests, just press Alt+Enter, select AI Assistant, and choose Generate Unit Tests. Test-code generationĪI Assistant can also generate tests for class methods. Press Tab to accept the suggestion.Ĭurrently, such suggestions are available within class contexts or inside function definitions. Simply start typing on a new line, and if an LLM suggestion is available, a grayed-out code snippet will appear. LLM-based code completionĪI Assistant can now generate multi-line blocks of code for you. JetBrains AI Assistant is now generally available with a number of new and improved features to increase your productivity in JetBrains IDEs.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |