Repository navigation
Expand file tree
/
Copy pathphpstan.neon.dist
More file actions
93 lines (80 loc) · 4.87 KB
/
Copy pathphpstan.neon.dist
File metadata and controls
93 lines (80 loc) · 4.87 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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
# Global ignores for fundamental framework patterns that PHPStan cannot resolve
# (Eloquent magic, generics, new static, etc.). This file is locked — new errors
# should be fixed at the source, or suppressed inline for genuine static analysis
# limitations.
includes:
- src/database/extension.neon
- src/foundation/extension.neon
parameters:
tmpDir: .cache/phpstan
level: 5
parallel:
jobSize: 20
maximumNumberOfProcesses: 32
minimumNumberOfJobsPerProcess: 2
inferPrivatePropertyTypeFromConstructor: true
treatPhpDocTypesAsCertain: false
reportUnmatchedIgnoredErrors: false
paths:
- src
- src/testing/bin/hypervel-test-profile
scanFiles:
- phpstan-stubs/constants.php
- vendor/swoole/ide-helper/src/swoole/Swoole/Http/Response.php
- vendor/swoole/ide-helper/src/swoole/Swoole/Server.php
excludePaths:
- %currentWorkingDirectory%/src/helper/*
- %currentWorkingDirectory%/tests/*
- %currentWorkingDirectory%/src/testbench/hypervel/*
- %currentWorkingDirectory%/src/testbench/workbench/*
- %currentWorkingDirectory%/src/*/node_modules/*
- %currentWorkingDirectory%/src/*/resources/views/*
- %currentWorkingDirectory%/src/*/publish/*
ignoreErrors:
# CreatesApplication is an open trait consumed by both PHPUnit test cases and the
# standalone Testbench application. PHPStan reports this shared capability guard
# in the consumer contexts, where an inline suppression in the trait cannot bind.
- message: "#^Call to function method_exists\\(\\) with .+ and 'beforeApplicationDe[^']*' will always evaluate to true\\.$#"
identifier: function.alreadyNarrowedType
path: src/testbench/src/Concerns/CreatesApplication.php
# protoc 35.1 emits a two-argument enum check, while google/protobuf 5.35.1
# declares the userland method with one argument and relies on PHP ignoring the extra value.
- identifier: arguments.count
path: src/grpc/src/Health/V1/HealthCheckResponse.php
# Framework traits provided for userland - not used internally but intentionally available
- '#Trait Hypervel\\[A-Za-z\\\\]+ is used zero times and is not analysed\.#'
# Schema definitions use Fluent's dynamic properties; Fluent and ForeignIdColumnDefinition also expose dynamic methods.
- '#Access to an undefined property Hypervel\\Support\\Fluent::\$#'
- '#Access to an undefined property Hypervel\\Database\\Schema\\ColumnDefinition::\$#'
- '#Access to an undefined property Hypervel\\Database\\Schema\\IndexDefinition::\$#'
- '#Access to an undefined property Hypervel\\Database\\Schema\\ForeignKeyDefinition::\$#'
- '#Call to an undefined method Hypervel\\Support\\Fluent::#'
- '#Access to an undefined property Hypervel\\Database\\Schema\\ForeignIdColumnDefinition::\$#'
- '#Call to an undefined method Hypervel\\Database\\Schema\\ForeignIdColumnDefinition::#'
# NodeTrait methods - mixed in at app level, not on base Model class
- message: '#Call to an undefined method Hypervel\\Database\\Eloquent\\Model::new(ScopedQuery|NestedSetQuery)\(\)#'
path: src/nested-set/*
# SoftDeletes trait methods - optionally mixed in, can't be statically verified
- '#Call to an undefined method .*::(getDeletedAtColumn|getQualifiedDeletedAtColumn|withTrashed|withoutTrashed|onlyTrashed|forceDelete|restore|trashed|isForceDeleting)\(\)#'
# Generic template type limitations - PHPStan can't resolve methods through generic TModel/TRelatedModel
- '#Call to an undefined method TModel of Hypervel\\Database\\Eloquent\\Model::#'
- '#Call to an undefined method TRelatedModel of Hypervel\\Database\\Eloquent\\Model::#'
# Covariant template types in invariant/contravariant positions - Laravel uses @template-covariant
# for semantic documentation on collection-like classes even though it violates strict variance rules.
# The code is functionally correct; this is a PHPStan limitation with PHP's lack of runtime generics.
- identifier: generics.variance
# Eloquent Relation subclass method overrides - covariance/contravariance issues with complex generics
# (e.g., Builder<*> vs Builder<TModel>, parameter type narrowing in overrides)
- identifier: method.childReturnType
path: src/database/*
- identifier: method.childParameterType
path: src/database/*
# BelongsToMany pivot intersection type - PHPDoc uses object{pivot: ...}&TRelatedModel
# to document that models get a pivot property attached, but PHPStan can't track dynamic attachment
- message: '#object\{pivot:#'
path: src/database/*
# call_user_func with void callbacks - intentional pattern in Eloquent
- '#Result of function call_user_func \(void\) is used\.#'
- '#Result of callable passed to call_user_func\(\) \(void\) is used\.#'
# Laravel's fluent factory pattern (Collection::make, Model::create, etc.) relies on new static() throughout
- '#Unsafe usage of new static#'