Vonage / vonage-php-sdk-core

Vonage REST API client for PHP. API support for SMS, Voice, Text-to-Speech, Numbers, Verify (2FA) and more.
https://developer.vonage.com/
Apache License 2.0
908 stars 181 forks source link

Add null check for appId getter on Number model #443

Closed erickskrauch closed 10 months ago

erickskrauch commented 10 months ago

Description

When the number isn't linked to the application, there are no fields voiceCallbackValue and messagesCallbackValue, so calling Number::getAppId() produces an error on access to not existing array key.

Motivation and Context

I need this functionality so I fix it.

How Has This Been Tested?

I tried it with my codebase.

Types of changes

Checklist:

codecov-commenter commented 10 months ago

Codecov Report

Merging #443 (5f63467) into main (9ebd564) will increase coverage by 0.04%. Report is 1 commits behind head on main. The diff coverage is 89.47%.

@@             Coverage Diff              @@
##               main     #443      +/-   ##
============================================
+ Coverage     78.87%   78.92%   +0.04%     
  Complexity     2324     2324              
============================================
  Files           218      218              
  Lines          6253     6248       -5     
============================================
- Hits           4932     4931       -1     
+ Misses         1321     1317       -4     
Files Coverage Δ
src/Client/Credentials/Keypair.php 91.17% <94.44%> (+9.12%) :arrow_up:
src/Numbers/Number.php 70.00% <0.00%> (ø)

:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more

SecondeJK commented 10 months ago

LGTM, thank you for your contribution!