This repository was archived by the owner on Nov 7, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathphpstan.neon.dist
More file actions
66 lines (59 loc) · 3.39 KB
/
Copy pathphpstan.neon.dist
File metadata and controls
66 lines (59 loc) · 3.39 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
includes:
- vendor/phpstan/phpstan-strict-rules/rules.neon
parameters:
level: max
treatPhpDocTypesAsCertain: false
inferPrivatePropertyTypeFromConstructor: true
# Enhanced strict analysis
checkMissingCallableSignature: true
checkUninitializedProperties: true
polluteScopeWithLoopInitialAssignments: false
polluteScopeWithAlwaysIterableForeach: false
# Modern PHP best practices
checkExplicitMixedMissingReturn: true
checkFunctionNameCase: true
checkInternalClassCaseSensitivity: true
checkTooWideReturnTypesInProtectedAndPublicMethods: true
# Readonly properties support (PHP 8.1+)
checkDynamicProperties: true
ignoreErrors:
# Dynamic method calls are expected for proxy pattern
- '#Variable method call on OpenFGA\\ClientInterface#'
- '#Variable method call on OpenFGA\\Laravel\\OpenFgaManager#'
- '#Variable method call on \$this\(OpenFGA\\Laravel\\Testing\\MockScenarios\)#'
- '#Variable property access on OpenFGA\\Laravel\\OpenFgaManager#'
# PSR discovery - PHPStan can't determine runtime class checks
- '#Call to function method_exists\(\) with .* will always evaluate to false#'
# Trait is provided for users to apply to their models
- '#Trait OpenFGA\\Laravel\\Traits\\HasAuthorization is used zero times and is not analysed#'
# Debugbar is an optional dependency (file is excluded below)
# Testing traits are provided for users to apply in their test classes
- '#Trait OpenFGA\\Laravel\\Testing\\IntegrationTestHelpers is used zero times and is not analysed#'
- '#Trait OpenFGA\\Laravel\\Testing\\MeasuresPerformance is used zero times and is not analysed#'
- '#Trait OpenFGA\\Laravel\\Testing\\SnapshotsTesting is used zero times and is not analysed#'
- '#Trait OpenFGA\\Laravel\\Testing\\UsesMockScenarios is used zero times and is not analysed#'
# Spatie compatibility trait is provided for users
- '#Trait OpenFGA\\Laravel\\Traits\\SpatieCompatible is used zero times and is not analysed#'
# Laravel HTTP Client Factory uses magic methods
- '#Dynamic call to static method Illuminate\\Http\\Client\\PendingRequest::withHeaders\(\)#'
# Psalm requires isset() checks that PHPStan considers redundant for preg_match results
-
message: '#Offset \d+ on array\{.+\} in isset\(\) always exists and is not nullable#'
path: src/Console/Commands/ModelValidateCommand.php
# PHPDoc type annotations for Psalm compatibility
-
message: '#PHPDoc tag @var with type .+ is not subtype of native type#'
path: src/Console/Commands/ModelValidateCommand.php
# ConfigValidator array access is safely guarded by array_key_exists checks
-
message: '#Cannot access an offset on mixed#'
path: src/Support/ConfigValidator.php
# OpenFgaGate intentionally extends Laravel's Gate with more flexible argument handling
# to support both traditional Laravel authorization and OpenFGA's relationship-based model
-
message: '#Method OpenFGA\\Laravel\\Authorization\\OpenFgaGate::check\(\) has parameter \$abilities with no value type specified in iterable type iterable#'
path: src/Authorization/OpenFgaGate.php
paths:
- src
excludePaths:
- src/Debugbar/OpenFgaCollector.php