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

Command icon 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

Ryo Yamashita created an issue. See original summary.

Ryo Yamashita’s picture

Status: Needs work » Needs review

@yas

I have created a patch. Could you please check it?

Ryo Yamashita’s picture

Issue summary: View changes
yas’s picture

@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 class Instance here in this case?

baldwinlouie’s picture

@yas, the patch is fine. I think InstanceInterface follows 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.

yas’s picture

Status: Needs review » Reviewed & tested by the community

@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 class CloudContentEntityBase::getName() has it, so it should be OK regarding the code safety for now.

I'll merge the patch to 4.x and close this issue as Fixed.

  • yas committed eaa1aff on 4.x authored by Ryo Yamashita
    Issue #3232983 by Ryo Yamashita, yas, baldwinlouie: Refactor type...

yas’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.