Issues (570)

Gateway/Config/ConfigCcVault.php (7 issues)

1
<?php
2
/**
3
 * Copyright © Wirecard Brasil. All rights reserved.
4
 *
5
 * @author    Bruno Elisei <[email protected]>
6
 * See COPYING.txt for license details.
7
 */
8
9
namespace Moip\Magento2\Gateway\Config;
10
11
use Magento\Framework\App\Config\ScopeConfigInterface;
0 ignored issues
show
The type Magento\Framework\App\Config\ScopeConfigInterface was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
12
use Magento\Framework\Exception\InputException;
0 ignored issues
show
The type Magento\Framework\Exception\InputException was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
13
use Magento\Framework\Exception\NoSuchEntityException;
0 ignored issues
show
The type Magento\Framework\Exception\NoSuchEntityException was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
14
use Magento\Store\Model\ScopeInterface;
0 ignored issues
show
The type Magento\Store\Model\ScopeInterface was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
15
16
class ConfigCcVault extends \Magento\Payment\Gateway\Config\Config
0 ignored issues
show
The type Magento\Payment\Gateway\Config\Config was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
17
{
18
    /**
19
     * CVV Enabled - Cc Vault.
20
     *
21
     * @const string
22
     */
23
    const CVV_ENABLED = 'cvv_enabled';
24
25
    /**
26
     * Method Code - Cc Vault.
27
     *
28
     * @const string
29
     */
30
    const METHOD = 'moip_magento2_cc_vault';
31
32
    /**
33
     * Config constructor.
34
     *
35
     * @param ScopeConfigInterface $scopeConfig
36
     * @param null                 $methodCode
0 ignored issues
show
Documentation Bug introduced by
Are you sure the doc-type for parameter $methodCode is correct as it would always require null to be passed?
Loading history...
37
     */
38
    public function __construct(
39
        ScopeConfigInterface $scopeConfig,
40
        $methodCode = null
41
    ) {
42
        \Magento\Payment\Gateway\Config\Config::__construct($scopeConfig, $methodCode);
43
        $this->scopeConfig = $scopeConfig;
0 ignored issues
show
Bug Best Practice introduced by
The property scopeConfig does not exist. Although not strictly required by PHP, it is generally a best practice to declare properties explicitly.
Loading history...
44
    }
45
46
    /**
47
     * @throws InputException
48
     * @throws NoSuchEntityException
49
     *
50
     * @return bool
51
     */
52
    public function useCvv($storeId = null)
53
    {
54
        $pathPattern = 'payment/%s/%s';
55
56
        return (bool) $this->scopeConfig->getValue(
57
            sprintf($pathPattern, self::METHOD, self::CVV_ENABLED),
58
            ScopeInterface::SCOPE_STORE,
59
            $storeId
60
        );
61
    }
62
}
63