Airship\Engine\Security\Filter\InputFilter::setType PHP Method

setType() public method

Sets the expected input type (e.g. string, boolean)
public setType ( string $typeIndicator ) : Airship\Engine\Contract\Security\FilterInterface
$typeIndicator string
return Airship\Engine\Contract\Security\FilterInterface
    public function setType(string $typeIndicator) : FilterInterface
    {
        $this->type = $typeIndicator;
        return $this;
    }

Usage Example

Example #1
0
 /**
  * Sets the expected input type (e.g. string, boolean)
  *
  * @param string $typeIndicator
  * @return FilterInterface
  * @throws UnsupportedOperation
  */
 public function setType(string $typeIndicator) : FilterInterface
 {
     if ($typeIndicator !== 'bool') {
         throw new UnsupportedOperation('Type must always be set to "bool".');
     }
     return parent::setType('bool');
 }