| Conditions | 2 |
| Paths | 2 |
| Total Lines | 34 |
| Code Lines | 26 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 20 |
| CRAP Score | 2 |
| Changes | 0 | ||
| 1 | <?php |
||
| 31 | 16 | public static function make( |
|
| 32 | string $transport, |
||
| 33 | array $server, |
||
| 34 | Protocol $protocol, |
||
| 35 | int $timeout, |
||
| 36 | TimeContinuumInterface $clock |
||
| 37 | ): Lazy { |
||
| 38 | 16 | $transport = Transport::$transport(); |
|
| 39 | |||
| 40 | 16 | foreach ($server['transport']['options'] as $key => $value) { |
|
| 41 | 2 | $transport = $transport->withOption($key, $value); |
|
| 42 | } |
||
| 43 | |||
| 44 | 16 | return new Lazy( |
|
| 45 | 16 | $transport, |
|
| 46 | 16 | new Url( |
|
| 47 | 16 | new NullScheme, |
|
| 48 | 16 | new Authority( |
|
| 49 | 16 | new UserInformation( |
|
| 50 | 16 | new User($server['user']), |
|
| 51 | 16 | new Password($server['password']) |
|
| 52 | ), |
||
| 53 | 16 | new Host($server['host']), |
|
| 54 | 16 | new Port($server['port']) |
|
| 55 | ), |
||
| 56 | 16 | new Path($server['vhost']), |
|
| 57 | 16 | new NullQuery, |
|
| 58 | 16 | new NullFragment |
|
| 59 | ), |
||
| 60 | 16 | $protocol, |
|
| 61 | 16 | new ElapsedPeriod($timeout), |
|
| 62 | 16 | $clock |
|
| 63 | ); |
||
| 64 | } |
||
| 65 | } |
||
| 66 |