Completed
Push — 19.x ( f78ed0 )
by Tim
01:55
created

RmaKeys   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 2
lcom 1
cbo 0
dl 0
loc 26
ccs 0
cts 4
cp 0
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A get() 0 4 2
1
<?php
2
3
/**
4
 * TechDivision\Import\Product\Ee\Utils\RmaKeys
5
 *
6
 * NOTICE OF LICENSE
7
 *
8
 * This source file is subject to the Open Software License (OSL 3.0)
9
 * that is available through the world-wide-web at this URL:
10
 * http://opensource.org/licenses/osl-3.0.php
11
 *
12
 * PHP version 5
13
 *
14
 * @author    Tim Wagner <[email protected]>
15
 * @copyright 2020 TechDivision GmbH <[email protected]>
16
 * @license   http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
17
 * @link      https://github.com/techdivision/import-product-ee
18
 * @link      http://www.techdivision.com
19
 */
20
21
namespace TechDivision\Import\Product\Ee\Utils;
22
23
/**
24
 * Utitlity class that provides RMA keys.
25
 *
26
 * @author    Tim Wagner <[email protected]>
27
 * @copyright 2020 TechDivision GmbH <[email protected]>
28
 * @license   http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
29
 * @link      https://github.com/techdivision/import-product-ee
30
 * @link      http://www.techdivision.com
31
 */
32
class RmaKeys implements RmaKeysInterface
33
{
34
35
    /**
36
     * The available states for the 'is_returnable' colum.
37
     *
38
     * @var array
39
     */
40
    protected $returnable = array(
41
        RmaKeysInterface::NOT_RETURNABLE => 0,
42
        RmaKeysInterface::RETURNABLE     => 1,
43
        RmaKeysInterface::USE_CONFIG     => 2
44
    );
45
46
    /**
47
     * Return's the value for the passed key.
48
     *
49
     * @param string $key The key to return the value for
50
     *
51
     * @return int The value
52
     */
53
    public function get(string $key) : int
54
    {
55
        return isset($this->returnable[$key]) ? $this->returnable[$key] : $this->returnable[RmaKeysInterface::USE_CONFIG];
56
    }
57
}
58