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

Amazon, Fitbit, Heroku, Paypal, Stripe Clients added #63

Merged
merged 14 commits into from
Nov 2, 2017
Merged

Amazon, Fitbit, Heroku, Paypal, Stripe Clients added #63

merged 14 commits into from
Nov 2, 2017

Conversation

luchianenco
Copy link
Contributor

No description provided.

@weaverryan
Copy link
Member

Thanks for this @luchianenco! Just give us a few days to review it - it's on our list :).

@MolloKhan MolloKhan self-assigned this Oct 18, 2017

public function getProviderClass(array $config)
{
return 'Luchianenco\OAuth2\Client\Provider\Amazon';
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm just wondering why not using the syntax Amazon::class?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

well, I tried to keep the style the repository had before ;)
of course it can be a next PR ;) to change in all Configurators

Copy link
Contributor

Choose a reason for hiding this comment

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

Oh, yeah, maybe @weaverryan can tell us the true reason behind this :)

Copy link
Member

@bocharsky-bw bocharsky-bw Oct 19, 2017

Choose a reason for hiding this comment

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

I think it's just legacy from the past, but since we require PHP >=5.5.9 in composer.json now changing to ::class seems reasonable to me, but yes, in another PR and for all occurrences

Copy link
Member

@bocharsky-bw bocharsky-bw Oct 19, 2017

Choose a reason for hiding this comment

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

Uh oh, probably I was wrong! The main problem is that we do not have strict dependencies on those packages, i.e. user installs them if needed. So, it'll throw an error if the class does not exist. That's why here we use strings which postpone this check until actual call. Sorry for misleading you in my previous message 😇

Copy link
Contributor

Choose a reason for hiding this comment

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

Ahh, that makes sense, thanks for the clarification

@MolloKhan
Copy link
Contributor

Only one minor comment, but everything looks great

Thanks @luchianenco!

Copy link
Member

@bocharsky-bw bocharsky-bw left a comment

Choose a reason for hiding this comment

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

Just a few small comments


public function getProviderClass(array $config)
{
return '\AdamPaterson\OAuth2\Client\Provider\Stripe';
Copy link
Member

Choose a reason for hiding this comment

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

We don't need leading slash, i.e. AdamPaterson\OAuth2\Client\Provider\Stripe

public function buildConfiguration(NodeBuilder $node)
{
$node
->scalarNode('is_sandbox')
Copy link
Member

Choose a reason for hiding this comment

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

Looks like it should be booleanNode() instead, right?

README.md Outdated
redirect_route: connect_paypal_check
redirect_params: {}
# When true, client uses Paypal Sandbox urls.
# is_sandbox: ''
Copy link
Member

Choose a reason for hiding this comment

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

This should be false as value by default instead of an empty string

Copy link
Contributor Author

Choose a reason for hiding this comment

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

bin/update_readme uses '' instead of boolean value. I will updated it manually but after next usage to update readme it will be again is_sandbox: ''

Copy link
Member

Choose a reason for hiding this comment

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

Hm, I thought it should be false after scalarNode() -> booleanNode() tweak

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I have updated update_readme to set boolean values...please check if it is fine


} elseif ($child instanceof BooleanNode) {
$defaultValue = $child->getDefaultValue()
? $child->getDefaultValue()
Copy link
Member

@bocharsky-bw bocharsky-bw Oct 20, 2017

Choose a reason for hiding this comment

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

Should be simply 'true', otherwise we'll have 1 in README instead

Copy link
Contributor Author

@luchianenco luchianenco Oct 20, 2017

Choose a reason for hiding this comment

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

do u mean : $defaultValue = $child->getDefaultValue() ? 'true'

Copy link
Member

@bocharsky-bw bocharsky-bw Oct 20, 2017

Choose a reason for hiding this comment

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

Not quite, I mean ? 'true' on this line, i.e.:

 $defaultValue = $child->getDefaultValue()
    ? 'true'
    : 'false';

We need true as a string too

Copy link
Contributor Author

Choose a reason for hiding this comment

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

that's what I meant ;) sorry just shorted the expression :)
ok I will do

@bocharsky-bw
Copy link
Member

Thanks for the bin/update_readme tweak! Just one comment left.. and it'll look great for me

Copy link
Member

@bocharsky-bw bocharsky-bw left a comment

Choose a reason for hiding this comment

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

Looks great for me! 👍

@weaverryan weaverryan merged commit 5752091 into knpuniversity:master Nov 2, 2017
@weaverryan
Copy link
Member

Woohoo! Sorry for the delay - but this is awesome! I'll tag a new release shortly :)

@luchianenco
Copy link
Contributor Author

@weaverryan I can understand :) too many events

@weaverryan
Copy link
Member

Haha, yea... a bit of traveling... and things are pretty busy right now with Symfony 4 prep. Busy... but exciting :)

Cheers!

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.

4 participants