Passed
Pull Request — master (#427)
by
unknown
03:22
created

Config::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 4
dl 0
loc 8
rs 10
c 0
b 0
f 0
1
<?php
2
3
/**
4
 * PAYONE Magento 2 Connector is free software: you can redistribute it and/or modify
5
 * it under the terms of the GNU Lesser General Public License as published by
6
 * the Free Software Foundation, either version 3 of the License, or
7
 * (at your option) any later version.
8
 *
9
 * PAYONE Magento 2 Connector is distributed in the hope that it will be useful,
10
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12
 * GNU Lesser General Public License for more details.
13
 *
14
 * You should have received a copy of the GNU Lesser General Public License
15
 * along with PAYONE Magento 2 Connector. If not, see <http://www.gnu.org/licenses/>.
16
 *
17
 * PHP version 5
18
 *
19
 * @category  Payone
20
 * @package   Payone_Magento2_Plugin
21
 * @author    FATCHIP GmbH <[email protected]>
22
 * @copyright 2003 - 2016 Payone GmbH
23
 * @license   <http://www.gnu.org/licenses/> GNU Lesser General Public License
24
 * @link      http://www.payone.de
25
 */
26
27
namespace Payone\Core\Helper;
28
29
/**
30
 * Helper class for everything that has to do with the configuration
31
 */
32
class Config extends \Payone\Core\Helper\Base
33
{
34
    /**
35
     * @var Toolkit
36
     */
37
    protected $toolkitHelper;
38
39
    /**
40
     * Constructor
41
     *
42
     * @param \Magento\Framework\App\Helper\Context             $context
43
     * @param \Magento\Store\Model\StoreManagerInterface        $storeManager
44
     * @param \Payone\Core\Helper\Shop                          $shopHelper
45
     * @param \Payone\Core\Helper\Toolkit                       $toolkitHelper
46
     */
47
    public function __construct(
48
        \Magento\Framework\App\Helper\Context $context,
0 ignored issues
show
Bug introduced by
The type Magento\Framework\App\Helper\Context 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...
49
        \Magento\Store\Model\StoreManagerInterface $storeManager,
0 ignored issues
show
Bug introduced by
The type Magento\Store\Model\StoreManagerInterface 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...
50
        \Payone\Core\Helper\Shop $shopHelper,
51
        \Payone\Core\Helper\Toolkit $toolkitHelper
52
    ) {
53
        parent::__construct($context, $storeManager, $shopHelper);
54
        $this->toolkitHelper = $toolkitHelper;
55
    }
56
57
    /**
58
     * Return unserialized array of all forwarding urls
59
     *
60
     * @param  string $sStoreCode
61
     * @return array
62
     */
63
    public function getForwardingUrls($sStoreCode = null)
64
    {
65
        $sForwarding = $this->getConfigParam('config', 'forwarding', 'payone_misc', $sStoreCode);
66
        if ($sForwarding) {
67
            $aForwarding = $this->toolkitHelper->unserialize($sForwarding);
68
            if (is_array($aForwarding) && !empty($aForwarding)) {
69
                return $aForwarding;
70
            }
71
        }
72
        return [];
73
    }
74
}
75