![]() ![]() Checking the constructor is particularly important given that’s traditionally where you’d initialise these fields, so being warned that properties are undeclared at this point is very useful. PhpStorm 2017.2 extends the existing inspections that detect when you use undefined fields by also checking in the constructor. Declaring properties is also slightly more memory conscious, because of the underlying way that PHP’s opcodes (the “compiled” version of the PHP text file you edit) store properties. PhpStorm 2017.2 introduces some nice new inspections to catch even more future bugs before they happen.ĭeclaring all properties you use in your PHP code is a good practice to ensure that you are using the property visibility you need, to catch bugs from typos, to improve type-hinting in PhpStorm using the annotation, and to make your code all around more readable. ![]() Inspections are the life-blood of PhpStorm, they are the little watchers that detect when you’ve done something suspicious (or even downright wrong) and pop up a little reminder saying “you may want to check that!”.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |