name = $name['name'] ?? null; $this->options = $name['options'] ?? $options; $this->breakChainOnFailure = $name['break_chain_on_failure'] ?? $breakChainOnFailure; $this->priority = $name['priority'] ?? $priority; } else { $this->name = $name; $this->options = $options; $this->breakChainOnFailure = $breakChainOnFailure; $this->priority = $priority; } } /** * Retrieve the validator specification * * @return array */ public function getValidatorSpecification(): array { $inputSpec = ['name' => $this->name]; if (! empty($this->options)) { $inputSpec['options'] = $this->options; } if (null !== $this->breakChainOnFailure) { $inputSpec['break_chain_on_failure'] = $this->breakChainOnFailure; } if (null !== $this->priority) { $inputSpec['priority'] = $this->priority; } return $inputSpec; } }