public function validateTransactions($object, array $xactions) { $errors = array(); if ($this->isEmptyTextTransaction($object->getName(), $xactions)) { $errors[] = $this->newRequiredError(pht('Versions must have a name.')); return $errors; } foreach ($xactions as $xaction) { $value = $xaction->getNewValue(); try { PhabricatorPackagesVersion::assertValidVersionName($value); } catch (Exception $ex) { $errors[] = $this->newInvalidError($ex->getMessage(), $xaction); } } if (!$this->isNewObject()) { foreach ($xactions as $xaction) { $errors[] = $this->newInvalidError(pht('Once a version is created, its name can not be changed.'), $xaction); } } return $errors; }