_usedProperties['interval'] = true; $this->interval = $value; return $this; } /** * Amount of tokens to add each interval. * @default 1 * @param ParamConfigurator|int $value * @return $this */ public function amount($value): static { $this->_usedProperties['amount'] = true; $this->amount = $value; return $this; } public function __construct(array $value = []) { if (array_key_exists('interval', $value)) { $this->_usedProperties['interval'] = true; $this->interval = $value['interval']; unset($value['interval']); } if (array_key_exists('amount', $value)) { $this->_usedProperties['amount'] = true; $this->amount = $value['amount']; unset($value['amount']); } 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['interval'])) { $output['interval'] = $this->interval; } if (isset($this->_usedProperties['amount'])) { $output['amount'] = $this->amount; } return $output; } }