Conditions | 1 |
Paths | 1 |
Total Lines | 22 |
Code Lines | 15 |
Lines | 0 |
Ratio | 0 % |
Tests | 5 |
CRAP Score | 1 |
Changes | 0 |
1 | <?php |
||
51 | 2 | public static function createFromReactHttpClient( |
|
52 | HttpClient $httpClient, |
||
53 | Resolver $resolver, |
||
54 | LoopInterface $loop = null, |
||
55 | array $options = [] |
||
56 | ): Client { |
||
57 | 2 | return new Client( |
|
58 | $loop, |
||
|
|||
59 | 2 | new GuzzleClient( |
|
60 | [ |
||
61 | 2 | 'handler' => HandlerStack::create( |
|
62 | 2 | new HttpClientAdapter( |
|
63 | $loop, |
||
64 | $httpClient, |
||
65 | $resolver |
||
66 | ) |
||
67 | ), |
||
68 | ] |
||
69 | ), |
||
70 | $options |
||
71 | ); |
||
72 | } |
||
73 | } |
||
74 |
It seems like you allow that null is being passed for a parameter, however the function which is called does not seem to accept null.
We recommend to add an additional type check (or disallow null for the parameter):