/** * @throws \RuntimeException * @return array */ public function getResponsesArray() { $config = Yaml::parse(file_get_contents($this->responsesYamlPath)); $config = is_array($config) ? $config : []; $includes = array_key_exists('includes', $config) ? $config['includes'] : []; if (count($includes)) { unset($config['includes']); foreach ($includes as $fileName) { $includeFilePath = $this->responsesYamlDir . '/' . $fileName; $loader = new YamlLoader($includeFilePath); $config = array_merge($config, $loader->getResponsesArray()); } } return $config; }