createFromType() public static method

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;
 }
Exemplo n.º 2
0
 public function testCreateFromTypeNull()
 {
     $this->assertNull(Option::createFromType('fail'));
 }