protected function _parseToken(array $token, $index)
{
$type = '';
switch ($token[0]) {
case T_INC:
$type = 'OperatorIncrement';
break;
case T_DEC:
$type = 'OperatorDecrement';
break;
case T_BOOLEAN_AND:
$type = 'BooleanAnd';
break;
case T_BOOLEAN_OR:
$type = 'BooleanOr';
break;
case T_STRING:
$type = $this->_parseTString($token);
break;
}
if (!empty($type)) {
$mutationClass = 'Mutagenesis\\Mutation\\' . $type;
if (!class_exists($mutationClass)) {
// todo: given we're autoloading, could we not just kick up an exception here?
require_once str_replace('\\', '/', ltrim($mutationClass, '\\')) . '.php';
}
$mutation = new $mutationClass($this->getFilename());
return $mutation;
}
return null;
}