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

Assert values are correct for api context bunq/sdk_php#35 #135

Merged

Conversation

OGKevin
Copy link
Contributor

@OGKevin OGKevin commented Apr 7, 2018

References #35

@OGKevin OGKevin added this to the 0.13.5 milestone Apr 7, 2018
@OGKevin OGKevin self-assigned this Apr 7, 2018
@OGKevin OGKevin added this to To do in 1.0.0 - SDK via automation Apr 7, 2018
@OGKevin OGKevin moved this from To do to open PR in 1.0.0 - SDK Apr 7, 2018
@OGKevin OGKevin moved this from open PR to pending review in 1.0.0 - SDK Apr 7, 2018
@OGKevin OGKevin moved this from pending review to open PR in 1.0.0 - SDK Apr 7, 2018
@sandervdo sandervdo self-requested a review April 9, 2018 07:12
Copy link
Contributor

@sandervdo sandervdo left a comment

Choose a reason for hiding this comment

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

@OGKevin yours.

@@ -104,6 +105,9 @@ public static function create(
array $permittedIps = [],
string $proxyUrl = null
): ApiContext {
InstallationUtil::assertDeviceDescriptionIsValid($description);
InstallationUtil::assertAllIpIsValid($permittedIps);
Copy link
Contributor

Choose a reason for hiding this comment

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

Plural in $permittedIps -> $allPermittedIp

@@ -23,6 +23,7 @@
const ERROR_EMPTY_DESCRIPTION = 'Description cannot be empty.';
const ERROR_INVALID_IP_ADDRESS = 'Invalid ip address "%s"';
const ERROR_CANNOT_CREATE_API_KEY_PRODUCTION = 'Cannot automatically create API key for production.';
const ERROR_INVALID_DEVICE_DESCRIPTION = '"%s" can not be used as a device description.';
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we add a reason here? This error is not really clear.

* @return bool
* @throws BunqException
*/
public static function assertDeviceDescriptionIsValid(string $deviceDescription): bool
Copy link
Contributor

Choose a reason for hiding this comment

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

I keep forgetting about this,.. do we have typehints for string in SDK?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yea, in the SDK we do not suffer from auto casting and therefore we indeed type hint strings.

Copy link
Contributor

Choose a reason for hiding this comment

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

Ack.

sandervdo
sandervdo previously approved these changes Apr 9, 2018
@OGKevin OGKevin dismissed sandervdo’s stale review April 9, 2018 08:30

Requested changes have not been provided yet.

@OGKevin
Copy link
Contributor Author

OGKevin commented Apr 9, 2018

@sandervdo pushed, please 👀

Copy link
Contributor

@sandervdo sandervdo left a comment

Choose a reason for hiding this comment

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

LGTM :shipit:

@OGKevin
Copy link
Contributor Author

OGKevin commented Apr 9, 2018

@sandervdo 🙏

@OGKevin OGKevin merged commit 33d1382 into develop Apr 9, 2018
1.0.0 - SDK automation moved this from open PR to merged Apr 9, 2018
@OGKevin OGKevin deleted the assert_values_are_correct_for_api_context_bunq/sdk_php#35 branch April 9, 2018 08:45
@OGKevin
Copy link
Contributor Author

OGKevin commented Apr 9, 2018

@andrederoos

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
1.0.0 - SDK
  
merged
Development

Successfully merging this pull request may close these issues.

None yet

2 participants