Skip to content

Add Larastan extension to phpstan.neon configuration #61

@robocopklaus

Description

@robocopklaus

Summary

larastan/larastan is installed in require-dev but the phpstan.neon configuration does not include Larastan's extension. PHPStan runs without Laravel-aware rules, missing Facade type resolution and config return types.

Problem

# phpstan.neon — missing includes directive
includes:
    - vendor/larastan/larastan/extension.neon

Without this, PHPStan cannot properly analyze:

  • Facade method calls (e.g., Asset::find(), Queue::push())
  • config() return types
  • Laravel-specific patterns

Suggested Fix

Add the includes directive to phpstan.neon:

includes:
    - vendor/larastan/larastan/extension.neon

parameters:
    # existing config...

References

  • File: phpstan.neon
  • Consolidated review finding: V11

Metadata

Metadata

Assignees

No one assigned

    Labels

    dxDeveloper experiencemediumMedium severity finding

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions