Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 0c7771b

Browse files
Update README
1 parent f7b533d commit 0c7771b

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

‎README.md‎

Lines changed: 16 additions & 0 deletions
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)

AltStyle によって変換されたページ (->オリジナル) /