| Conditions | 2 |
| Paths | 2 |
| Total Lines | 10 |
| Code Lines | 6 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 8 |
| CRAP Score | 2 |
| Changes | 0 | ||
| 1 | <?php |
||
| 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 | } |
||
| 34 |