Model
NoWhitespaceInString
Magento\Inventory\Model\Validators\NoWhitespaceInString
What it does
This validator checks if a string field contains any whitespace characters (spaces, tabs, newlines).
Developers use this class when validating inventory-related fields that should not contain whitespaces, such as SKUs or inventory source codes.
It returns an array of error messages if whitespace is detected, or an empty array if validation passes.
Public Methods
- execute()