WriteGuard
Filesystem safety for generators: refuses to clobber an existing file unless `--force`, and creates parent directories on write. `assertWritable()` is called for every planned file up front so a blocked target aborts the whole `coa:make` run before anything is written.
WriteGuard::assertWritable()
public function assertWritable(string $path, bool $force): voidThrows unless `$path` is free to write: absent, or `$force` is true.
Parameters
| Name | Type | Description |
|---|---|---|
| $path | string | |
| $force | bool |
WriteGuard::write()
public function write(string $path, string $contents): voidWrites `$contents` to `$path`, creating parent directories as needed.
Parameters
| Name | Type | Description |
|---|---|---|
| $path | string | |
| $contents | string |