Closed danepowell closed 1 year ago
I consider strict typehinting to be a best practice. We should adopt this in all of our projects.
I'm on board!
I think there's also a Slevomat sniff to enforce the use of
declare(strict_types=1)
in every file, if we want to take it that far.
For posterity, that would be SlevomatCodingStandard.TypeHints.DeclareStrictTypes
.
It might be such a large effort that we want to put it in a standalone "StrictTypes" standard or something.
Yeah. In fact, as you point out, even parameter/property/return type hints could be a big lift for some projects. What if we do this?
1.x
branch, e.g., v1.1.0
.2.x
) and merge AcquiaEdge
into AcquiaDrupalStrict
.SlevomatCodingStandard.TypeHints.DeclareStrictTypes
to the now-empty AcquiaEdge
.AcquiaDrupalStrict
.Let's do it! I'll merge this and see if I remember how to cut a release, I'll let you handle the comms, or maybe it needs to go through the ORCA team since ORCA will need to bump the coding standards to v2 at some point.
I consider strict typehinting to be a best practice. We should adopt this in all of our projects. I'm adding this to edge since it's a heavy lift to adopt for existing projects without typehinting.
It might be such a large effort that we want to put it in a standalone "StrictTypes" standard or something.
I think there's also a Slevomat sniff to enforce the use of
declare(strict_types=1)
in every file, if we want to take it that far.