/** * Release the locks when this goes out of scope */ function __destruct() { $wasOk = $this->status->isOK(); $this->status->merge($this->manager->unlockByType($this->pathsByType)); if ($wasOk) { // Make sure StatusValue is OK, despite any unlockFiles() fatals $this->status->setResult(true, $this->status->value); } }
/** * Change operation result * * @param bool $ok Whether the operation completed * @param mixed $value */ public function setResult($ok, $value = null) { $this->sv->setResult($ok, $value); }