src/CodeGeneration/TypeHelper.php
public function normaliseValueToType($value, string $expectedType)
    {
        if (null === $value) {
            return null;
        }
        switch ($expectedType) {
            case 'string':
                return $this->normaliseString($value);
            case 'bool':
                return $this->normaliseBool($value);
            case 'int':
                return $this->normaliseInt($value);
            case 'float':
                return $this->normaliseFloat($value);
            case MappingHelper::PHP_TYPE_DATETIME:
                return $this->normaliseDateTime($value);
            default:
                throw new \RuntimeException('hit unexpected type ' . $expectedType . ' in ' . __METHOD__);
        }
    }
public function normaliseValueToType($value, string $expectedType)
    {
        if (null === $value) {
            return null;
        }
        switch ($expectedType) {
            case 'string':
                return $this->normaliseString($value);
            case 'bool':
                return $this->normaliseBool($value);
            case 'int':
                return $this->normaliseInt($value);
            case 'float':
                return $this->normaliseFloat($value);
            case MappingHelper::PHP_TYPE_DATETIME:
                return $this->normaliseDateTime($value);
            default:
                throw new \RuntimeException('hit unexpected type ' . $expectedType . ' in ' . __METHOD__);
        }
    }
public function normaliseValueToType ( $ value , string $ expectedType ) { if ( null === $ value ) { return null ; } switch ( $ expectedType ) { case 'string' : return $ this -> normaliseString ( $ value ) ; case 'bool' : return $ this -> normaliseBool ( $ value ) ; case 'int' : return $ this -> normaliseInt ( $ value ) ; case 'float' : return $ this -> normaliseFloat ( $ value ) ; case MappingHelper :: PHP_TYPE_DATETIME : return $ this -> normaliseDateTime ( $ value ) ; default : throw new \ RuntimeException ( 'hit unexpected type ' . $ expectedType . ' in ' . __METHOD__ ) ; } }
When a default is passed in via CLI then the type can not be expected to be set correctly

This function takes the string value and normalises it into the correct value based on the expected type

@param mixed  $value
@param string $expectedType

@return mixed
When a default is passed in via CLI then the type can not be expected to be set correctly