Log in
Model

StoreCodeValidator

Magento\Store\Model\Validation\StoreCodeValidator

What it does

This class validates store codes in Magento 2 to ensure they follow proper naming conventions.

Developers use this validator when creating or updating stores to verify that store codes start with a letter and contain only letters, numbers, and underscores.

It helps maintain consistency and prevent invalid store codes that could cause routing or configuration issues.

Public Methods

  • isValid()