ConfigProvider   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A getCleanupAfter() 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
 * @copyright Copyright (C) 2018 Lizard Media (http://lizardmedia.pl)
9
 */
10
11
namespace LizardMedia\PasswordMigrator\Model\Config;
12
13
use LizardMedia\PasswordMigrator\Api\Config\ConfigProviderInterface;
14
use Magento\Framework\App\Config\ScopeConfigInterface;
15
16
/**
17
 * Class ConfigProvider
18
 * @package LizardMedia\PasswordMigrator\Model\Config
19
 */
20
class ConfigProvider implements ConfigProviderInterface
21
{
22
    const XML_PATH_CLEANUP_AFTER = 'password_migrator/general/cleanup';
23
24
    /**
25
     * @var ScopeConfigInterface
26
     */
27
    private $scopeConfig;
28
29
    /**
30
     * ConfigProvider constructor.
31
     * @param ScopeConfigInterface $scopeConfig
32
     */
33
    public function __construct(
34
        ScopeConfigInterface $scopeConfig
35
    ) {
36
        $this->scopeConfig = $scopeConfig;
37
    }
38
39
    /**
40
     * @return int
41
     */
42
    public function getCleanupAfter(): int
43
    {
44
        return (int)$this->scopeConfig->getValue(self::XML_PATH_CLEANUP_AFTER);
45
    }
46
}
47