invalidType() public static method

public static invalidType ( string $type, array $allowed ) : InvalidTypeException
$type string
$allowed array
return InvalidTypeException
Exemplo n.º 1
0
 /**
  * Type constructor.
  *
  * @param string $type
  *
  * @throws InvalidTypeException
  */
 public function __construct(string $type)
 {
     if (!in_array($type, $this->allowed, true)) {
         throw InvalidTypeException::invalidType($type, $this->allowed);
     }
     $this->type = $type;
 }