Repository navigation
Expand file tree
/
Copy pathphpstan.neon
More file actions
49 lines (47 loc) · 2.52 KB
/
Copy pathphpstan.neon
File metadata and controls
49 lines (47 loc) · 2.52 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
parameters:
level: 0
paths:
- src
customRulesetUsed: true
scanFiles:
# Symbols that exist only where this package runs, and that nothing in vendor/ declares:
# the objects the FrankenPHP runtime hands to a worker.
- stubs/frankenphp.php
ignoreErrors:
# AsyncServiceProvider swaps overrides/Telescope.php in for the installed Telescope
# through an autoloader of its own, and that copy carries CoroutineSafeRecording.
# Analysis reads the installed class, where the method is not; a stub cannot help,
# because stub files refine the types of members rather than add them.
-
message: '#^Call to an undefined static method Laravel\\Telescope\\Telescope::enableAsyncRecording\(\)\.$#'
identifier: staticMethod.notFound
path: src/AsyncServiceProvider.php
# For $attempts >= 1 transaction() leaves its retry loop only by returning or by
# rethrowing from one of the handlers, so the tail after the loop is unreachable.
# PHPStan does not follow that through handleTransactionException() and asks for
# a return. Laravel's own transaction() returns null for $attempts <= 0 too.
-
message: '#^Method .+::(transaction|coroutineTransaction)\(\) should return TReturn but return statement is missing\.$#'
identifier: return.missing
path: src/Database/CoroutineTransactions.php
# The relation subclasses declare $constraints to shadow the property of the same name
# on Relation, which is the one every coroutine of a worker thread shares. Eloquent's
# addConstraints() reads it through late static binding, so the inherited body consults
# the subclass copy. Nothing writes that copy — see the note on the trait — so it leaks
# nothing; PHP simply has no way to declare a readonly static.
-
identifier: coroutine.mutableStaticProperty
path: src/Database/Eloquent/Relations/ConstrainsPerCoroutine.php
rules:
- Spawn\Laravel\PHPStan\MutableStaticPropertyRule
- Spawn\Laravel\PHPStan\UnscopedGuardSwitchRule
services:
# An application that scopes services of its own lists their types in
# perRequestTypes: the container reads config('async.scoped_services') at runtime,
# and static analysis has no container to ask.
-
class: Spawn\Laravel\PHPStan\SingletonCapturesPerRequestRule
arguments:
perRequestTypes: []
tags:
- phpstan.rules.rule