-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathextension.php
More file actions
38 lines (35 loc) · 1.27 KB
/
Copy pathextension.php
File metadata and controls
38 lines (35 loc) · 1.27 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
<?php
declare(strict_types=1);
use Modufolio\Appkit\PHPStan\Doctrine\ObjectMetadataResolver;
use Modufolio\Appkit\PHPStan\Reflection\Doctrine\EntityRepositoryClassReflectionExtension;
use Modufolio\Appkit\PHPStan\Rules\Doctrine\RepositoryMethodCallRule;
// Consumers point this at their entity manager by overriding the
// 'appkitDoctrine.objectMetadataResolver' service (same key) in their own
// phpstan.php, e.g.:
//
// 'services' => [
// 'appkitDoctrine.objectMetadataResolver' => [
// 'class' => ObjectMetadataResolver::class,
// 'arguments' => ['objectManagerLoader' => __DIR__.'/phpstan-object-manager.php'],
// ],
// ],
//
// where phpstan-object-manager.php is a plain script that `return`s a
// Doctrine\Persistence\ObjectManager (e.g. the app's EntityManager).
return [
'services' => [
'appkitDoctrine.objectMetadataResolver' => [
'class' => ObjectMetadataResolver::class,
'arguments' => [
'objectManagerLoader' => null,
],
],
[
'class' => EntityRepositoryClassReflectionExtension::class,
'tags' => ['phpstan.broker.methodsClassReflectionExtension'],
],
],
'rules' => [
RepositoryMethodCallRule::class,
],
];