| Conditions | 5 |
| Paths | 4 |
| Total Lines | 59 |
| Code Lines | 40 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 2 | ||
| Bugs | 0 | Features | 0 |
Small methods make your code easier to understand, in particular if combined with a good name. Besides, if your method is small, finding a good name is usually much easier.
For example, if you find yourself adding comments to a method's body, this is usually a good sign to extract the commented part to a new method, and use the comment as a starting point when coming up with a good name for this new method.
Commonly applied refactorings include:
If many parameters/temporary variables are present:
| 1 | <?php |
||
| 52 | public function upgrade(ModuleDataSetupInterface $setup, ModuleContextInterface $context) |
||
| 53 | { |
||
| 54 | $setup->startSetup(); |
||
| 55 | |||
| 56 | if (version_compare($context->getVersion(), '8.3.1') < 0) { |
||
| 57 | $newConfigs = array( |
||
| 58 | /* INSERT NEW CONFIGS PARAMS HERE:'config'=>'<value>'*/ |
||
| 59 | 'PAGANTIS_DISPLAY_MAX_AMOUNT' => 0 |
||
| 60 | ); |
||
| 61 | foreach ($newConfigs as $config => $value) { |
||
| 62 | $setup->getConnection()->insert(self::CONFIG_TABLE, array('config'=>$config, 'value'=>$value)); |
||
| 63 | } |
||
| 64 | } |
||
| 65 | |||
| 66 | if (version_compare($context->getVersion(), '8.3.2') < 0) { |
||
| 67 | $newConfigs = array( |
||
| 68 | /* INSERT NEW CONFIGS PARAMS HERE:'config'=>'<value>'*/ |
||
| 69 | 'PAGANTIS_SIMULATOR_DISPLAY_TYPE_CHECKOUT' => 'sdk.simulator.types.CHECKOUT_PAGE' |
||
| 70 | ); |
||
| 71 | foreach ($newConfigs as $config => $value) { |
||
| 72 | $setup->getConnection()->insert(self::CONFIG_TABLE, array('config'=>$config, 'value'=>$value)); |
||
| 73 | } |
||
| 74 | $setup->getConnection()->update( |
||
| 75 | self::CONFIG_TABLE, |
||
| 76 | array('value' => 'sdk.simulator.types.PRODUCT_PAGE'), |
||
| 77 | "config='PAGANTIS_SIMULATOR_DISPLAY_TYPE'" |
||
| 78 | ); |
||
| 79 | |||
| 80 | } |
||
| 81 | |||
| 82 | $eavSetup = $this->eavSetupFactory->create(['setup' => $setup]); |
||
| 83 | $eavSetup->addAttribute( |
||
| 84 | \Magento\Catalog\Model\Product::ENTITY, |
||
| 85 | $this->code, |
||
| 86 | [ |
||
| 87 | 'group' => $this->group, |
||
| 88 | 'type' => 'int', |
||
| 89 | 'backend' => '', |
||
| 90 | 'frontend' => '', |
||
| 91 | 'label' => $this->label, |
||
| 92 | 'input' => 'boolean', |
||
| 93 | 'class' => '', |
||
| 94 | 'source' => 'Magento\Eav\Model\Entity\Attribute\Source\Boolean', |
||
| 95 | 'global' => \Magento\Eav\Model\Entity\Attribute\ScopedAttributeInterface::SCOPE_GLOBAL, |
||
| 96 | 'visible' => true, |
||
| 97 | 'required' => false, |
||
| 98 | 'user_defined' => false, |
||
| 99 | 'default' => '0', |
||
| 100 | 'searchable' => false, |
||
| 101 | 'filterable' => false, |
||
| 102 | 'comparable' => false, |
||
| 103 | 'visible_on_front' => false, |
||
| 104 | 'used_in_product_listing' => false, |
||
| 105 | 'unique' => false, |
||
| 106 | 'apply_to' => '' |
||
| 107 | ] |
||
| 108 | ); |
||
| 109 | |||
| 110 | $setup->endSetup(); |
||
| 111 | } |
||
| 112 | } |
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