Problem/Motivation
Ec2OperationsService was not performing proper type hinting, resulting in a large number of warning messages being displayed by phpcsPHP Intelephense.
Proposed resolution
Refactor type hinting of Ec2OperationsService.
Issue fork cloud-3232983
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
Ryo Yamashita commented@yas
I have created a patch. Could you please check it?
Comment #4
Ryo Yamashita commentedComment #5
yas@baldwinlouie
Could you please review the patch? I think it looks fine, but let me confirm, do you think it is fine to make change the type hinting to
InstanceInterface, not a classInstancehere in this case?Comment #6
baldwinlouie commented@yas, the patch is fine. I think
InstanceInterfacefollows more closely with our coding style of passing an Interface instead of a concrete class. A majority of our design patterns is passing interfaces as parameters in methods and constructors. I think it is fine.Comment #7
yas@baldwinlouie
Thank you for your review. I agree with you and the patch looks even better to use a type hint for each parameters as possible. @ryo-yamashita is concerned that e.g.
InstanceInterface::getName()method doesn't exist (is not defined) in InstanceInterface but I think it the parent classCloudContentEntityBase::getName()has it, so it should be OK regarding the code safety for now.I'll merge the patch to
4.xand close this issue as Fixed.Comment #10
yas