/** * {@inheritdoc} */ public function toArray() : array { $ret = parent::toArray(); if ($this->type !== ValidatorOptions::DEFAULT_FIELD_TYPE) { $ret["parameter"] = ["type" => $this->type, "name" => $this->fieldName]; } else { $ret[$this->type] = $this->fieldName; } return $ret; }