You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We should use objects for the different validation errors (like you would use separate objects for exceptions as well).
Benefits:
Instead of passing arrays around with multiple types of information, we can pass a single object of type AMP_Validation_Error around.
The objects can have proper constructors that know which type of data to collect for each error, allowing us to add type checking and other safeguards:
Uses less memory, because most arrays with strings will be turned into internal properties instead.
Removes big switch() statements like the one below. Whatever needs to be checked across all validation errors will be encapsulated as a method on them.
I personally think it is much easier to read (see 5. as an example).
Do not alter or remove anything below. The following sections will be managed by moderators only.
Acceptance criteria
Implementation brief
QA testing instructions
Demo
Changelog entry
The text was updated successfully, but these errors were encountered:
Feature description
(Copied from #3780 (comment))
We should use objects for the different validation errors (like you would use separate objects for exceptions as well).
Benefits:
AMP_Validation_Error
around.switch()
statements like the one below. Whatever needs to be checked across all validation errors will be encapsulated as a method on them.Do not alter or remove anything below. The following sections will be managed by moderators only.
Acceptance criteria
Implementation brief
QA testing instructions
Demo
Changelog entry
The text was updated successfully, but these errors were encountered: