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

numbers/search-available.php throws an error on the "pattern" option #52

Open
dragonmantank opened this issue Sep 8, 2020 · 1 comment

Comments

@dragonmantank
Copy link
Contributor

When running numbers/search-available.php, it throws the following error:

PHP Fatal error:  Uncaught TypeError: Argument 1 passed to Vonage\Numbers\Filter\AvailableNumbers::setPattern() must be of the type string, int given

The setPattern() method was changed to take a string but the snippet was never updated.

@tryonlinux
Copy link

I would like to take a stab at this if you don't mind? Am I understanding correctly that the code snippet search-available.php needs updated to string like so?

/** @var IterableAPICollection $response */
$filter = new AvailableNumbers([
"pattern" => (string) NUMBER_SEARCH_CRITERIA,
"search_pattern" => (int) NUMBER_SEARCH_PATTERN,
"type" => VONAGE_NUMBER_TYPE,
"features" => VONAGE_NUMBER_FEATURES,
]);

gthoffer added a commit to gthoffer/vonage-php-code-snippets that referenced this issue Oct 2, 2020
…ent to caution use of criteria starting with '0' to avoid conversion-to-octal issues. Added some more comments while I was at it to help users understand the use of the filter object
gthoffer added a commit to gthoffer/vonage-php-code-snippets that referenced this issue Oct 2, 2020
…ent to caution use of criteria starting with '0' to avoid conversion-to-octal issues. Added some more comments while I was at it to help users understand the use of the filter object
gthoffer added a commit to gthoffer/vonage-php-code-snippets that referenced this issue Oct 5, 2020
* Fix issue Vonage#51: add environment variable placeholders for FROM_NUMBER and VONAGE_API_SIGNATURE_SECRET so things work when running sms/send-signed-sms.php

* Fix Vonage#52 - cast 'NUMBER_SEARCH_CRITERIA' as (string).  Added comment to caution use of criteria starting with '0' to avoid conversion-to-octal issues.  Added some more comments while I was at it to help users understand the use of the filter object
dragonmantank added a commit that referenced this issue Dec 14, 2020
`numbers/search-available.php` throws an error on the "pattern" option #52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants