dwightwatson/validating — pull request #28 by dalabarge (2014-06-18 22:56:00+00:00)
Title: Develop

Here are those changes I suggested. I know some of it is a bit opinionated so if you have kickback please let me know. This is very similar to how those packages that my team will be releasing later next week are formatted.

I've included in this PR an interface because I think it is easier to work with than with duck-typing. In doing so you'll discover that a few methods were either not named well or were protected when they should have been public to be consistent. `ValidatingModel` implements the `ValidatingTrait` and `ValidatingInterface` so the README can be simplified some if you so choose. I also strong typed arrays and eliminated boolean type checking by casting values to boolean instead which aided in also eliminated clutter in unit tests. I've updated the observer class to include the missing "restoring" event listener.

One change that I didn't make though I really would like to, is that instead we would rename it from `Validating` to `ValidatingModel` since really this only applies to models:

- `ValidatingTrait` => `ValidatingModelTrait`
- `ValidatingObserver` => `ValidatingModelObserver`
- `ValidatingInterface` => `ValidatingModelInterface`
- `ValidatingException` => `ValidatingModelException`

This is more inline with our naming convention and is the only reason we have to overwrite your classnames in our own package. 'Cause we're OCD like that. If you have any feedback please let me know and I'll be happy to PR it.