File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -23,7 +23,7 @@ This extension provides following features:
23
23
24
24
To use this extension, require it in [ Composer] ( https://getcomposer.org/ ) :
25
25
26
- ```
26
+ ``` bash
27
27
composer require --dev phpstan/phpstan-doctrine
28
28
```
29
29
@@ -34,14 +34,14 @@ If you also install [phpstan/extension-installer](https://github.com/phpstan/ext
34
34
35
35
If you don't want to use ` phpstan/extension-installer ` , include extension.neon in your project's PHPStan config:
36
36
37
- ```
37
+ ``` neon
38
38
includes:
39
39
- vendor/phpstan/phpstan-doctrine/extension.neon
40
40
```
41
41
42
42
If you're interested in DQL/QueryBuilder validation, include also ` rules.neon ` (you will also need to provide the ` objectManagerLoader ` , see below):
43
43
44
- ```
44
+ ``` neon
45
45
includes:
46
46
- vendor/phpstan/phpstan-doctrine/rules.neon
47
47
```
@@ -69,6 +69,8 @@ parameters:
69
69
For example, in a Symfony project, ` object-manager.php ` would look something like this:
70
70
71
71
``` php
72
+ <?php
73
+
72
74
require dirname(__DIR__).'/../config/bootstrap.php';
73
75
$kernel = new Kernel($_SERVER['APP_ENV'], (bool) $_SERVER['APP_DEBUG']);
74
76
$kernel->boot();
@@ -81,6 +83,8 @@ If your application uses custom Doctrine types, you can write your own type desc
81
83
Type descriptors implement the interface ` PHPStan\Type\Doctrine\Descriptors\DoctrineTypeDescriptor ` which looks like this:
82
84
83
85
``` php
86
+ <?php
87
+
84
88
public function getType(): string;
85
89
86
90
public function getWritableToPropertyType(): Type;
You can’t perform that action at this time.
0 commit comments