Completed
Push — master ( 78dfa0...3cbabb )
by Stefano
03:27
created

Response   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A __toString() 0 3 1
1
<?php
2
3
/**
4
 * HTTP\Response
5
 *
6
 * Core\HTTP Interfaces.
7
 *
8
 * @package core
9
 * @author [email protected]
10
 * @copyright Caffeina srl - 2015-2016 - http://caffeina.com
11
 */
12
13
namespace HTTP;
14
15
class Response {
16
  public $status   = 200,
0 ignored issues
show
Coding Style introduced by
It is generally advisable to only define one property per statement.

Only declaring a single property per statement allows you to later on add doc comments more easily.

It is also recommended by PSR2, so it is a common style that many people expect.

Loading history...
17
         $headers  = [],
18
         $contents = '';
19
20
  public function __construct($contents, $status, $headers){
21
    $this->status   = $status;
22
    $this->contents = $contents;
23
    $this->headers  = (array)$headers;
24
  }
25
26
  public function __toString(){
27
    return $this->contents;
28
  }
29
}