Conditions | 3 |
Paths | 3 |
Total Lines | 28 |
Code Lines | 16 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
22 | public function testGetWorkSpace(){ |
||
23 | |||
24 | $schema = __DIR__.'/../../../../api/schemas/workspace.json'; |
||
25 | |||
26 | |||
27 | $client = $this->createClient(); |
||
28 | |||
29 | $client = $this->logIn($client); |
||
30 | |||
31 | $crawler = $client->request('GET', '/api/v1/workspace/1'); |
||
|
|||
32 | |||
33 | $response = $client->getResponse(); |
||
34 | $data = $client->getResponse()->getContent(); |
||
35 | |||
36 | $validator = $this->askValidation($data,$schema); |
||
37 | |||
38 | if ($validator->isValid()) { |
||
39 | |||
40 | echo "The supplied JSON validates against the schema.\n"; |
||
41 | $this->assertTrue(true); |
||
42 | } else { |
||
43 | echo "JSON does not validate. Violations:\n"; |
||
44 | foreach ($validator->getErrors() as $error) { |
||
45 | echo "[{$error['property']}] {$error['message']}\n"; |
||
46 | } |
||
47 | $this->assertTrue(false); |
||
48 | } |
||
49 | } |
||
50 | } |
||
51 |
This check looks for variable assignements that are either overwritten by other assignments or where the variable is not used subsequently.
Both the
$myVar
assignment in line 1 and the$higher
assignment in line 2 are dead. The first because$myVar
is never used and the second because$higher
is always overwritten for every possible time line.