public static function convertNodeStr($str): string
    {
        $str = \trim($str, '-');

        // convert 'first-second' to 'firstSecond'
        if (\strpos($str, '-')) {
            $str = (string)\preg_replace_callback('/-+([a-z])/', function ($c) {
                return \strtoupper($c[1]);
            }, \trim($str, '- '));
        }

        return $str;
    }
public static function convertNodeStr($str): string
    {
        $str = \trim($str, '-');

        // convert 'first-second' to 'firstSecond'
        if (\strpos($str, '-')) {
            $str = (string)\preg_replace_callback('/-+([a-z])/', function ($c) {
                return \strtoupper($c[1]);
            }, \trim($str, '- '));
        }

        return $str;
    }
public static function convertNodeStr ( $ str ) : string { $ str = \ trim ( $ str , '-' ) ; // convert 'first-second' to 'firstSecond' if ( \ strpos ( $ str , '-' ) ) { $ str = ( string ) \ preg_replace_callback ( '/-+([a-z])/' , function ( $ c ) { return \ strtoupper ( $ c [ 1 ] ) ; } , \ trim ( $ str , '- ' ) ) ; } return $ str ; }
convert 'first-second' to 'firstSecond'
@param string $str
@return string
convert first - second to firstSecond