Code Duplication    Length = 6-6 lines in 2 locations

src/OpenApi/OpenApiResponseBody.php 1 location

@@ 25-30 (lines=6) @@
22
     */
23
    public function match($body)
24
    {
25
        if (!isset($this->structure['content'])) {
26
            if (!empty($body)) {
27
                throw new NotMatchedException("Expected empty body for " . $this->name);
28
            }
29
            return true;
30
        }
31
        return $this->matchSchema($this->name, $this->structure['content'][key($this->structure['content'])]['schema'], $body);
32
    }
33
}

src/Swagger/SwaggerResponseBody.php 1 location

@@ 25-30 (lines=6) @@
22
     */
23
    public function match($body)
24
    {
25
        if (!isset($this->structure['schema'])) {
26
            if (!empty($body)) {
27
                throw new NotMatchedException("Expected empty body for " . $this->name);
28
            }
29
            return true;
30
        }
31
        return $this->matchSchema($this->name, $this->structure['schema'], $body);
32
    }
33
}