Completed
Push — master ( 7dba56...6875ae )
by Oscar
10:21
created

StorageTrait::storage()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 6
rs 9.4286
cc 1
eloc 3
nc 1
nop 1
1
<?php
2
3
namespace Psr7Middlewares\Utils;
4
5
/**
6
 * Utilities used by middlewares with storage options.
7
 */
8
trait StorageTrait
9
{
10
    private $storage;
11
12
    /**
13
     * Constructor. Set the storage option.
14
     *
15
     * @param string $storage
16
     */
17
    public function __construct($storage = '')
18
    {
19
        $this->storage($storage);
20
    }
21
22
    /**
23
     * Configure the storage.
24
     *
25
     * @param string $storage
26
     *
27
     * @return self
28
     */
29
    public function storage($storage)
30
    {
31
        $this->storage = $storage;
32
33
        return $this;
34
    }
35
}
36