YAMLOpenApiRenderer   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 11
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 3
c 1
b 0
f 0
dl 0
loc 11
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getFormat() 0 3 1
A render() 0 3 1
1
<?php declare(strict_types=1);
2
3
namespace Diegoborgs\NaturalSwaggerPhp\Renders;
4
5
use OpenApi\Annotations\OpenApi;
6
7
class YAMLOpenApiRenderer implements OpenApiRendererInterface
8
{
9
10
    public function getFormat(): string
11
    {
12
        return RenderOpenApi::YAML;
13
    }
14
15
    public function render(OpenApi $spec, array $options = []): string
16
    {
17
        return $spec->toYaml();
18
    }
19
}
20