HeadersProperty::headers()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 2
eloc 1
nc 2
nop 0
dl 0
loc 3
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace GinoPane\NanoRest\Supplemental;
4
5
/**
6
 * Trait HeadersProperty
7
 */
8
trait HeadersProperty
9
{
10
    /**
11
     * List of headers for a request
12
     *
13
     * @var Headers
14
     */
15
    private $headers = null;
16
17
    /**
18
     * Retrieve object's headers
19
     *
20
     * @return Headers
21
     */
22
    public function headers(): Headers
23
    {
24
        return !is_null($this->headers) ? $this->headers : ($this->headers = new Headers());
25
    }
26
}
27