| Conditions | 4 |
| Paths | 2 |
| Total Lines | 23 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 11 |
| CRAP Score | 4 |
| Changes | 0 | ||
| 1 | <?php |
||
| 51 | 1 | public function __construct($sDigestResponse, $sHTTPMethod = HttpRequestTypes::GET) { |
|
| 52 | $aNeededParts = array( |
||
| 53 | 1 | 'nonce' => 1, |
|
| 54 | 'nc' => 1, |
||
| 55 | 'cnonce' => 1, |
||
| 56 | 'qop' => 1, |
||
| 57 | 'username' => 1, |
||
| 58 | 'uri' => 1, |
||
| 59 | 'response' => 1 |
||
| 60 | ); |
||
| 61 | |||
| 62 | 1 | $keys = implode('|', array_keys($aNeededParts)); |
|
| 63 | 1 | $i = preg_match_all('@(' . $keys . ')=(?:([\'"])([^\2]+?)\2|([^\s,]+))@', $sDigestResponse, $aMatches, PREG_SET_ORDER); |
|
| 64 | |||
| 65 | 1 | if ($i) { |
|
| 66 | 1 | foreach ($aMatches as $m) { |
|
| 67 | 1 | $sProperty = $m[1]; |
|
| 68 | 1 | $this->$sProperty = $m[3] ? $m[3] : $m[4]; |
|
| 69 | 1 | unset($aNeededParts[$m[1]]); |
|
| 70 | } |
||
| 71 | } |
||
| 72 | 1 | $this->HTTPMethod = $sHTTPMethod; |
|
| 73 | 1 | } |
|
| 74 | |||
| 88 |