Conditions | 4 |
Paths | 4 |
Total Lines | 16 |
Code Lines | 10 |
Lines | 5 |
Ratio | 31.25 % |
Changes | 0 |
1 | <?php |
||
39 | public function __construct(TransportInterface $transport, $host, $scheme = 'https') |
||
40 | { |
||
41 | View Code Duplication | if (!is_string($host)) { |
|
|
|||
42 | throw new \InvalidArgumentException('Host must be string'); |
||
43 | } elseif (empty($host)) { |
||
44 | throw new \InvalidArgumentException('Host must be not empty'); |
||
45 | } |
||
46 | |||
47 | if (!is_string($scheme)) { |
||
48 | throw new \InvalidArgumentException('Scheme must be string'); |
||
49 | } |
||
50 | |||
51 | $this->transport = $transport; |
||
52 | $this->host = $host; |
||
53 | $this->scheme = $scheme; |
||
54 | } |
||
55 | |||
68 |
Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.
You can also find more detailed suggestions in the “Code” section of your repository.