General   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 32
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 4
eloc 5
c 1
b 0
f 0
dl 0
loc 32
rs 10

4 Methods

Rating   Name   Duplication   Size   Complexity  
A isProductionEnvironment() 0 3 1
A isEnabled() 0 3 1
A inDebugMode() 0 3 1
A getLocalPath() 0 3 1
1
<?php
2
declare(strict_types=1);
3
4
/**
5
 * Base Configuration Class
6
 * @category    Ticaje
7
 * @package     Ticaje_AliexpressSettings
8
 * @author      Max Demian <[email protected]>
9
 */
10
11
namespace Ticaje\Dummy\Configuration;
12
13
/**
14
 * Class General
15
 * @package Ticaje\Dummy\Configuration
16
 */
17
class General extends Base implements GeneralInterface
18
{
19
    /**
20
     * @inheritDoc
21
     */
22
    protected function getLocalPath($configPath)
23
    {
24
        return self::XML_BASE_PATH . DIRECTORY_SEPARATOR . self::XML_GROUP_PATH . DIRECTORY_SEPARATOR . $configPath;
25
    }
26
27
    /**
28
     * @inheritDoc
29
     */
30
    public function isEnabled($storeId = null): bool
31
    {
32
        return (bool)$this->getConfig($this->getLocalPath(self::ENABLED_FIELD), $storeId);
33
    }
34
35
    /**
36
     * @inheritDoc
37
     */
38
    public function isProductionEnvironment($storeId = null): bool
39
    {
40
        return (bool)$this->getConfig($this->getLocalPath(self::PRODUCTION_ENVIRONMENT_FIELD), $storeId);
41
    }
42
43
    /**
44
     * @inheritDoc
45
     */
46
    public function inDebugMode($storeId = null):bool
47
    {
48
        return (bool)$this->getConfig($this->getLocalPath(self::DEBUG_MODE_FIELD), $storeId);
49
    }
50
}
51