Skip to content

Chainable/fluent configure methods #544

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

Merged
merged 2 commits into from
Mar 26, 2017
Merged

Conversation

acrobat
Copy link
Collaborator

@acrobat acrobat commented Mar 25, 2017

This PR continues the work from @Swader in #522. But now for all configure methods

Closes: #522

Swader and others added 2 commits March 25, 2017 16:09
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');
```
@Nyholm
Copy link
Collaborator

Nyholm commented Mar 26, 2017

Thank you @Swader and @acrobat

@Nyholm Nyholm merged commit 9b66e47 into KnpLabs:master Mar 26, 2017
@acrobat acrobat deleted the fluent-configure branch March 26, 2017 14:40
bobeagan added a commit to bobeagan/php-github-api that referenced this pull request Mar 27, 2017
Nyholm pushed a commit that referenced this pull request Mar 27, 2017
* Add configure() support for issues

Borrowed from issue comments, but changed the default bodyType to "raw" since the documentation indicates that is the default when no specific media type is passed: https://developer.github.com/v3/media/#comment-body-properties

* add more configure methods to address missing custom media types

- also fixes the Issue/Comments default configure value
- also adds support for polaris-preview in PullRequest
- also adds support for squirrel-girl-preview in PullRequest/Comments
- replaces switch case with in_array in Repository/Comments to standardize

* switch order of configure values for PullRequest and PullRequest/Comments

Users would more commonly be interested in changing the bodyType rather than apiVersion
Also, added missing @param values

* update configure() to be chainable per #544

* revert existing bodyTypes that were defaulting to "full" instead of "raw"

Per @Nyholm
"I think the best solution is to accept that we made a mistake before by keep the default body type to full for the comments API. In general we should align with the docs.
Making a new major release just for this fix is not a good solution. What we should do is to create a new issue suggesting this change and add that issue in a 3.0 milestone.
So in short: Just change this back to full and I'll be happy to merge."
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.

3 participants