Commit 0b01c09
committed
feat: Add
By default, phpstan bases the code checks it does on the current version of PHP that’s installed.
Specifying the minimum version of PHP required allows you to catch errors that use more modern versions of the PHP than the minimum version of PHP required by your project (and Craft CMS).
Adding `platform` to your `composer.json` is one way to accomplish this: https://phpstan.org/config-reference#phpversion
It’s caught many regression errors for me when porting code between versions of Craft that have lower minimum requirements, and will do the same for you going forward.
So if you use constructs that are only available in PHP 8.3 or 8.4 or later versions of PHP, it’ll catch those errorsplatform to composer.json
1 parent 95b825c commit 0b01c09
1 file changed
+4
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
43 | 47 | | |
44 | 48 | | |
45 | 49 | | |
| |||
0 commit comments