Skip to content

Integrations are now Apps! #592

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 19 commits into from
May 23, 2017
Merged

Integrations are now Apps! #592

merged 19 commits into from
May 23, 2017

Conversation

m1guelpf
Copy link
Contributor

@m1guelpf m1guelpf commented May 22, 2017

See #591

@m1guelpf m1guelpf changed the title Update and rename Integrations.php to Apps.php Integrations are now Apps! May 22, 2017
*
* @return self
*/
public function configure()
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should keep BC here and just remove the $this->acceptHeaderValue = 'application/vnd.github.machine-man-preview+json'; but keep the method as users of the lib are possibly calling this method

* @author Nils Adermann <naderman@naderman.de>
*/
class Integrations extends AbstractApi
class Apps extends AbstractApi
Copy link
Collaborator

@acrobat acrobat May 22, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also to keep BC the class can not be renamed (in my opinion). But the class can be deprecated and a new Apps class can be created (where this class can extend from)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As I also modified the Client to point to the new class, there's no reason to keep using this...

Copy link
Collaborator

@acrobat acrobat May 22, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know, I wanted to do a same sort of change but @Nyholm came up with a good point.

#534 (review)

@m1guelpf
Copy link
Contributor Author

@acrobat @Nyholm Done!

Copy link
Collaborator

@acrobat acrobat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Copy link
Collaborator

@Nyholm Nyholm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good. There were some minor BC breaks. Apart from that I'm very happy with the change.

class Apps extends AbstractApi
{
/**
* @deprecated
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why include this?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh I see. Move this method back to the Integrations class. It is weird to add a class with deprecated functions.

/**
* @link https://developer.github.com/v3/integrations/
* @deprecated
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add a comment saying what the new thing is.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we can do it "symfony" style with a @trigger_error when using the class. Like this https://github.com/symfony/symfony/blob/3.3/src/Symfony/Component/ClassLoader/ApcClassLoader.php#L14

But also keep the annotation so ide's will show it. What do you think @Nyholm?

@@ -29,8 +29,9 @@
* @method Api\Gists gist()
* @method Api\Gists gists()
* @method Api\Miscellaneous\Gitignore gitignore()
* @method Api\Integrations integration()
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You could leave these comments.

Copy link
Collaborator

@acrobat acrobat May 23, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes indeed keep the old methods (to the deprecated class) so a user will know they have to change their code to the new methods

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done!

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@@ -200,7 +201,8 @@ public function api($name)

case 'integration':
case 'integrations':
$api = new Api\Integrations($this);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should keep this. Calling integrations should give you the deprecated Integrations class, right?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's right, this way the user knows he has to update some code

@@ -201,6 +201,8 @@ public function api($name)

case 'integration':
case 'integrations':
$api = new Api\Integrations($this);
break
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

missing ; here

Copy link
Collaborator

@Nyholm Nyholm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Im happy with the current state. Github is having some issues ATM. Lets wait a couple of hours or a day and then restart travis. After Travis is green Im happy to merge.

@acrobat
Copy link
Collaborator

acrobat commented May 23, 2017

Yeah it looks like packagist is also having problems https://twitter.com/packagist/status/866952618349920257

@acrobat
Copy link
Collaborator

acrobat commented May 23, 2017

@m1guelpf I've restarted the build!

@acrobat
Copy link
Collaborator

acrobat commented May 23, 2017

The build is green again! Thanks @m1guelpf

@acrobat acrobat merged commit 1d56183 into KnpLabs:master May 23, 2017
@m1guelpf m1guelpf deleted the patch-1 branch May 23, 2017 19:59
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