Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
polkan-msk opened this issue Sep 18, 2020 · 0 comments
Open

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

polkan-msk opened this issue Sep 18, 2020 · 0 comments

Comments

@polkan-msk
Copy link

polkan-msk commented Sep 18, 2020

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant