Conditions | 2 |
Paths | 1 |
Total Lines | 11 |
Code Lines | 8 |
Lines | 11 |
Ratio | 100 % |
1 | <?php |
||
12 | View Code Duplication | public function testConnectionException() |
|
|
|||
13 | { |
||
14 | try { |
||
15 | throw new ConnectionException($this->client, 'Could not connect'); |
||
16 | } catch (ConnectionException $e) { |
||
17 | $client = $e->getInstance(); |
||
18 | $this->assertTrue($client instanceof Client); |
||
19 | $this->assertEquals('Could not connect', $e->getMessage()); |
||
20 | return; |
||
21 | } |
||
22 | } |
||
23 | |||
37 |
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.