public function setRethrow($rethrow) { if ($rethrow !== null) { $this->rethrow = (bool) $rethrow; } else { if (PHP_SAPI === 'cli') { $this->rethrow = true; } else { $this->rethrow = false; } } }