1 | <?php |
||
21 | class Readme extends \hidev\base\Component |
||
22 | { |
||
23 | /** |
||
24 | * @var \Twig_Environment |
||
25 | */ |
||
26 | protected $_twig; |
||
27 | |||
28 | /** |
||
29 | * @var array list of sections to render |
||
30 | */ |
||
31 | protected $_sections; |
||
32 | |||
33 | public $knownBadges = []; |
||
34 | |||
35 | public $badges; |
||
36 | |||
37 | public function save($path, $type) |
||
41 | |||
42 | public function getTemplate($type) |
||
46 | |||
47 | /** |
||
48 | * Get charset. |
||
49 | * @return string |
||
50 | */ |
||
51 | public function getCharset() |
||
55 | |||
56 | 2 | public function renderH($title, $prefix) |
|
60 | |||
61 | 1 | public function renderH1($title) |
|
65 | |||
66 | 1 | public function renderH2($title) |
|
70 | |||
71 | public function renderH3($title) |
||
75 | |||
76 | public function renderText($text) |
||
82 | |||
83 | public function renderBold($text) |
||
89 | |||
90 | public function renderSection($section, $default = null) |
||
99 | |||
100 | public function getSection($file, $default = null) |
||
111 | |||
112 | /** |
||
113 | * Set sections list. |
||
114 | * @param array $value |
||
115 | */ |
||
116 | public function setSections($value) |
||
120 | |||
121 | /** |
||
122 | * Returns sections list. Returns default list if not set. |
||
123 | * @return array |
||
124 | */ |
||
125 | public function getSections() |
||
133 | |||
134 | /** |
||
135 | * Render all configured sections. |
||
136 | * @return string |
||
137 | */ |
||
138 | public function renderSections($sections = null) |
||
150 | |||
151 | /** |
||
152 | * Render all configured badges. |
||
153 | * @return string |
||
154 | */ |
||
155 | public function renderBadges() |
||
175 | |||
176 | /** |
||
177 | * Render badge by given template. |
||
178 | * @param string $template string to render |
||
179 | * @return string |
||
180 | */ |
||
181 | public function renderBadge($template) |
||
187 | |||
188 | /** |
||
189 | * Twig getter. |
||
190 | * @return \Twig_Environment |
||
191 | */ |
||
192 | public function getTwig() |
||
200 | } |
||
201 |
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.