ConfigProvider::isExportAsync()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
c 0
b 0
f 0
rs 10
cc 1
nc 1
nop 0
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
}