verbose = $verbose; } public function setVerbose(bool $verbose) { $this->verbose = $verbose; } public function append(string $message) { array_push($this->log, $message); if ($this->verbose) { fwrite(STDOUT, $message . "\n"); } } public function flush() { if ($this->verbose) return; fwrite(STDOUT, join("\n", $this->log)."\n"); } public function asString(): string { return join("\n", $this->log); } }