You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A type extension was added so that `Magento\Framework\App\ObjectManager` calls return the correct return type.
66
-
67
-
### Support for magic method calls
68
-
For some classes like the `Magento\Framework\DataObject` or `Magento\Framework\Session\SessionManager` logic was added
69
-
to be able to support magic method calls.
52
+
For the final step, you need to register the custom autoloader that comes with this extension by adding `vendor/bitexpert/phpstan-magento/autoload.php`
53
+
as a bootstrap file:
70
54
71
-
### PHPStan rules
72
-
73
-
The following rules are available to run checks against your codebase, e.g. if your implementation adheres to the
74
-
service contracts specification. Each of the rules can be disabled if needed.
75
-
76
-
#### Service contracts
77
-
78
-
Since Magento framework version 100.1.0 entities must not be responsible for their own loading, service contracts should
79
-
be used to persist entities.
80
-
81
-
To disable this rule add the following code to your `phpstan.neon` configuration file:
82
-
```
55
+
```neon
83
56
parameters:
84
-
magento:
85
-
checkServiceContracts: false
57
+
bootstrapFiles:
58
+
- vendor/bitexpert/phpstan-magento/autoload.php
86
59
```
87
60
88
-
#### Collections should be used directly via factory
89
-
90
-
Since Magento framework version 101.0.0 Collections should be used directly via factory instead of calling
A type extension is provided so that `Magento\Framework\App\ObjectManager` method calls do return the correct return type.
26
+
27
+
## Magic method calls
28
+
For some classes like `Magento\Framework\DataObject` or `Magento\Framework\Session\SessionManager` PHPStan logic is provided
29
+
to be able to let the magic method calls return proper types.
30
+
31
+
## Extension attributes
32
+
This PHPStan extension supports [extension attributes](https://devdocs.magento.com/guides/v2.4/extension-dev-guide/extension_attributes/adding-attributes.html) by parsing the `extension_attributes.xml` files.
33
+
34
+
## PHPStan rules
35
+
36
+
The following rules are available to run checks against your codebase, e.g. if your implementation adheres to the
37
+
service contracts specification. Each of the rules can be disabled if needed.
38
+
39
+
### Service contracts
40
+
41
+
Since Magento framework version 100.1.0 entities must not be responsible for their own loading, [service contracts](https://devdocs.magento.com/guides/v2.4/extension-dev-guide/service-contracts/service-contracts.html) should
42
+
be used to persist entities.
43
+
44
+
To disable this rule add the following code to your `phpstan.neon` configuration file:
45
+
```
46
+
parameters:
47
+
magento:
48
+
checkServiceContracts: false
49
+
```
50
+
51
+
### Collections should be used directly via factory
52
+
53
+
Since Magento framework version 101.0.0 Collections should be used directly via factory instead of calling
0 commit comments