ConfigProvider   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 29
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A isExportAsync() 0 4 1
1
<?php
2
declare(strict_types=1);
3
4
/**
5
 * File:ConfigProvider.php
6
 *
7
 * @author      Maciej Sławik <[email protected]>
8
 * Github:      https://github.com/maciejslawik
9
 */
10
11
namespace MSlwk\GenericOrderExport\Model;
12
13
use Magento\Framework\App\Config\ScopeConfigInterface;
14
use MSlwk\GenericOrderExport\Api\ConfigProviderInterface;
15
16
/**
17
 * Class ConfigProvider
18
 * @package MSlwk\GenericOrderExport\Model
19
 */
20
class ConfigProvider implements ConfigProviderInterface
21
{
22
    /**
23
     * @var string
24
     */
25
    private const XML_PATH_ORDER_EXPORT_ASYNC = 'sales/order_export/async_enabled';
26
27
    /**
28
     * @var ScopeConfigInterface
29
     */
30
    private $config;
31
32
    /**
33
     * ConfigProvider constructor.
34
     * @param ScopeConfigInterface $config
35
     */
36
    public function __construct(ScopeConfigInterface $config)
37
    {
38
        $this->config = $config;
39
    }
40
41
    /**
42
     * @return bool
43
     */
44
    public function isExportAsync(): bool
45
    {
46
        return (bool)$this->config->getValue(self::XML_PATH_ORDER_EXPORT_ASYNC);
47
    }
48
}