Skip to content

Commit

Permalink
Add array_get function to TwilioValues
Browse files Browse the repository at this point in the history
  • Loading branch information
codejudas committed Mar 2, 2017
1 parent 9e2d71e commit 9513d95
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion Twilio/Values.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,13 @@ class Values implements \ArrayAccess {

protected $options;

public static function array_get($array, $key, $default = null) {
if (array_key_exists($key, $array)) {
return $array[$key];
}
return $default;
}

public static function of($array) {
$result = array();
foreach ($array as $key => $value) {
Expand Down Expand Up @@ -87,4 +94,4 @@ public function offsetUnset($offset) {
}


}
}

0 comments on commit 9513d95

Please sign in to comment.