Passed
Push — master ( f88e8a...b165b9 )
by Vince
01:38
created

optionsTrait   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 30
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 6
c 1
b 0
f 0
dl 0
loc 30
rs 10
wmc 3

2 Methods

Rating   Name   Duplication   Size   Complexity  
A setOptions() 0 3 1
A getOptions() 0 6 2
1
<?php
2
/**
3
 * ==================================
4
 * Responsible PHP API
5
 * ==================================
6
 *
7
 * @link Git https://github.com/vince-scarpa/responsibleAPI.git
8
 *
9
 * @api Responible API
10
 * @package responsible\core\traits
11
 *
12
 * @author Vince scarpa <[email protected]>
13
 *
14
 */
15
namespace responsible\core\traits;
16
17
// use responsible\core\options;
18
19
trait optionsTrait
20
{
21
    /**
22
     * $options 
23
     *     Options property
24
     * @var array
25
     */
26
    private $options = [];
27
28
    /**
29
     * setOptions 
30
     *     Set the Responsible API options
31
     * @param array $options
32
     */
33
    public function setOptions($options):void
34
    {
35
        $this->options = $options;
36
    }
37
38
    /**
39
     * getOptions 
40
     *     Get the Responsible API options if set
41
     * @return array
42
     */
43
    public function getOptions():array
44
    {
45
        if (!empty($this->options)) {
46
            return $this->options;
47
        }
48
        return [];
49
    }
50
}