Skip to content

Commit 08a2cb1

Browse files
authored
rules.md: document how to re-use QueryPlanAnalyzerRule (#395)
1 parent c7b1689 commit 08a2cb1

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

docs/rules.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,3 +51,19 @@ services:
5151
```
5252

5353
__the callable format is `funtionName#parameterIndex`, while the parameter-index defines the position of the query-string argument.__
54+
55+
## use `QueryPlanAnalyzerRule` for your custom classes
56+
57+
Reuse the `QueryPlanAnalyzerRule` within your PHPStan configuration to detect syntax errors in queries, by registering a service:
58+
59+
-
60+
class: staabm\PHPStanDba\Rules\QueryPlanAnalyzerRule
61+
tags: [phpstan.rules.rule]
62+
arguments:
63+
classMethods:
64+
- 'myClass::query#0'
65+
- 'anotherClass::takesAQuery#2'
66+
67+
__the callable format is `class::method#parameterIndex`, while the parameter-index defines the position of the query-string argument.__
68+
69+
see also [Query Plan Analysis](https://github.com/staabm/phpstan-dba/blob/main/docs/query-plan-analysis.md)

0 commit comments

Comments
 (0)