eavSetupFactory = $eavSetupFactory; } public function upgrade(ModuleDataSetupInterface $setup, ModuleContextInterface $context) { if (version_compare($context->getVersion(), '1.5.0', '<')) { $this->upgradeAddressStreetMultiline($setup); } } /** * @throws LocalizedException * @return void */ private function upgradeAddressStreetMultiline(ModuleDataSetupInterface $setup) { $eavSetup = $this->eavSetupFactory->create(['setup' => $setup]); $row = $eavSetup->getAttribute('customer_address', 'street', 'multiline_count'); if ($row === false || ! is_numeric($row)) { throw new LocalizedException(__('Could not find the "multiline_count" config of the "street" ' . 'Customer address attribute.')); } if ($row < 3) { $eavSetup->updateAttribute('customer_address', 'street', 'multiline_count', 3); } } }