| Conditions | 4 |
| Paths | 3 |
| Total Lines | 16 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 20 |
| Changes | 0 | ||
| 1 | <?php declare(strict_types=1); |
||
| 25 | public function __construct(string $host, int $port, string $routerPath, string $docRoot) |
||
| 26 | { |
||
| 27 | if (!is_readable($routerPath)) { |
||
| 28 | throw new InvalidArgumentException("Router script '$routerPath' must be readable."); |
||
| 29 | } |
||
| 30 | |||
| 31 | if (!is_readable($docRoot) || !is_dir($docRoot)) { |
||
| 32 | throw new InvalidArgumentException("Document root '$docRoot' must be a readable directory."); |
||
| 33 | } |
||
| 34 | |||
| 35 | $this->host = $host; |
||
| 36 | $this->port = $port; |
||
| 37 | $this->routerPath = $routerPath; |
||
| 38 | $this->docRoot = $docRoot; |
||
| 39 | $this->logger = new NullLogger(); |
||
| 40 | } |
||
| 41 | |||
| 57 |