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

Use self return type #45

Merged

Conversation

nreynis
Copy link
Contributor

@nreynis nreynis commented Nov 25, 2019

I rewrote the return types to use self instead of Chain. This have several advantages:

  • remove a lot of clutter
  • API isn´t locked on Chain being the final class, in other words, you can now subclass Chain without breaking fluent design
  • mocked interfaces doesn´t need to account for a TypeError (removed the fragile test getFluentTypeErrorForMockedTrait)

Obsoletes #44

Kudos to Symfony for making me aware of this superior syntax.

@florianeckerstorfer
Copy link
Member

Thanks, awesome work

@florianeckerstorfer florianeckerstorfer merged commit 417739d into cocur:master Nov 26, 2019
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

Successfully merging this pull request may close these issues.

2 participants