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
Member variables and methods should not require DocBlock when properly typed
https://developer.adobe.com/commerce/php/coding-standards/docblock/
> Include all necessary information without duplication.
Example 1:
```
private ?ObjectManagerInterface $objectManager;
```
should not require a comment
```
/** @var ObjectManagerInterface|null $objectManager */
```
because all of that information is duplicated. (Though the nullable is actually harder to read in DocBlock standard.)
Example 2:
```
public function getWeakMap() : WeakMap
{
return $this->weakMap;
}
```
This method is expressive. It is obvious what it does. It is strictly typed. There is no reason that it should need a DocBlock.
This change no longer requires DocBlock in these cases:
1: member variables that have defined types
2: methods where all parameters have defined types AND method has defined return type (__construct and __destruct won't require return type, since it isn't allowed)
0 commit comments