plivo-php icon indicating copy to clipboard operation
plivo-php copied to clipboard

attempt at fix for invalid index "invalid_number" warning on send sms…

Open RickKukiela opened this issue 5 years ago • 0 comments

The assumption that the "invalid_number" index of the $responseContent array throws a warning. If you are running this code inside of a try, catch block that catches either \Exception or \Throwable, the warning breaks the code execution and yields to the catch block.

I changed the reference to this array key to be ternary so that if the index is not set, null is passed instead of attempting to pass a non-existent index.

I also updated the class construct signature so that $invalid_number may be omitted altogether but it appears that was unnecessary so you can skip that bit if you want.

RickKukiela avatar Sep 27 '19 16:09 RickKukiela