Converts given string (i.e. snake_case) to PascalCase

@param string $name
@return string
432228
public static function PascalCase(string $name): string
    {
        // Return an empty String if input is an empty String
        if (empty($name)) {
            return "";
        }

        $words = preg_split("/[^a-zA-Z0-9]+/", strtolower($name), 0, PREG_SPLIT_NO_EMPTY);
        return implode("", array_map(function ($word) {
            return ucfirst($word);
        }, $words));
    }
705948
private function snakeCase($key)
    {
        if (! ctype_lower($key)) {
            $key = preg_replace('/\s+/u', '', $key);
            $key = mb_strtolower(preg_replace('/(.)(?=[A-Z])/u', '$1' . '_', $key), 'UTF-8');
        }

        return $key;
    }
957881
public static function normalizeSvgAttribute($name) {
        $name = strtolower($name);
        if (isset(static::$svgCaseSensitiveAttributeMap[$name])) {
            $name = static::$svgCaseSensitiveAttributeMap[$name];
        }

        return $name;
    }
310674
public function toPascalCase(string $string): string
    {
        $string = Transliterator::urlize((string)$string);
        $string = str_replace('-', '', ucwords($string, '-'));

        return $string;
    }
681495
public static function snakecaseToCamelcase(string $string, bool $lower = false): string
    {
        $words = explode('_', $string);

        array_walk($words, function (&$word, $index) {
            $word = ucfirst($word);
        });

        if ($lower) {
            return lcfirst(implode($words));
        }

        return implode($words);
    }
402688
public static function pascalCase(string $value): string
    {
        $value = ucwords(str_replace(['-', '_'], ' ', $value));
        return str_replace(' ', '', $value);
    }
1054312
function PascalCase()
    {
        $key = (string) $this;
        
        ## prefix and postfix __ remains; like: __this__
        
        $pos = 'prefix';
        $prefix = '';
        $posfix = '';
        for ($i = 0; $i <= strlen($key)-1; $i++) {
            if ($key[$i] == '_')
                $$pos.='_';
            else {
                $posfix = ''; // reset posix, _ may found within string
                $pos  = 'posfix';
            }
        }

        $r = str_replace(' ', '', ucwords(str_replace('_', ' ', $key)));
        $r = $prefix.$r.$posfix;
        return new self($r);
    }
857329
private static function normalizeHeaderName(string $name) : string
  {
    if (0 === preg_match('/^[^\x00-\x1F :]+$/', $name)) {
      throw new InvalidArgumentException(sprintf(
        '%s is not a valid header name.', 
        $name
      ));
    }

    return strtolower($name);
  }
544664
private function modifyName($name)
    {
        if (!$this->caseSensitive) {
            $name = strtolower($name);
        }
        if ($this->handleDirSep) {
            if (strpos('\\', $name) !== false) {
                $name = str_replace('\\', '/', $name);
            }
        }

        return $name;
    }
1170778
public static function fromString($name)
    {
        $nameParsed = str_replace(array('urn:', 'uuid:', '{', '}', '-'), '', $name);

        // We have stripped out the dashes and are breaking up the string using
        // substr(). In this way, we can accept a full hex value that doesn't
        // contain dashes.
        $components = array(
            substr($nameParsed, 0, 8),
            substr($nameParsed, 8, 4),
            substr($nameParsed, 12, 4),
            substr($nameParsed, 16, 4),
            substr($nameParsed, 20),
        );
        $nameParsed = implode('-', $components);

        if (!self::isValid($nameParsed)) {
            throw new InvalidArgumentException('Invalid UUID string: ' . $name);
        }

        $fields = array(
            'time_low' => sprintf('%08s', $components[0]),
            'time_mid' => sprintf('%04s', $components[1]),
            'time_hi_and_version' => sprintf('%04s', $components[2]),
            'clock_seq_hi_and_reserved' => sprintf('%02s', substr($components[3], 0, 2)),
            'clock_seq_low' => sprintf('%02s', substr($components[3], 2)),
            'node' => sprintf('%012s', $components[4]),
        );

        return new self($fields);
    }
1176485
public static function to_snake_case($name, $Upper_First_Letter = false) {
        $u = $Upper_First_Letter ? 't' : 'f';
        if (!isset(self::$snake_case[$u][$name])) {
            $r = self::extractWords($name);
            if ($Upper_First_Letter) {
                $r = ucwords($r);
            }
            $r = strtr($r, array(' ' => '_'));
            self::$snake_case[$u][$name] = $r;
        }

        return self::$snake_case[$u][$name];
    }
1034173
public static function normalizeName($name)
    {
        if (false !== ($pos = strrpos($name, '.'))) {
            $name = substr($name, $pos + 1);
	     $name = trim($name," \t\n\r\0\x0B`'()\"[]~!-{}%^&.");
        }

        return strtoupper($name);
    }
431124
public static function SC($name)
    {
        // name consists of a single letter
        if (!preg_match("/^[A-Z]+$/i", $name)) {
            throw new \RuntimeException("invalid column name '$name'");
        }

        // solve longer names recursively
        if (preg_match("/^([A-Z])([A-Z]+)$/i", $name, $matches)) {
            return pow(26, strlen($matches[2])) * (self::SC($matches[1]) + 1) + self::SC($matches[2]);
        }

        return ord(strtoupper($name)) - 64 - 1;
    }
879523
public static function pascalToSnakeCase($input)
    {
        preg_match_all('!([A-Z][A-Z0-9]*(?=$|[A-Z][a-z0-9])|[A-Za-z][a-z0-9]+)!', $input, $matches);

        foreach ($matches[0] as &$match) {
            $match = ($match == strtoupper($match)) ? strtolower($match) : lcfirst($match);
        }

        return implode('_', $matches[0]);
    }
403473
protected function normalizePHPOS($name)
    {
        //Cygwin
        if (stripos($name, 'CYGWIN') !== false) {
            return 'CYGWIN';
        }

        //MinGW
        if (stripos($name, 'MSYS') !== false || stripos($name, 'MINGW') !== false) {
            return 'MINGW';
        }

        return $name;
    }
1321455
public static function coerceName( $name ) {
		$coercedName =
			mb_encode_numericentity( mb_substr( $name, 0, 1, 'UTF-8' ),
				HTMLData::$nameStartCharConvTable, 'UTF-8', true ) .
			mb_encode_numericentity( mb_substr( $name, 1, null, 'UTF-8' ),
				HTMLData::$nameCharConvTable, 'UTF-8', true );
		$coercedName = preg_replace_callback( '/&#x([0-9A-F]*);/',
			function ( $m ) {
				return 'U' . str_pad( $m[1], 6, '0', STR_PAD_LEFT );
			},
			$coercedName );
		return $coercedName;
	}
152213
public function fileNameCaseConvention($name, $case = 'studly')
    {
        if (is_array($case)) {
            $case = data_get($case, 'case', 'studly');
        }

        switch ($case) {
            case 'studly':
                return studly_case($name);
            case 'lower':
                return strtolower($name);
            case 'upper':
                return strtoupper($name);
            case 'snake':
                return snake_case($name);
            case 'title':
                return title_case($name);
            case 'camel':
                return camel_case($name);
            case 'kebab':
                return kebab_case($name);
        }
        
        return $name;
    }