Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not require DocBlock for typed class attributes #404

Open
aligent-lturner opened this issue Jun 17, 2022 · 1 comment · May be fixed by #406
Open

Do not require DocBlock for typed class attributes #404

aligent-lturner opened this issue Jun 17, 2022 · 1 comment · May be fixed by #406
Assignees
Labels
enhancement Improvements to existing rules Progress: PR created

Comments

@aligent-lturner
Copy link

aligent-lturner commented Jun 17, 2022

Description

Do not require a DocBlock for typed class attributes

Expected behavior

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.

I propose that the rule regarding class attributes requiring a @var annotation with a type be changed so that it only applies to attributes without a specified type.

Benefits

Removes the need for redundant comments

@aligent-lturner aligent-lturner added the enhancement Improvements to existing rules label Jun 17, 2022
@m2-assistant
Copy link

m2-assistant bot commented Jun 17, 2022

Hi @aligent-lturner. Thank you for your report.
To speed up processing of this issue, make sure that you provided sufficient information.

Add a comment to assign the issue: @magento I am working on this


Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Improvements to existing rules Progress: PR created
Projects
None yet
1 participant