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

StorageTrait   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Importance

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

2 Methods

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