1
0
mirror of https://github.com/flarum/core.git synced 2025-08-31 11:52:16 +02:00

feat(phpstan): foundation for usage in extensions (#3666)

* feat(phpstan): pick up extended model relations typings
* feat(phpstan): pick up extended model date attributes
* feat(core): introduce `castAttribute` extender
Stops using `dates` as it's deprecated in laravel 8
* feat(phpstan): pick up extended model attributes through casts
* fix: extenders not resolved when declared namespace
* fix(phpstan): new model attributes are always nullable
* chore(phpstan): add helpful cache clearing command
* Apply fixes from StyleCI
* chore: improve extend files provider logic
* chore: rename `castAttribute` to just `cast`
* chore: update phpstan package to detect `cast` method
* Update framework/core/src/Extend/Model.php

Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>
This commit is contained in:
Sami Mazouz
2023-01-15 15:25:13 +01:00
committed by GitHub
parent 2d2bf5c504
commit 5fe3cfd837
15 changed files with 934 additions and 28 deletions

View File

@@ -180,7 +180,8 @@
}
},
"scripts": {
"analyse:phpstan": "phpstan analyse"
"analyse:phpstan": "phpstan analyse",
"clear-cache:phpstan": "phpstan clear-result-cache"
},
"scripts-descriptions": {
"analyse:phpstan": "Run static analysis"