GetOptionKit\Option::getTypeClass PHP Method

getTypeClass() public method

public getTypeClass ( )
    public function getTypeClass()
    {
        $class = 'GetOptionKit\\ValueType\\' . ucfirst($this->isa) . 'Type';
        if (class_exists($class, true)) {
            return new $class($this->isaOption);
        }
        throw new Exception("Type class '{$class}' not found.");
    }

Usage Example

Example #1
0
 /**
  * @expectedException Exception
  */
 public function testInvalidTypeClass()
 {
     $opt = new Option('scope');
     $opt->isa('SomethingElse');
     $class = $opt->getTypeClass();
 }