/** * @param string $pattern * * @throws \InvalidArgumentException */ public function setPattern($pattern) { $pattern = $this->validator->validate($pattern); $this->parts = $this->parsePattern($pattern); $this->pattern = $pattern; }