| Total Complexity | 4 |
| Total Lines | 25 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 5 | class HistoryHandler |
||
| 6 | { |
||
| 7 | public function __construct( |
||
| 10 | } |
||
| 11 | |||
| 12 | /** |
||
| 13 | * Add a new line to the history. |
||
| 14 | */ |
||
| 15 | public function addEntry(string $command): void |
||
| 16 | { |
||
| 17 | file_put_contents($this->historyFilename, $command . "\n", FILE_APPEND); |
||
| 18 | } |
||
| 19 | |||
| 20 | /** |
||
| 21 | * Get the history entries as string[] |
||
| 22 | */ |
||
| 23 | public function getEntries(): array |
||
| 30 | } |
||
| 31 | } |
||
| 32 |