generated from AdobeDocs/dev-site-documentation-template
-
Notifications
You must be signed in to change notification settings - Fork 176
Closed
Description
I'm not sure if there's a separate place for proposed changes to the coding standard to go, so I'm opening an issue here.
Expected Behaviour
Class attributes that have specified types should not require a DocBlock. When an attribute already has a type, the DocBlock is providing no new information, and is instead just creating noise - e.g.:
/** @var ProductRepositoryInterface */
private ProductRepositoryInterface $productRepository;
We already have the type information - we don't need the DocBlock to tell us the type.
Actual Behaviour
commerce-php/src/pages/coding-standards/docblock.md
Lines 312 to 331 in 9ba0dc3
| Class attributes must have a type declaration using `@var` tag. | |
| **Example of Class Attribute:** | |
| ```php | |
| <?php | |
| /** | |
| * Copyright © Magento, Inc. All rights reserved. | |
| * See COPYING.txt for license details. | |
| */ | |
| namespace Magento; | |
| class Profiler | |
| { | |
| /** | |
| * @var Profiler | |
| */ | |
| protected static $instance = null; | |
| ``` |
No distinction is made for different PHP versions.
Proposed solution
Update documentation to require a type declaration only if the attribute does not have a defined type.
Metadata
Metadata
Assignees
Labels
No labels
Type
Projects
Status
✅ Done