Skip to content

Exception class Magento\Framework\Validator\ValidateException does not exist #427

Open
@okolya

Description

@okolya

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

'replacement' => 'Magento\Framework\Validator\ValidateException',

Solution

The Magento\Framework\Validator\ValidateException should be replaced with Magento\Framework\Validator\Exception

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions