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

Excessive commenting required by DocBlock Standard #23

Closed
aligent-lturner opened this issue Jun 16, 2022 · 3 comments
Closed

Excessive commenting required by DocBlock Standard #23

aligent-lturner opened this issue Jun 16, 2022 · 3 comments
Assignees

Comments

@aligent-lturner
Copy link

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.

@jeff-matthews
Copy link
Contributor

@dshevtsov, is this something that you can take to the next community or development guild meeting for discussion?

@dshevtsov
Copy link
Contributor

Any changes to standards and conventions are typically suggested and discussed in https://github.com/magento/architecture.

@dshevtsov
Copy link
Contributor

Just received info that https://github.com/magento/architecture is stale.
The dev guild recommends to use the following repo: https://github.com/magento/magento-coding-standard

@hguthrie hguthrie moved this to 🆕 Ready for Grooming in Commerce - Issues Dec 15, 2022
@hguthrie hguthrie moved this from 🆕 Ready for Grooming to 🏗 In progress in Commerce - Issues Jan 5, 2023
@jeff-matthews jeff-matthews moved this from 🏗 In progress to ✅ Done in Commerce - Issues Dec 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

No branches or pull requests

3 participants