<commit_before><?php

namespace Coduo\TuTu\Response\Config;

use Symfony\Component\Yaml\Yaml;

class YamlLoader implements Loader
{
    private $responsesYamlPath;

    /**
     * @param $responsesYamlPath
     * @throws \InvalidArgumentException
     * @internal param $ [] $yamlFileContent
     */
    public function __construct($responsesYamlPath)
    {
        if (!file_exists($responsesYamlPath)) {
            throw new \InvalidArgumentException(sprintf("File \"%s\" does not exist.", $responsesYamlPath));
        }

        $this->responsesYamlPath = $responsesYamlPath;
    }

    /**
     * @return array
     */
    public function getResponsesArray()
    {
        return Yaml::parse(file_get_contents($this->responsesYamlPath));
    }
}<commit_msg>Force that YamlLoader return config as array<commit_after><?php

namespace Coduo\TuTu\Response\Config;

use Symfony\Component\Yaml\Yaml;

class YamlLoader implements Loader
{
    private $responsesYamlPath;

    /**
     * @param $responsesYamlPath
     * @throws \InvalidArgumentException
     * @internal param $ [] $yamlFileContent
     */
    public function __construct($responsesYamlPath)
    {
        if (!file_exists($responsesYamlPath)) {
            throw new \InvalidArgumentException(sprintf("File \"%s\" does not exist.", $responsesYamlPath));
        }

        $this->responsesYamlPath = $responsesYamlPath;
    }

    /**
     * @return array
     */
    public function getResponsesArray()
    {
        $config = Yaml::parse(file_get_contents($this->responsesYamlPath));
        return is_array($config) ? $config : [];
    }
}
{'fraction_non_alphanumeric': 0.11870727159726538, 'fraction_numerical': 0.0, 'mean_word_length': 2.985148514851485, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3824191', 'n_tokens_mistral': 495, 'n_tokens_neox': 481, 'n_words': 89}