_usedProperties['name'] = true; $this->name = $value; return $this; } /** * @param ParamConfigurator|list $value * * @return $this */ public function metadata(ParamConfigurator|array $value): static { $this->_usedProperties['metadata'] = true; $this->metadata = $value; return $this; } public function __construct(array $value = []) { if (array_key_exists('name', $value)) { $this->_usedProperties['name'] = true; $this->name = $value['name']; unset($value['name']); } if (array_key_exists('metadata', $value)) { $this->_usedProperties['metadata'] = true; $this->metadata = $value['metadata']; unset($value['metadata']); } if ([] !== $value) { throw new InvalidConfigurationException(sprintf('The following keys are not supported by "%s": ', __CLASS__).implode(', ', array_keys($value))); } } public function toArray(): array { $output = []; if (isset($this->_usedProperties['name'])) { $output['name'] = $this->name; } if (isset($this->_usedProperties['metadata'])) { $output['metadata'] = $this->metadata; } return $output; } }