Changeset View
Changeset View
Standalone View
Standalone View
src/applications/diviner/atom/DivinerAtomRef.php
Show All 37 Lines | final class DivinerAtomRef { | ||||
} | } | ||||
public function getSummary() { | public function getSummary() { | ||||
return $this->summary; | return $this->summary; | ||||
} | } | ||||
public function setName($name) { | public function setName($name) { | ||||
$normal_name = self::normalizeString($name); | $normal_name = self::normalizeString($name); | ||||
if (preg_match('/^@[0-9]+$/', $normal_name)) { | if (preg_match('/^@[0-9]+\z/', $normal_name)) { | ||||
throw new Exception( | throw new Exception( | ||||
"Atom names must not be in the form '/@\d+/'. This pattern is ". | "Atom names must not be in the form '/@\d+/'. This pattern is ". | ||||
"reserved for disambiguating atoms with similar names."); | "reserved for disambiguating atoms with similar names."); | ||||
} | } | ||||
$this->name = $normal_name; | $this->name = $normal_name; | ||||
return $this; | return $this; | ||||
} | } | ||||
▲ Show 20 Lines • Show All 156 Lines • Show Last 20 Lines |