public static function getCode($file, $line) {
		if (empty($file)) {
			return '';
		}
		$rows = explode("\n", file_get_contents($file));
		$start = ($line - 6) > 0 ? ($line - 6) : 0;
		$end = ($line + 5) < count($rows) ? ($line + 5) : count($rows);
		$result = [];
		for ($i = $start; $i < $end; $i++) {
			if ($i == $line - 1) {
				$result[] = '<b>' . $rows[$i] . '</b>';
			} else {
				$result[] = $rows[$i];
			}
		}
		return implode("\n", $result);
	}
public static function getCode($file, $line) {
		if (empty($file)) {
			return '';
		}
		$rows = explode("\n", file_get_contents($file));
		$start = ($line - 6) > 0 ? ($line - 6) : 0;
		$end = ($line + 5) < count($rows) ? ($line + 5) : count($rows);
		$result = [];
		for ($i = $start; $i < $end; $i++) {
			if ($i == $line - 1) {
				$result[] = '<b>' . $rows[$i] . '</b>';
			} else {
				$result[] = $rows[$i];
			}
		}
		return implode("\n", $result);
	}
public static function getCode ( $ file , $ line ) { if ( empty ( $ file ) ) { return '' ; } $ rows = explode ( "\n" , file_get_contents ( $ file ) ) ; $ start = ( $ line - 6 ) > 0 ? ( $ line - 6 ) : 0 ; $ end = ( $ line + 5 ) < count ( $ rows ) ? ( $ line + 5 ) : count ( $ rows ) ; $ result = [ ] ; for ( $ i = $ start ; $ i < $ end ; $ i ++ ) { if ( $ i == $ line - 1 ) { $ result [ ] = '<b>' . $ rows [ $ i ] . '</b>' ; } else { $ result [ ] = $ rows [ $ i ] ; } } return implode ( "\n" , $ result ) ; }
Get code snippet

@param string $file
@param int $line
@return string
Get code snippet