register(); $this->rule = $this->getRules(); } abstract protected function getRules(): array ; private function register() { if (!empty($this->newValidates())) { foreach ($this->newValidates() as $validate) { $this->extend($validate->type(), [$validate, 'verify'], $validate->message()); } } } private function newValidates() { return [ ]; } }