-
Notifications
You must be signed in to change notification settings - Fork 279
Expand file tree
/
Copy pathphpstan-no-baseline.neon
More file actions
51 lines (50 loc) · 2.05 KB
/
Copy pathphpstan-no-baseline.neon
File metadata and controls
51 lines (50 loc) · 2.05 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
# Custom architectural rule: Bootstrap::getDatabase() may only be called from the
# composition-root entry points listed below; everything else must inject IDatabase.
# Rule class autoloaded via composer autoload-dev (Matecat\PhpStan\ -> dev-tools/phpstan).
services:
-
class: Matecat\PhpStan\Rules\NoDirectBootstrapGetDatabaseRule
tags:
- phpstan.rules.rule
arguments:
allowedFiles:
- lib/View/fileupload/index.php
- lib/Utils/TaskRunner/executor_worker.php
- internal_scripts/tasks/tasks.php
- plugins/aligner/lib/Features/Aligner/Model/DualDatabase.php
parameters:
level: 8
paths:
- lib
- plugins
# Vendor type stubs — correct wrong/missing types in third-party libraries
# OpenAi::chat() declares $stream as null but accepts callable at runtime
stubFiles:
- phpstan-stubs/OpenAi.stub
- phpstan-stubs/KleinApp.stub
scanFiles:
- router.php
excludePaths:
- lib/View/APIDoc.php (?)
- lib/View/templates/_APIDoc.php
- vendor
- plugins/translated/tests
- plugins/uber/tests
universalObjectCratesClasses:
- Model\DataAccess\ShapelessConcreteStruct
# Flag @throws \Exception on public/protected methods when only
# a narrower exception (e.g. \InvalidArgumentException) is thrown
checkTooWideThrowTypesInProtectedAndPublicMethods: true
exceptions:
uncheckedExceptionClasses:
- 'Model\DataAccess\UnknownPropertyException'
- 'Controller\Exceptions\RenderTerminatedException'
- 'Controller\Exceptions\MissingDatabaseException'
check:
# Report when code throws an exception that has no
# matching @throws tag in the method's PHPDoc
missingCheckedExceptionInThrows: true
# Report when @throws declares a broader type than
# what is actually thrown (applies to all methods)
tooWideThrowType: true
treatPhpDocTypesAsCertain: false