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\Model\Config\Backend; |
||
28 | |||
29 | use Magento\Framework\App\Config\Value; |
||
0 ignored issues
–
show
|
|||
30 | |||
31 | class SerializedOrJson extends Value |
||
32 | { |
||
33 | /** |
||
34 | * PAYONE Base helper |
||
35 | * |
||
36 | * @var \Payone\Core\Helper\Base |
||
37 | */ |
||
38 | protected $baseHelper; |
||
39 | |||
40 | /** |
||
41 | * @param \Magento\Framework\Model\Context $context |
||
42 | * @param \Magento\Framework\Registry $registry |
||
43 | * @param \Magento\Framework\App\Config\ScopeConfigInterface $config |
||
44 | * @param \Magento\Framework\App\Cache\TypeListInterface $cacheTypeList |
||
45 | * @param \Payone\Core\Helper\Base $baseHelper |
||
46 | * @param \Magento\Framework\Model\ResourceModel\AbstractResource|null $resource |
||
47 | * @param \Magento\Framework\Data\Collection\AbstractDb|null $resourceCollection |
||
48 | * @param array $data |
||
49 | */ |
||
50 | public function __construct( |
||
51 | \Magento\Framework\Model\Context $context, |
||
0 ignored issues
–
show
The type
Magento\Framework\Model\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. filter:
dependency_paths: ["lib/*"]
For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths ![]() |
|||
52 | \Magento\Framework\Registry $registry, |
||
0 ignored issues
–
show
The type
Magento\Framework\Registry 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. filter:
dependency_paths: ["lib/*"]
For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths ![]() |
|||
53 | \Magento\Framework\App\Config\ScopeConfigInterface $config, |
||
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. filter:
dependency_paths: ["lib/*"]
For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths ![]() |
|||
54 | \Magento\Framework\App\Cache\TypeListInterface $cacheTypeList, |
||
0 ignored issues
–
show
The type
Magento\Framework\App\Cache\TypeListInterface 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. filter:
dependency_paths: ["lib/*"]
For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths ![]() |
|||
55 | \Payone\Core\Helper\Base $baseHelper, |
||
56 | ?\Magento\Framework\Model\ResourceModel\AbstractResource $resource = null, |
||
0 ignored issues
–
show
The type
Magento\Framework\Model\...eModel\AbstractResource 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. filter:
dependency_paths: ["lib/*"]
For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths ![]() |
|||
57 | ?\Magento\Framework\Data\Collection\AbstractDb $resourceCollection = null, |
||
0 ignored issues
–
show
The type
Magento\Framework\Data\Collection\AbstractDb 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. filter:
dependency_paths: ["lib/*"]
For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths ![]() |
|||
58 | array $data = [] |
||
59 | ) { |
||
60 | parent::__construct($context, $registry, $config, $cacheTypeList, $resource, $resourceCollection, $data); |
||
61 | $this->baseHelper = $baseHelper; |
||
62 | } |
||
63 | |||
64 | /** |
||
65 | * @return void |
||
66 | */ |
||
67 | protected function _afterLoad() |
||
68 | { |
||
69 | if (!is_array($this->getValue())) { |
||
70 | $value = $this->getValue(); |
||
71 | $this->setValue(empty($value) ? false : $this->baseHelper->unserialize($value)); |
||
72 | } |
||
73 | } |
||
74 | |||
75 | /** |
||
76 | * @return $this |
||
77 | */ |
||
78 | public function beforeSave() |
||
79 | { |
||
80 | $value = $this->getValue(); |
||
81 | if (is_array($value)) { |
||
82 | unset($value['__empty']); |
||
83 | $value = $this->baseHelper->serialize($value); |
||
84 | } |
||
85 | $this->setValue($value); |
||
86 | return parent::beforeSave(); |
||
87 | } |
||
88 | } |
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:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths