Skip to content

2.15. Method chaining in class design MUST be avoided #443

@polkan-msk

Description

@polkan-msk

Could you please clarify the requirement 2.15 of the Technical Guidelines "Method chaining in class design MUST be avoided"?
We have like real holy war here b/c of this rule.
It seems to me that according to CQRS principle that only means we must not use "return $this" while designing new classes.
And that does not mean we can't use constructions like $this->storeManager->getStore()->getId() in our code.
Is that correct?
Or ->getStore()->getId() is also prohibited by this rule? And so we must first get store into some variable. And then get Id using the variable.
Thank you in advance.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions