-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathphpstan.neon
More file actions
65 lines (51 loc) · 2.86 KB
/
phpstan.neon
File metadata and controls
65 lines (51 loc) · 2.86 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
includes:
- vendor/larastan/larastan/extension.neon
parameters:
paths:
- app/
# Level 5 provides good balance of strictness and practicality
# Checks for: basic undefined variables, unknown classes/methods, incorrect types
level: 5
# Disable strict PHPDoc type checks to reduce noise from state/enum comparisons
# Set to true for stricter type checking if needed
treatPhpDocTypesAsCertain: false
# Report unused private properties, methods, and constants
checkUninitializedProperties: true
# Laravel-specific rules (highly recommended)
checkModelProperties: false # Beta - enable when stable
checkOctaneCompatibility: false # Enable if using Octane
checkMissingCallableSignature: false # Level 6+ required
noUnnecessaryCollectionCall: true # Catch inefficient queries
noModelMake: true # Prevent inefficient Model::make()
noEnvCallsOutsideOfConfig: true # Critical for cached configs
checkModelAppends: true # Validate $appends property
# Performance-related
parallel:
maximumNumberOfProcesses: 4
processTimeout: 300.0
# Ignore errors that are too noisy or impractical to fix
ignoreErrors:
# Ignore PHPDoc type covariance issues from Laravel core
- '#PHPDoc type .* is not covariant with PHPDoc type .* of overridden property#'
# Ignore missing class issues in third-party packages
- '#Call to method .* on an unknown class#'
- '#Instantiated class .* not found#'
# Ignore undefined properties on generic Eloquent Model (use specific model types where possible)
- '#Access to an undefined property Illuminate\\Database\\Eloquent\\Model::\$\w+#'
# Ignore method not found on generic Eloquent Model
- '#Call to an undefined method Illuminate\\Database\\Eloquent\\Model::\w+\(\)#'
# Ignore cannot access/call on generic types (needs proper type hints)
- '#Cannot access property .* on Illuminate\\Database\\Eloquent\\Model\|int\|string#'
- '#Cannot call method .* on Illuminate\\Database\\Eloquent\\Model\|int\|string#'
# Ignore RestRequest parameter type issues (third-party package)
- '#Parameter \$request of method App\\Rest\\Resources\\.+Resource::\w+\(\) has invalid type App\\Rest\\Resources\\RestRequest#'
- '#PHPDoc tag @param for parameter \$request with type App\\Rest\\Resources\\RestRequest is not subtype#'
# Ignore DataCite service undefined property (trait-based properties)
- '#Access to an undefined property App\\Services\\DOI\\DataCite::\$(client|prefix)#'
excludePaths:
analyseAndScan:
- app/Console/Kernel.php
- app/Exceptions/Handler.php
- database/migrations/*
- database/factories/*
- database/seeders/*