Conditions | 1 |
Paths | 1 |
Total Lines | 24 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
28 | public function indexAction() |
||
29 | { |
||
30 | error_reporting(E_ALL); |
||
31 | ini_set('display_errors', 'on'); |
||
32 | |||
33 | $xmlContent = file_get_contents(__DIR__ . '/../../../../../../tests/fixtures/ImportLogs/geocaching.gpx'); |
||
34 | $xmlContent = str_replace( |
||
35 | ['<groundspeak:', '</groundspeak:'], |
||
36 | ['<', '</'], |
||
37 | $xmlContent |
||
38 | ); |
||
39 | $xml = new \SimpleXMLElement($xmlContent); |
||
40 | $xmlArray = json_decode(json_encode($xml), true); |
||
|
|||
41 | |||
42 | $response = new Response(); |
||
43 | $response->setContent( |
||
44 | $this->twig->render( |
||
45 | 'importer/logs.html.twig', |
||
46 | ['imports' => $xml] |
||
47 | ) |
||
48 | ); |
||
49 | |||
50 | return $response; |
||
51 | } |
||
52 | } |
||
53 |
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.