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

Response::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 4
c 1
b 0
f 0
nc 1
nop 3
dl 0
loc 5
rs 9.4285
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
}