Conditions | 5 |
Paths | 5 |
Total Lines | 17 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Tests | 8 |
CRAP Score | 5.2 |
Changes | 0 |
1 | <?php |
||
60 | 21 | private function shouldRetry(Result $result) |
|
61 | { |
||
62 | 21 | if ($this->retry <= 0) { |
|
63 | 21 | return false; |
|
64 | } |
||
65 | |||
66 | 2 | if (in_array($result->getResponse()->getStatusCode(), $this->retryStatusCodes)) { |
|
67 | 1 | return true; |
|
68 | } |
||
69 | |||
70 | 1 | foreach ($this->retryStrings as $message) { |
|
71 | 1 | if (Stringy::create($result->getResponse()->getBody())->contains($message)) { |
|
72 | 1 | return true; |
|
73 | } |
||
74 | } |
||
75 | |||
76 | return false; |
||
77 | } |
||
79 |
This check looks for assignments to scalar types that may be of the wrong type.
To ensure the code behaves as expected, it may be a good idea to add an explicit type cast.