Conditions | 3 |
Paths | 3 |
Total Lines | 22 |
Code Lines | 16 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
12 | public function testGetWorkSpace(){ |
||
13 | $schema = __DIR__.'/../../../../api/schemas/workspace.json'; |
||
14 | |||
15 | $client = $this->createClient(); |
||
16 | $client = $this->logIn($client); |
||
17 | |||
18 | $crawler = $client->request('GET', '/api/v1/workspace/1'); |
||
|
|||
19 | $response = $client->getResponse(); |
||
20 | $data = $client->getResponse()->getContent(); |
||
21 | $validator = $this->askValidation($data,$schema); |
||
22 | |||
23 | if ($validator->isValid()) { |
||
24 | echo "The supplied JSON validates against the schema.\n"; |
||
25 | $this->assertTrue(true); |
||
26 | } else { |
||
27 | echo "JSON does not validate. Violations:\n"; |
||
28 | foreach ($validator->getErrors() as $error) { |
||
29 | echo "[{$error['property']}] {$error['message']}\n"; |
||
30 | } |
||
31 | $this->assertTrue(false); |
||
32 | } |
||
33 | } |
||
34 | } |
||
35 |
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.