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

Proper check for curl error zero. (bunq/sdk_php#7) #148

Merged
merged 5 commits into from
May 29, 2018

Conversation

OGKevin
Copy link
Contributor

@OGKevin OGKevin commented May 28, 2018

References #7

@OGKevin OGKevin added this to the 0.13.5 milestone May 28, 2018
@OGKevin OGKevin self-assigned this May 28, 2018
@OGKevin OGKevin added this to To do in 1.0.0 - SDK via automation May 28, 2018
@OGKevin
Copy link
Contributor Author

OGKevin commented May 28, 2018

@JordyHeemskerk please 👀

@@ -40,7 +40,7 @@ class ApiClient
*/
const ERROR_ENVIRONMENT_TYPE_UNKNOWN = 'Unknown environmentType "%s"';
const ERROR_MAC_OS_CURL_VERSION = 'Your PHP seems to be linked to the MacOS provided curl binary. ' .
'This is incompatible with our SDK, please reinstall by running: "brew reinstall %s --with-homebrew-curl".%s';
'This is incompatible with our SDK, please reinstall by running: "brew reinstall %s --with-homebrew-curl".%s';

Choose a reason for hiding this comment

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

Should this not be indented, as it is a confutation of the previous line?

@@ -130,6 +130,9 @@ class ApiClient
*/
const COMMAND_DETERMINE_BREW_PHP_VERSION = 'brew list | egrep -e "^php[0-9]{2}$"';

const REGEX_CURL_ERROR_CODE = '/(cURL error )(?P<errorCode>\d+)/';

Choose a reason for hiding this comment

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

constant comment


preg_match(self::REGEX_CURL_ERROR_CODE, $exception->getMessage(), $allMatch);

return isset($allMatch[self::REGEX_NAMED_GOUP_ERROR_CODE]) &&

Choose a reason for hiding this comment

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

Just a (personal preference) but I like the && on the newline, this makes it easier to understand / spot the operators (in longer lists). But this is also fine, just my 2 cents ;)

@OGKevin
Copy link
Contributor Author

OGKevin commented May 28, 2018

@JordyHeemskerk pushed.

*/
const FORMAT_CURL_INSTALLATION_INSTRUCTIONS =
'This is incompatible with our SDK, please reinstall by running: "brew reinstall %s --with-homebrew-curl".%s';
const FORMAT_ERROR_MESSAGE_MAC_CURL = '%s %s %s';

Choose a reason for hiding this comment

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

Remove the spaces, otherwise the second line will start with a space, and there will be a useless trailing space after the first line as well.

@bunq bunq deleted a comment May 29, 2018
@OGKevin OGKevin merged commit 9d9ea46 into develop May 29, 2018
1.0.0 - SDK automation moved this from To do to merged May 29, 2018
@OGKevin
Copy link
Contributor Author

OGKevin commented May 29, 2018

@andrederoos

@OGKevin OGKevin deleted the proper-check-for-curl-error-zero-bunq/sdk_php#7 branch May 29, 2018 10:15
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