Conditions | 4 |
Paths | 3 |
Total Lines | 18 |
Code Lines | 10 |
Lines | 0 |
Ratio | 0 % |
Tests | 12 |
CRAP Score | 4 |
Changes | 0 |
1 | <?php namespace Stevenmaguire\OAuth2\Client\Provider; |
||
82 | 2 | protected function getResponseData($path, $default = null) |
|
83 | { |
||
84 | 2 | $array = $this->response; |
|
85 | |||
86 | 2 | if (!empty($path)) { |
|
87 | 2 | $keys = explode('.', $path); |
|
88 | |||
89 | 2 | foreach ($keys as $key) { |
|
90 | 2 | if (isset($array[$key])) { |
|
91 | 2 | $array = $array[$key]; |
|
92 | 1 | } else { |
|
93 | 2 | return $default; |
|
94 | } |
||
95 | 1 | } |
|
96 | 1 | } |
|
97 | |||
98 | 2 | return $array; |
|
99 | } |
||
100 | |||
111 |