Skip to content

Excessive commenting required by DocBlock Standard #23

@aligent-lturner

Description

@aligent-lturner

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

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
No labels

Type

No type

Projects

Status

✅ Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions