Response::__toString()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 6
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 3
nc 1
nop 0
1
<?php
2
namespace Fructify\Reload\Response;
3
4
use Symfony\Component\HttpFoundation;
5
6
/**
7
 * Description of Request
8
 *
9
 * @author ricky
10
 */
11
class Response extends HttpFoundation\Response
12
{
13
    
14
    public function setContentType($type, $charset)
15
    {
16
        $this->headers->set('Content-Type', "$type; charset=$charset");
17
    }
18
19
    public function __toString()
20
    {
21
        $this->headers->set('Content-Length', strlen($this->getContent()));
22
23
        return parent::__toString();
24
    }
25
}