Completed
Push — master ( 527bb5...aca9c3 )
by César
05:15
created

XmlResponse::render()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 10
Code Lines 6

Duplication

Lines 10
Ratio 100 %

Importance

Changes 0
Metric Value
dl 10
loc 10
c 0
b 0
f 0
rs 9.4285
cc 1
eloc 6
nc 1
nop 0
1
<?php
2
3
namespace Preetender\Routing\Response;
4
5
/**
6
 * Class XmlResponse
7
 * @package Preetender\Routing\Response
8
 */
9 View Code Duplication
class XmlResponse extends BaseResponse
0 ignored issues
show
Duplication introduced by
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
10
{
11
    /**
12
     * Inform headers for xml requests
13
     *
14
     * @var array
15
     */
16
    protected $headers = [];
17
18
    /**
19
     * Format and return to requester
20
     *
21
     * @return mixed
22
     */
23
    public function render()
24
    {
25
26
        $data_format = $this->wrapped->render();
27
28
        $this->response->setContent($data_format);
29
        $this->response->headers->add($this->headers);
30
        $this->response->prepare($this->request);
31
        $this->response->send();
32
    }
33
}