includes: - vendor/larastan/larastan/extension.neon - vendor/nesbot/carbon/extension.neon parameters: level: 2 #Larascan supports 0-9. 10 is not required paths: - app/ - routes/ excludePaths: - bootstrap/cache/* - storage/ - vendor/ # Laravel-specific analysis databaseMigrationsPath: - database/migrations configDirectories: - config translationDirectories: - lang # Feature checks noModelMake: true noUnnecessaryCollectionCall: true checkModelProperties: true checkOctaneCompatibility: true noEnvCallsOutsideOfConfig: true checkModelAppends: true checkModelMethodVisibility: true checkAuthCallsWhenInRequestScope: true parseModelCastsMethod: true enableMigrationCache: true checkMissingTranslations: false # Ignore intentional patterns ignoreErrors: - '#Unsafe usage of new static#' # Larastan's Redis facade stubs are incomplete: pipeline() accepts a # callback and set() accepts TTL/flag args. These calls are valid. - message: '#Static method Redis::pipeline\(\) invoked with 1 parameter, 0 required#' paths: - app/Services/NotificationService.php - app/Services/StoryIndexService.php - message: '#Static method Redis::set\(\) invoked with 4 parameters, 2-3 required#' path: app/Services/NotificationService.php # Eloquent dynamic "where{Attribute}()" magic methods that Larastan # cannot resolve for these models. Calls are valid at runtime. - message: '#Call to an undefined static method App\\Models\\GroupPost::where\w+\(\)#' paths: - app/Http/Controllers/Groups/GroupsPostController.php - app/Jobs/GroupPipeline/GroupCommentPipeline.php # Fractal resource property set dynamically from the transformed data. - message: '#Access to an undefined property App\\Http\\Resources\\AdminUser::\$2fa_enabled#' path: app/Http/Resources/AdminUser.php # Intentional defensive empty()/isset() guards on values that the # current control flow proves are always set. Kept for safety against # future refactors; not bugs. - message: '#in empty\(\) always exists and is (not falsy|always falsy)#' paths: - app/Http/Controllers/FederationController.php - app/Jobs/InboxPipeline/InboxValidator.php - app/Models/CustomFilter.php - app/Util/ActivityPub/Helpers.php - message: '#in isset\(\) always exists and is not nullable#' paths: - app/Http/Controllers/StoryComposeController.php - app/Util/Lexer/Validator.php # Deprecated command references the avatars.thumb_path column, which was # dropped in migration 2021_01_25_011355. The command is dead/legacy. - message: '#Access to an undefined property App\\Models\\Avatar::\$thumb_path#' path: app/Console/Commands/Deprecated/AvatarDefaultMigration.php # Eloquent/Query magic that Larastan cannot statically resolve when a # value is typed as the base Model/Builder rather than a concrete model. # See https://github.com/larastan/larastan/blob/3.x/docs/errors-to-ignore.md - '#Access to an undefined property Illuminate\\Database\\Eloquent\\Model::\$#' - '#Call to an undefined method Illuminate\\Database\\Eloquent\\Builder<[^>]+>::#' - '#Call to an undefined method Illuminate\\Database\\Eloquent\\Model::#' - '#Call to an undefined method Illuminate\\Database\\Query\\Builder::#' - '#Call to an undefined method Illuminate\\Support\\HigherOrder#' # find()/findOrFail() widen to Model|Collection because the id arg could # be an array; callers here pass a scalar id, so it is a single model. - '#Access to an undefined property App\\Models\\[A-Za-z]+\|Illuminate\\Database\\Eloquent\\Collection#' # Model query scopes (whereScope, whereIsNsfw, ...) called through a # relation object; valid at runtime, unresolvable statically. - '#Call to an undefined method Illuminate\\Database\\Eloquent\\Relations\\HasMany::where\w+\(\)#' # Vendor/framework contracts whose concrete runtime types expose these # members but whose interfaces/stubs do not declare them. - '#Access to (an undefined|protected) property Laravel\\Passport\\#' - '#Call to an undefined method Illuminate\\Contracts\\Auth\\StatefulGuard::#' - '#Call to an undefined method Illuminate\\Contracts\\Pagination\\CursorPaginator::#' - '#Access to an undefined property Illuminate\\Support\\ValidatedInput::#' - '#Call to an undefined static method Illuminate\\Database\\Eloquent\\Model::withTrashed\(\)#' - '#Call to an undefined method Symfony\\Component\\HttpFoundation\\Response::withHeaders\(\)#' reportUnmatchedIgnoredErrors: false