src/ReflectionType.php
public static function convertToDisplayType(\ReflectionType $type)
    {
        static $typeMap = [
            'int'  => 'integer',
            'bool' => 'boolean'
        ];
        $displayType = (string)$type;
        if (isset($typeMap[$displayType])) {
            $displayType = $typeMap[$displayType];
        }

        $displayType = ltrim($displayType, '\\');

        if ($type->allowsNull()) {
            $displayType .= ' or NULL';
        }

        return $displayType;
    }
public static function convertToDisplayType(\ReflectionType $type)
    {
        static $typeMap = [
            'int'  => 'integer',
            'bool' => 'boolean'
        ];
        $displayType = (string)$type;
        if (isset($typeMap[$displayType])) {
            $displayType = $typeMap[$displayType];
        }

        $displayType = ltrim($displayType, '\\');

        if ($type->allowsNull()) {
            $displayType .= ' or NULL';
        }

        return $displayType;
    }
public static function convertToDisplayType ( \ ReflectionType $ type ) { static $ typeMap = [ 'int' => 'integer' , 'bool' => 'boolean' ] ; $ displayType = ( string ) $ type ; if ( isset ( $ typeMap [ $ displayType ] ) ) { $ displayType = $ typeMap [ $ displayType ] ; } $ displayType = ltrim ( $ displayType , '\\' ) ; if ( $ type -> allowsNull ( ) ) { $ displayType .= ' or NULL' ; } return $ displayType ; }
PHP reflection has it's own rules, so 'int' type will be displayed as 'integer', etc...

@see https://3v4l.org/nZFiT

@param ReflectionType $type Type to display

@return string
PHP reflection has it s own rules so int type will be displayed as integer etc ...