| Conditions | 5 |
| Paths | 5 |
| Total Lines | 18 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 24 | public function read($sConfigFile) |
||
| 25 | { |
||
| 26 | $sExt = pathinfo($sConfigFile, PATHINFO_EXTENSION); |
||
| 27 | switch($sExt) |
||
| 28 | { |
||
| 29 | case 'php': |
||
| 30 | $aConfigOptions = Php::read($sConfigFile); |
||
|
|
|||
| 31 | case 'yaml': |
||
| 32 | case 'yml': |
||
| 33 | $aConfigOptions = Yaml::read($sConfigFile); |
||
| 34 | case 'json': |
||
| 35 | $aConfigOptions = Json::read($sConfigFile); |
||
| 36 | default: |
||
| 37 | $sErrorMsg = jaxon_trans('config.errors.file.extension', array('path' => $sConfigFile)); |
||
| 38 | throw new \Jaxon\Config\Exception\File($sErrorMsg); |
||
| 39 | } |
||
| 40 | return $aConfigOptions; |
||
| 41 | } |
||
| 42 | } |
||
| 43 |
This check looks for variable assignements that are either overwritten by other assignments or where the variable is not used subsequently.
Both the
$myVarassignment in line 1 and the$higherassignment in line 2 are dead. The first because$myVaris never used and the second because$higheris always overwritten for every possible time line.