Raml\Parser::replaceSchemas PHP Method

replaceSchemas() private method

Replaces schema into the raml file
private replaceSchemas ( array $array, array $schemas ) : array
$array array
$schemas array List of available schema definition
return array
    private function replaceSchemas($array, $schemas)
    {
        if (!is_array($array)) {
            return $array;
        }
        foreach ($array as $key => $value) {
            if ('schema' === $key) {
                if (isset($schemas[$value])) {
                    $array[$key] = $schemas[$value];
                }
            } else {
                $array[$key] = $this->replaceSchemas($value, $schemas);
            }
        }
        return $array;
    }