Lines Matching refs:key
182 public function setOption(string $key, $value): self
184 $this->validateOption($key);
186 $this->_options[$key] = $value;
195 foreach ($options as $key => $value) {
196 $this->setOption($key, $value);
212 public function addOption(string $key, $value): self
214 $this->validateOption($key);
216 $this->_options[$key][] = $value;
221 public function hasOption(string $key): bool
223 return isset($this->_options[$key]);
227 * @throws InvalidException if the given key does not exists as an option
231 public function getOption(string $key)
233 if (!$this->hasOption($key)) {
234 throw new InvalidException('Option '.$key.' does not exist');
237 return $this->_options[$key];
401 \trigger_deprecation('ruflin/elastica', '7.1.3', 'Passing an int as 1st argument to "%s()" is deprecated, pass an array with the key "size" instead. It will be removed in 8.0.', __METHOD__);
439 * @throws InvalidException If the given key is not a valid option
441 protected function validateOption(string $key): void
443 switch ($key) {
463 throw new InvalidException('Invalid option '.$key);