Conditions | 2 |
Paths | 2 |
Total Lines | 12 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Tests | 7 |
CRAP Score | 2 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
10 | 2 | public static function parseAuthenticityToken(Response $response, $ch) { |
|
11 | 2 | static $pattern = '@<input name="authenticity_token" type="hidden" value="([^"]++)">@'; |
|
12 | 2 | if (!preg_match($pattern, $response->getRawContent(), $matches)) { |
|
13 | 1 | throw new HttpException( |
|
14 | 1 | 'Failed to get authenticity_token.', |
|
15 | 1 | -1, |
|
16 | $ch, |
||
17 | $response |
||
18 | ); |
||
19 | } |
||
20 | 1 | return $matches[1]; |
|
21 | } |
||
22 | |||
36 |