Skip to content

Integrations are now Apps! - #592

Merged
acrobat merged 19 commits into
KnpLabs:masterfrom
m1guelpf:patch-1
May 23, 2017
Merged

acrobat merged 19 commits into
KnpLabs:masterfrom
m1guelpf:patch-1

Conversation

@m1guelpf

@m1guelpf m1guelpf commented May 22, 2017 •

Copy link
Copy Markdown
Contributor

See #591

@m1guelpf m1guelpf changed the title Update and rename Integrations.php to Apps.php Integrations are now Apps! May 22, 2017
Comment thread lib/Github/Api/Apps.php
*
* @return self
*/
public function configure()

Copy link
Copy Markdown
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

Comment thread lib/Github/Api/Apps.php
* @author Nils Adermann <naderman@naderman.de>
*/
class Integrations extends AbstractApi
class Apps extends AbstractApi

@acrobat acrobat May 22, 2017 •

Copy link
Copy Markdown
Collaborator

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
Copy Markdown
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...

@acrobat acrobat May 22, 2017 •

Copy link
Copy Markdown
Collaborator

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
Copy Markdown
Contributor Author

@acrobat @Nyholm Done!

@acrobat acrobat left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

👍

@Nyholm Nyholm left a comment

Copy link
Copy Markdown
Collaborator

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.

Comment thread lib/Github/Api/Apps.php Outdated
class Apps extends AbstractApi
{
/**
* @deprecated

Copy link
Copy Markdown
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
Copy Markdown
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.

Comment thread lib/Github/Api/Integrations.php Outdated

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

Copy link
Copy Markdown
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
Copy Markdown
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?

Comment thread lib/Github/Client.php
* @method Api\Gists gist()
* @method Api\Gists gists()
* @method Api\Miscellaneous\Gitignore gitignore()
* @method Api\Integrations integration()

Copy link
Copy Markdown
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.

@acrobat acrobat May 23, 2017 •

Copy link
Copy Markdown
Collaborator

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
Copy Markdown
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
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

👍

Comment thread lib/Github/Client.php

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

Copy link
Copy Markdown
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
Copy Markdown
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

Comment thread lib/Github/Client.php Outdated
case 'integration':
case 'integrations':
$api = new Api\Integrations($this);
break

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

missing ; here

@Nyholm Nyholm left a comment

Copy link
Copy Markdown
Collaborator

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

acrobat commented May 23, 2017

Copy link
Copy Markdown
Collaborator

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

@acrobat

acrobat commented May 23, 2017

Copy link
Copy Markdown
Collaborator

@m1guelpf I've restarted the build!

@acrobat

acrobat commented May 23, 2017

Copy link
Copy Markdown
Collaborator

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