dto->pattern, $this->dto->subject, $this->dto->limit ?? -1, $this->flags); return new PregResponse( $ret, $this->syntax(), ...$this->result($ret) ); } protected function syntax(): string { $method = $this->dto->method->value; $args = [$method .'("'. $this->dto->pattern.'"']; $args[] = $this->cropString($this->dto->subject); if (!\is_null($this->dto->limit)) { $args[] = $this->dto->limit; } if (\count($this->flagsStr)) { $args[] = (\is_null($this->dto->limit)? 'null, ': ''). implode(' | ', $this->flagsStr); } $code = implode(", ", $args). ");"; return $this->syntaxCleanup($code); } }