Skip to content

Commit 0c7771b

Browse files
committedAug 5, 2024
Update README
1 parent f7b533d commit 0c7771b

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed
 

Diff for: ‎README.md

+16
Original file line numberDiff line numberDiff line change
@@ -286,3 +286,19 @@ class Floor extends FunctionNode implements TypedExpression
286286
}
287287

288288
```
289+
290+
## Literal strings
291+
292+
Stub files in phpstan-doctrine come with many parameters marked with `literal-string`. This is a security-focused type that only allows literal strings written in code to be passed into these parameters.
293+
294+
This reduces risk of SQL injection because dynamic strings from user input are not accepted in place of `literal-string`.
295+
296+
An example where this type is used is `$sql` parameter in `Doctrine\Dbal\Connection::executeQuery()`.
297+
298+
To enable this advanced type in phpstan-doctrine, use this configuration parameter:
299+
300+
```neon
301+
parameters:
302+
doctrine:
303+
literalString: true
304+
```

0 commit comments

Comments
 (0)
Please sign in to comment.