public static function safeParse($input, $validateDuplicateKeys = true)
    {
        if (method_exists('Symfony\Component\Yaml\Yaml', 'setPhpParsing')) {
            Yaml::setPhpParsing(false);
        }

        if ($validateDuplicateKeys) {
            self::validateDuplicatedKey($input);
        }

        return (new Parser())->parse($input, true, false);
    }
public static function safeParse($input, $validateDuplicateKeys = true)
    {
        if (method_exists('Symfony\Component\Yaml\Yaml', 'setPhpParsing')) {
            Yaml::setPhpParsing(false);
        }

        if ($validateDuplicateKeys) {
            self::validateDuplicatedKey($input);
        }

        return (new Parser())->parse($input, true, false);
    }
public static function safeParse ( $ input , $ validateDuplicateKeys = true ) { if ( method_exists ( 'Symfony\Component\Yaml\Yaml' , 'setPhpParsing' ) ) { Yaml :: setPhpParsing ( false ) ; } if ( $ validateDuplicateKeys ) { self :: validateDuplicatedKey ( $ input ) ; } return ( new Parser ( ) ) -> parse ( $ input , true , false ) ; }
Safely parses the input string.

In contrast to the original Yaml class, we do not try to resolve the input to a filename first. Consequentially,
there is no need to sanitize the input prior to calling this method.

@param string $input

@return mixed
Safely parses the input string .