survey-library
survey-library copied to clipboard
Rename the hasErrors() method and containsErrors property
Method names usually start with a verb. We should rename the hasErrors()
method to validate()
.
We have many properties that start with "has": hasDescription
, hasTitle
, hasOther
, etc. The containsErrors
property works similarly but named differerntly. We should rename this property to hasErrors
.
@RomanTsukanov containsErrors
cannot be renamed to hasErrors
because there's already the hasErrors
method. There are also hasCurrentPageErrors()
and hasPageErrors()
methods. We need other names.
Thank you, Andrew
@andrewtelnov
Okay, we have no choice but to leave containsErrors
as is then. Other renamings are as follows:
hasErrors()
-> validate()
hasPageErrors(page)
-> validatePage(page)
hasCurrentPageErrors
- remove, use validatePage(survey.currentPage)
instead
Would you mind throwing a rename of isCurrentPageHasErrors
into this mix? This makes no grammatical sense and could easily be called hasErrorsOnCurrentPage
or something like that (not to be confused with the hasCurrentPageErrors
being deprecated here.)