public static function getNumerator($name) { $template = NumeratorTemplate::findByName($name); if (!isset($template)) { throw new InvalidArgumentException("Invalid numerator name - \"{$name}\""); } $masker = new NumeratorMasker(['mask' => $template->mask]); return new self(compact('template', 'masker')); }