magento-coding-standard icon indicating copy to clipboard operation
magento-coding-standard copied to clipboard

Member variables and methods should not require DocBlock when properly typed

Open JacobBrownAustin opened this issue 1 year ago • 7 comments

https://wiki.corp.adobe.com/pages/viewpage.action?spaceKey=MC&title=Proposal+to+change+magento-coding-standard+to+not+require+DocBlock+when+parameters+defined

JacobBrownAustin avatar Dec 14 '23 20:12 JacobBrownAustin

@JacobBrownAustin thanks for raising this. Please can you add some tests to cover the changes being introduced here. I don't know why the automated test runs failed in GitHub Actions; do the tests run successfully on your system?

fredden avatar Dec 15 '23 10:12 fredden

Yeah; I'm working on updating tests now.

JacobBrownAustin avatar Dec 15 '23 22:12 JacobBrownAustin

https://wiki.corp.adobe.com/pages/viewpage.action?spaceKey=MC&title=Proposal+to+change+magento-coding-standard+to+not+require+DocBlock+when+parameters+defined

This URL doesn't work for me. Is this an internal reference within Adobe? What does this page say?

fredden avatar Dec 15 '23 22:12 fredden

Yeah I'll update the details if this to include the info from that page. Basically, I proposed that we shouldn't need superfluous DockBlock for property or method if the type is already defined. It's also solving a separate issue I found more recently that readonly properties fail even when they have proper DockBlock.

JacobBrownAustin avatar Dec 15 '23 23:12 JacobBrownAustin

There we're a lot of changes in PHP_CodeSniffer v3.8.0 related to readonly. It's possible that the bug you mention in passing here has already been solved. Perhaps you could open an issue here so that can be discussed/investigated.

fredden avatar Dec 16 '23 08:12 fredden

See also #406

fredden avatar Dec 18 '23 08:12 fredden