public static function phpTypeHintingToPhpTypeDeclaration(string $phpTypeHint): string
  {
    $phpType = '';

    switch ($phpTypeHint)
    {
      case 'array':
      case 'array[]':
      case 'bool':
      case 'float':
      case 'int':
      case 'string':
      case 'void':
        $phpType = $phpTypeHint;
        break;

      default:
        $parts = explode('|', $phpTypeHint);
        $key   = array_search('null', $parts);
        if (count($parts)==2 && $key!==false)
        {
          unset($parts[$key]);

          $tmp = static::phpTypeHintingToPhpTypeDeclaration(implode('|', $parts));
          if ($tmp!=='')
          {
            $phpType = '?'.$tmp;
          }
        }
    }

    return $phpType;
  }
public static function phpTypeHintingToPhpTypeDeclaration(string $phpTypeHint): string
  {
    $phpType = '';

    switch ($phpTypeHint)
    {
      case 'array':
      case 'array[]':
      case 'bool':
      case 'float':
      case 'int':
      case 'string':
      case 'void':
        $phpType = $phpTypeHint;
        break;

      default:
        $parts = explode('|', $phpTypeHint);
        $key   = array_search('null', $parts);
        if (count($parts)==2 && $key!==false)
        {
          unset($parts[$key]);

          $tmp = static::phpTypeHintingToPhpTypeDeclaration(implode('|', $parts));
          if ($tmp!=='')
          {
            $phpType = '?'.$tmp;
          }
        }
    }

    return $phpType;
  }
public static function phpTypeHintingToPhpTypeDeclaration ( string $ phpTypeHint ) : string { $ phpType = '' ; switch ( $ phpTypeHint ) { case 'array' : case 'array[]' : case 'bool' : case 'float' : case 'int' : case 'string' : case 'void' : $ phpType = $ phpTypeHint ; break ; default : $ parts = explode ( '|' , $ phpTypeHint ) ; $ key = array_search ( 'null' , $ parts ) ; if ( count ( $ parts ) == 2 && $ key !== false ) { unset ( $ parts [ $ key ] ) ; $ tmp = static :: phpTypeHintingToPhpTypeDeclaration ( implode ( '|' , $ parts ) ) ; if ( $ tmp !== '' ) { $ phpType = '?' . $ tmp ; } } } return $ phpType ; }
Returns the corresponding PHP type declaration of a MySQL column type.

@param string $phpTypeHint The PHP type hinting.

@return string
Returns the corresponding PHP type declaration of a MySQL column type .