Open
Description
Preconditions
Add attribute in Data Patch using $eavSetup->addAttribute()
method.
Place DataPatch in Vendor/Module/Setup/Patch/Data/AddTestAttribute.php file.
Example
$eavSetup = $this->eavSetupFactory->create(['setup' => $this->moduleDataSetup]);
$eavSetup->addAttribute(Product::ENTITY, $attributeCode, $attribute);
Steps to reproduce
run vendor/bin/phpcs --standard=Magento2 app/code/Vendor/Module/Setup/Patch/Data/AddTestAttribute.php
Expected result
class 'Zend_Validate_Exception' is restricted in app/code/Vendor/Module/Setup/Patch/Data/AddTestAttribute.php.
Suggested replacement: Magento\Framework\Validator\Exception
Actual result
class 'Zend_Validate_Exception' is restricted in app/code/Vendor/Module/Setup/Patch/Data/AddTestAttribute.php.
Suggested replacement: Magento\Framework\Validator\ValidateException
Line
Solution
The Magento\Framework\Validator\ValidateException
should be replaced with Magento\Framework\Validator\Exception