PostModel maps posts table (id, user_id fk, title, body text, created_at indexed). EloquentPostRepository: create, find, findByUserId (desc by created_at), findRecent (limit, desc), delete - chain via ::query() to keep larastan happy. FakePostRepository sorts on read (defensive copy each return). cascade-on-delete on user_id so removing a user nukes their posts. phpstan.neon suppresses staticMethod.dynamicCall under app/*/Eloquent*Repository.php - phpstan-strict-rules flags Eloquent's fluent builder idiom (Model::query()->orderBy()) because the static methods become instance calls mid-chain. suppression scoped to repo files only so the rule still applies elsewhere.
29 lines
800 B
Text
29 lines
800 B
Text
includes:
|
|
- vendor/larastan/larastan/extension.neon
|
|
- vendor/phpstan/phpstan-strict-rules/rules.neon
|
|
|
|
parameters:
|
|
level: max
|
|
treatPhpDocTypesAsCertain: false
|
|
reportUnmatchedIgnoredErrors: false
|
|
|
|
ignoreErrors:
|
|
# Eloquent's fluent builder triggers staticMethod.dynamicCall in
|
|
# phpstan-strict-rules because Builder methods declared static on
|
|
# the model become instance calls after the first chain link. This
|
|
# is the documented Laravel idiom; suppress the false positive.
|
|
-
|
|
identifier: staticMethod.dynamicCall
|
|
path: app/*/Eloquent*Repository.php
|
|
|
|
paths:
|
|
- app
|
|
|
|
excludePaths:
|
|
analyse: [
|
|
vendor,
|
|
tests
|
|
]
|
|
|
|
universalObjectCratesClasses:
|
|
- stdClass
|