-
-
Notifications
You must be signed in to change notification settings - Fork 598
Make chaining available in Stargazers #522
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
Conversation
Allows for: ```php $stargazers = $client->repo()->stargazers()->configure('star')->all('vuejs', 'vue'); ``` instead of ```php $stargazers = $client->repo()->stargazers(); $stargazers->configure('star'); $stargazers = $stargazers->all('vuejs', 'vue'); ```
Do we really want a fluid interface here? There are at least 6 other |
What are the anti arguments, apart from other configure functions needing an update? |
Sorry for my empty post. Why fluid interfaces are bad is explained by Ocramius here: https://ocramius.github.io/blog/fluent-interfaces-are-evil/ It is also a matter of opinion. Im not sure if we should introduce it in this library or not. I will let others decide if we want fluid interfaces at all. |
I appreciate that post, but do not agree with it. Regardless, I since there doesn't seem to be any interest from the public IRT this topic, you can close this I guess. |
I'm 👎 on this as it is not a bug just another way of calling the methods. |
Although I am also against fluent interfaces, I would probably make an exception in this case and I have two reasons for that:
|
DX is indeed a good point. We could allow fluent setter on the |
I would also consider adding immutability together with making it fluent. |
I agree. |
I don't see why it's a BC break. |
I consider it a BC break because this code will not work anymore: $stargazers = $client->repo()->stargazers();
$stargazers->configure('star');
$stargazers = $stargazers->all('vuejs', 'vue'); It would be the same as: $stargazers = $client->repo()->stargazers();
$stargazers = $stargazers->all('vuejs', 'vue'); |
Most of our APIs are stateful already. Lets make sure one can use a fluid interface. @Swader do you mind updating others APIs as well? I've also added this to the 2.2 release. I would like to release that this Sunday. |
@Nyholm I'll do my best but I'm traveling right now and through next week and will not be at a code-friendly outlet until some time next week, so might be unable to do it. Sorry in advance if I fail to do it soon. |
I will see if I can make some time for it this weekend and send a PR for it (of course if you don't have the time for it!) |
@acrobat I'm 90% sure I'm not going to be able to make it - I'll be on my phone for 95% of the time, so no code. You're welcome to it! |
I've created #544 to make the missing configure methods chainable! |
Allows for:
instead of