Conditions | 3 |
Paths | 4 |
Total Lines | 19 |
Code Lines | 11 |
Lines | 0 |
Ratio | 0 % |
Tests | 8 |
CRAP Score | 3 |
Changes | 0 |
1 | <?php |
||
23 | 1 | public static function createRequest(string $token, |
|
24 | array $httpDefaults = array(), |
||
25 | LoggerInterface $logger = null, |
||
26 | string $format = null) : Request |
||
27 | { |
||
28 | 1 | $request = new Request($token, $httpDefaults); |
|
29 | |||
30 | 1 | if ($logger instanceof LoggerInterface) { |
|
31 | 1 | $request->setLogger($logger); |
|
32 | } |
||
33 | |||
34 | 1 | if ($format !== null) { |
|
35 | 1 | $request->setMessageFormatter( |
|
36 | 1 | new MessageFormatter($format) |
|
37 | ); |
||
38 | } |
||
39 | |||
40 | 1 | return $request; |
|
41 | } |
||
42 | } |
||
43 |