| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
A function with a native return type (or a constructor) and native type declarations on every parameter expresses all its type information in the signature. Requiring a docblock in that case produces noise, especially for constructors that use property promotion where every parameter is already visibility- and type-declared inline. The sniff now skips the 'Missing doc comment' error when: - the function is __construct and every parameter has a native type, or - the function has a native return type and every parameter has a native type. Functions that still lack types (legacy code, callbacks with mixed arguments) continue to require a docblock.
|
While skipping argument description is fine, every public method should have a general description IMO. |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Summary
The CakePHP.Commenting.FunctionComment.Missing sniff currently flags every function without a docblock, even when the signature already expresses all type information natively. With constructor property promotion this is especially noisy:
Every parameter is already visibility-, type- and name-declared inline; a docblock would be pure redundancy.
This PR teaches the sniff to skip the `Missing` error when the function signature carries full native type information:
Functions that still lack types (untyped params, missing return types) continue to require a docblock, so legacy code is unaffected.
Other existing checks (spacing after docblock, `@throws` validation, etc.) are unchanged and still run whenever a docblock is present.