Conditions | 2 |
Paths | 2 |
Total Lines | 11 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Tests | 7 |
CRAP Score | 2 |
Changes | 1 | ||
Bugs | 0 | Features | 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 | $response |
||
17 | ); |
||
18 | } |
||
19 | 5 | return $matches[1]; |
|
20 | } |
||
21 | |||
34 |