plivo-php
plivo-php copied to clipboard
attempt at fix for invalid index "invalid_number" warning on send sms…
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.