| Total Complexity | 4 |
| Total Lines | 24 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 0 | ||
| 1 | <?php |
||
| 8 | class TokenParser |
||
| 9 | { |
||
| 10 | 6 | public static function parseAuthenticityToken(ResponseInterface $response) { |
|
| 11 | 6 | static $pattern = '@<input name="authenticity_token" type="hidden" value="([^"]++)">@'; |
|
| 12 | 6 | if (!preg_match($pattern, $response->getRawContent(), $matches)) { |
|
| 13 | 1 | throw new HttpException( |
|
| 14 | 1 | 'Failed to get authenticity_token.', |
|
| 15 | 1 | -1, |
|
| 16 | 1 | $response |
|
| 17 | ); |
||
| 18 | } |
||
| 19 | 5 | return $matches[1]; |
|
| 20 | } |
||
| 21 | |||
| 22 | 6 | public static function parseVerifier(ResponseInterface $response) { |
|
| 32 | } |
||
| 33 | } |
||
| 34 |