Conditions | 7 |
Paths | 6 |
Total Lines | 36 |
Code Lines | 19 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 56 |
Changes | 0 |
1 | <?php |
||
45 | public function update(\SplSubject $response) |
||
46 | { |
||
47 | if (false === $this->options['enable']) { |
||
48 | return false; |
||
49 | } |
||
50 | |||
51 | // @codeCoverageIgnoreStart |
||
52 | if (!extension_loaded('tidy')) { |
||
53 | |||
54 | $logger = Service::get('logger') |
||
|
|||
55 | ->debug('Tidy: PHP extension not installed'); |
||
56 | |||
57 | return false; |
||
58 | } |
||
59 | // @codeCoverageIgnoreEnd |
||
60 | |||
61 | $format = $response->getFormat(); |
||
62 | |||
63 | switch ($format) { |
||
64 | |||
65 | case 'lst': |
||
66 | case 'html': |
||
67 | case 'xml': |
||
68 | |||
69 | $response->setOutput( |
||
70 | $this->tidy( |
||
71 | $response->getOutput(), |
||
72 | isset($this->options[$format]) |
||
73 | ? $this->options[$format] |
||
74 | : array() |
||
75 | ) |
||
76 | ); |
||
77 | |||
78 | default: |
||
79 | } |
||
80 | } |
||
81 | |||
99 |
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.