Conditions | 2 |
Paths | 2 |
Total Lines | 8 |
Code Lines | 4 |
Lines | 8 |
Ratio | 100 % |
Tests | 3 |
CRAP Score | 2.0625 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
29 | 1 | public function createClient(array $config = []) |
|
30 | { |
||
31 | 1 | if (!class_exists('Http\Client\Socket\Client')) { |
|
32 | throw new \LogicException('To use the Socket client you need to install the "php-http/socket-client" package.'); |
||
33 | } |
||
34 | |||
35 | 1 | return new Client($this->messageFactory, $config); |
|
36 | } |
||
37 | } |
||
38 |
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.