yanepenb/Diff-finder

View on GitHub
src/parser.php

Summary

Maintainability
A
0 mins
Test Coverage
<?php

namespace DiffFinder\parser;

use Symfony\Component\Yaml\Yaml;

function getFormatData($data, $dataFormat)
{
    if ($dataFormat === 'json') {
        return json_decode($data);
    } elseif ($dataFormat === 'yml') {
        return Yaml::parse($data, Yaml::PARSE_OBJECT_FOR_MAP);
    }
}