Problem/Motivation
GitLab CI reports a single issue during the phpstan test:
------ ------------------------------------------------------------------------------
Line src/Plugin/Validation/Constraint/AlternativeUserEmailsValidator.php
------ ------------------------------------------------------------------------------
39 Unsafe usage of new static().
💡 See:
https://phpstan.org/blog/solving-phpstan-error-unsafe-usage-of-new-static
------ ------------------------------------------------------------------------------
Issue fork alternative_user_emails-3426543
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #3
ptmkenny commentedComment #4
ptmkenny commentedI opted to make the constructor final rather than the entire class, because it may be that someone builds on top of this module and wants to extend the validator class.
Comment #5
ptmkenny commentedComment #6
jonathanshawI'm happy with that. A pit puzzled by where this static is, I can't see one :)
Comment #7
ptmkenny commentedOk, great. I think the point of this rule is "lock down the class somehow so that people don't extend it haphazardly, making debugging harder." But to do that they have confusingly named rules... =)
Comment #9
ptmkenny commented