Response   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

Changes 0
Metric Value
wmc 2
lcom 1
cbo 2
dl 0
loc 15
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A setContentType() 0 4 1
A __toString() 0 6 1
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
}