Skip to content

fix: Composer configuration, typos and type hints #143

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 3 commits into from
Jun 15, 2020
Merged

fix: Composer configuration, typos and type hints #143

merged 3 commits into from
Jun 15, 2020

Conversation

kampalex
Copy link
Contributor

@kampalex kampalex commented Jun 4, 2020

Just came to submit a typo, but I found a few small issues while reviewing this library using phpStorm:

  • Usage of Throwable when using PHP 5.6 (which is minimal PHP version requirement for this library, I reported it in separate issue)
  • Added Composer extension requirements (json, curl)
  • Client: magic method 'unsubcribes' -> 'unsubscribes'
  • Exception throw blocks
  • Typos

ps. In addition of this, I've found missing 4th argument of magic get() method in example.php:
$response = $client->api_keys()->get(null, $queryParams, $requestHeaders, $retryOnLimit);
Not a big thing. Just mentioning.

Checklist

  • I acknowledge that all my contributions will be made under the project's license
  • I have made a material change to the repo (functionality, testing, spelling, grammar)
  • I have read the Contribution Guidelines and my PR follows them
  • I have titled the PR appropriately
  • I have updated my branch with the master branch
  • I have added tests that prove my fix is effective or that my feature works
  • I have added necessary documentation about the functionality in the appropriate .md file
  • I have added inline documentation to the code I modified

Added Composer extension requirements (json, curl)
Client: magic method 'unsubcribes' -> 'unsubscribes'
Exception throw blocks
Typos
@thinkingserious thinkingserious added the status: code review request requesting a community code review or review from Twilio label Jun 4, 2020
Copy link
Contributor

@thinkingserious thinkingserious left a comment

Choose a reason for hiding this comment

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

The typo fixes LGTM, thanks!

@thinkingserious thinkingserious added status: waiting for feedback waiting for feedback from the submitter type: community enhancement feature request not on Twilio's roadmap and removed status: code review request requesting a community code review or review from Twilio labels Jun 5, 2020
@thinkingserious
Copy link
Contributor

With respect to

ps. In addition of this, I've found missing 4th argument of magic get() method in example.php:
$response = $client->api_keys()->get(null, $queryParams, $requestHeaders, $retryOnLimit);

Do you mean that there is an error when you try to pass in $retryOnLimit?

Thanks!

@kampalex
Copy link
Contributor Author

kampalex commented Jun 6, 2020

With respect to

ps. In addition of this, I've found missing 4th argument of magic get() method in example.php:
$response = $client->api_keys()->get(null, $queryParams, $requestHeaders, $retryOnLimit);

Do you mean that there is an error when you try to pass in $retryOnLimit?

Thanks!

Hi Elmer. This is not a functional error, just an incomplete PHPDoc magic method definition just having 3 arguments which are available for usage. If providing 4th argument (like in the example.php), phpStorm will report the use of an unsupported 4th argument.

Function __call handles execution of magic methods get, post, patch, put and delete (these are inside property methods). Arguments 0..3 are extracted which means that 4 arguments can be provided. Last argument is $retryOnLimit which can be overridden if given.

Easy fix for this: append , $retryOnLimit = null before close parenthesis of each method:

 * @method Response get($body = null, $query = null, $headers = null, $retryOnLimit = null)
 * @method Response post($body = null, $query = null, $headers = null, $retryOnLimit = null)
 * @method Response patch($body = null, $query = null, $headers = null, $retryOnLimit = null)
 * @method Response put($body = null, $query = null, $headers = null, $retryOnLimit = null)
 * @method Response delete($body = null, $query = null, $headers = null, $retryOnLimit = null)

@thinkingserious thinkingserious changed the title feat/fix: Composer configuration, typos and type hints fix: Composer configuration, typos and type hints Jun 15, 2020
@thinkingserious thinkingserious merged commit de45a4e into sendgrid:master Jun 15, 2020
@childish-sambino childish-sambino removed the status: waiting for feedback waiting for feedback from the submitter label Jun 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: community enhancement feature request not on Twilio's roadmap
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants