| Conditions | 2 |
| Paths | 2 |
| Total Lines | 19 |
| Code Lines | 11 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 45 | public static function toJs(string $sFile) : string |
||
| 46 | { |
||
| 47 | $aFile = pathinfo($sFile); |
||
| 48 | $sFolder = uniqid(); |
||
| 49 | |||
| 50 | if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') { |
||
| 51 | |||
| 52 | $sCmd = self::TYPESCRIPT_WINDOWS." ".$sFile." --outDir ".__DIR__.'../../'.CACHE_DIR.$sFolder.'/'; |
||
| 53 | $sContent = shell_exec($sCmd); |
||
|
|
|||
| 54 | } |
||
| 55 | else { |
||
| 56 | |||
| 57 | $sCmd = "tsc ".$sFile." --outDir ".__DIR__.'../../'.CACHE_DIR.$sFolder.'/'; |
||
| 58 | $sContent = shell_exec($sCmd); |
||
| 59 | } |
||
| 60 | |||
| 61 | header("content-type:text/javascript"); |
||
| 62 | return file_get_contents(__DIR__.'../../'.CACHE_DIR.$sFolder.'/'.$aFile['filename'].'.js'); |
||
| 63 | } |
||
| 64 | } |
||
| 65 |
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.