public static createFromType ( $type, array $settings = [] ) | ||
$settings | array |
/** * Set password generator option. * * @param string $option * @param array $optionSettings * * @return $this * @throws InvalidOptionTypeException */ public function setOption($option, $optionSettings) { $type = isset($optionSettings['type']) ? $optionSettings['type'] : ''; $this->options[$option] = Option::createFromType($type, $optionSettings); if ($this->options[$option] === null) { throw new InvalidOptionTypeException('Invalid Option Type'); } return $this; }
public function testCreateFromTypeNull() { $this->assertNull(Option::createFromType('fail')); }