I am getting this error when I submit my extension for technical review at magento marketplace .
I know there are answers available for this , I have gone through following questions as well question 1 && question 2.
but the answer provided there is not resolving the warning .
Here is my code
/**
* Created by PhpStorm.
* User: Rahul
* Date: 31/7/18
* Time: 4:37 PM
*/
namespace Rahul\DiscountPlugin\Setup;
use Magento\Framework\Setup\InstallSchemaInterface;
use Magento\Framework\Setup\ModuleContextInterface;
use Magento\Framework\Setup\SchemaSetupInterface;
use Magento\Eav\Setup\EavSetup;
use Magento\Eav\Model\Config;
class InstallSchema implements InstallSchemaInterface
{
/**
* @var EavSetup
*/
private $eavSetup;
/**
* @var Config
*/
private $eavConfig;
/**
* InstallData constructor.
* @param EavSetup $eavSetup
* @param Config $config
*/
public function __construct(
EavSetup $eavSetup,
Config $config
) {
$this->eavSetup = $eavSetup;
$this->eavConfig = $config;
}
/**
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
*/
public function install(SchemaSetupInterface $setup, ModuleContextInterface $context)
{
$setup->startSetup();
$table = $setup->getConnection()->newTable(
$setup->getTable('discountplugin')
)->addColumn(
'vatpluginid',
\Magento\Framework\DB\Ddl\Table::TYPE_INTEGER,
null,
['identity' => true, 'unsigned' => true, 'nullable' => false, 'primary' => true],
'VatPluginId'
)->addColumn(
'apikey',
\Magento\Framework\DB\Ddl\Table::TYPE_TEXT,
255,
[],
'ApiKey'
)->addColumn(
'endpoint',
\Magento\Framework\DB\Ddl\Table::TYPE_TEXT,
255,
[],
'EndPoint'
)->addColumn(
'created_at',
\Magento\Framework\DB\Ddl\Table::TYPE_TIMESTAMP,
null,
['nullable' => false, 'default' => \Magento\Framework\DB\Ddl\Table::TIMESTAMP_INIT],
'Create date'
)->addColumn(
'updated_at',
\Magento\Framework\DB\Ddl\Table::TYPE_TIMESTAMP,
null,
['nullable' => false, 'default' => \Magento\Framework\DB\Ddl\Table::TIMESTAMP_INIT],
'Updated date'
)->setComment(
'discount plugin table'
);
$setup->getConnection()->createTable($table);
$eavTable1 = $setup->getTable('quote');
$eavTable2 = $setup->getTable('sales_order');
$columns = [
'save_vat_discount' => [
'type' => \Magento\Framework\DB\Ddl\Table::TYPE_TEXT,
'nullable' => true,
'comment' => 'Input option',
]
];
$connection = $setup->getConnection();
foreach ($columns as $name => $definition) {
$connection->addColumn($eavTable1, $name, $definition);
$connection->addColumn($eavTable2, $name, $definition);
}
$setup->endSetup();
}
}
can please anyone guide me what I am doing wrong here ?
Thanks
$context->getVersion();
after$installer->startSetup();
.