Needs work
Project:
Coder
Version:
8.3.x-dev
Component:
Coder Sniffer
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
27 Sep 2024 at 16:01 UTC
Updated:
28 Dec 2024 at 17:00 UTC
Jump to comment: Most recent
Comments
Comment #2
claudiu.cristeaLet's try it
Comment #3
claudiu.cristeaI've added the fix and also tests. However, tests are failing and, even I spent few hours, I can get it. Maybe someone with experience can find the problem.
Comment #4
claudiu.cristeaComment #5
klausiHm, I'm not sure we should do this.
Comments in general are a good thing - they explain what code does. Maybe you want to summarize why you have that constructor and what it is doing?
I think you never want to forbid comments, they should always be allowed on any function.
Sure, constructors are often obvious, so we allow you to omit the function comment. But forbidding it? I think no.
Comment #6
claudiu.cristeaIt’s not specifically about constructors. It could be any method and it’s optional. Nobody is forcing you to use it.
Comment #7
klausiRight, we can add this in a way to leave it disabled. Then add a documentation section somewhere how people can enable it. On drupal.org or in the README file?
I think the pull request should be good once you remove the special constructor handling?
We also need a new test case to demonstrate that this addition works.