Completed
Push — master ( c1625e...d10bcc )
by Hong
06:18
created

SettingsAwareTrait   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 0
dl 0
loc 27
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A setSettings() 0 5 1
A getSettings() 0 4 1
1
<?php
2
/**
3
 * Phossa Project
4
 *
5
 * PHP version 5.4
6
 *
7
 * @category  Library
8
 * @package   Phossa2\Query
9
 * @copyright Copyright (c) 2016 phossa.com
10
 * @license   http://mit-license.org/ MIT License
11
 * @link      http://www.phossa.com/
12
 */
13
/*# declare(strict_types=1); */
14
15
namespace Phossa2\Query\Traits;
16
17
use Phossa2\Query\Interfaces\SettingsAwareInterface;
18
19
/**
20
 * SettingsAwareTrait
21
 *
22
 * Implementation of SettingsAwareInterface
23
 *
24
 * @package Phossa2\Query
25
 * @author  Hong Zhang <[email protected]>
26
 * @see     SettingsAwareInterface
27
 * @version 2.0.0
28
 * @since   2.0.0 added
29
 */
30
trait SettingsAwareTrait
31
{
32
    /**
33
     * settings
34
     *
35
     * @var    array
36
     * @access protected
37
     */
38
    protected $settings = [];
39
40
    /**
41
     * {@inheritDoc}
42
     */
43
    public function setSettings(array $settings)
44
    {
45
        $this->settings = array_replace($this->settings, $settings);
46
        return $this;
47
    }
48
49
    /**
50
     * {@inheritDoc}
51
     */
52
    public function getSettings()/*# : array */
53
    {
54
        return $this->settings;
55
    }
56
}
57