Commit graph

1196 commits

Author SHA1 Message Date
Jean Pimentel 786f75c2aa Change ER to clean input 2011-09-22 19:26:26 -03:00
Jean Pimentel 9cf3edc42a Remove Length validator in Cpf Validator 2011-09-22 19:20:24 -03:00
Jean Pimentel b883a2ac7b Remove Int validator 2011-09-22 17:41:07 -03:00
Jean Pimentel afb16fcb60 Added Even/Odd Validator 2011-09-22 00:49:42 -03:00
Jean Pimentel 71d3e218fe Fixing CPF Validator 2011-09-19 22:13:10 -03:00
Jean Pimentel f12a95c1b3 Added Minimum Age Validator 2011-09-18 21:31:40 -03:00
Leandro b660a3ef6a atualizando lista de doccomments 2011-09-18 08:07:39 +08:00
Emerson Carvalho 1845ecf021 Minor change, just removing unnecessary code 2011-09-14 14:43:21 -03:00
Emerson Carvalho e51d33a850 Minor change, just removing unnecessary code 2011-09-14 14:26:44 -03:00
Jean Pimentel 42252c4a31 Added Multiple Validator 2011-09-13 23:47:59 -03:00
Jean Pimentel d1112896d0 Added Multiple Validator 2011-09-13 23:46:18 -03:00
Devin Torres 6d51b35efa Add Bool rule 2011-09-13 10:19:04 -05:00
Jair Henrique 65cc12d93b Improves CPF and JSON classes and testes 2011-09-05 23:34:00 -03:00
Jair Henrique 9aafcaceb0 - Add CPF Validation
- Fix coding standars on JSON Validation
2011-09-03 19:20:02 -03:00
Jair Henrique 0067b0a641 Include JSON validation 2011-09-02 21:27:57 -03:00
Alexandre cb6a14e02e Fixed nested messaging for grouped exceptions. 2011-08-10 23:05:35 -03:00
Morf ed439ec0a0 Fix get class name 2011-05-25 03:56:22 -07:00
Morf 5036617e3e Add phpdoc and method create instance validator (now phpdoc not support __callStatic) for autocomplete in IDE. 2011-05-25 03:34:08 -07:00
Alexandre Gaigalas 3747665b2b Minor changes, just coding style. 2011-05-06 13:00:50 -03:00
Alexandre Gaigalas 40aec39c4a Merge remote-tracking branch 'wolf/develop' into develop 2011-05-06 12:57:56 -03:00
Alexandre Gomes Gaigalas 4c4fa70773 Packaging 2011-05-04 12:09:08 -03:00
unknown 2fbdf14992 Change regexp validator for possible use modificators 2011-05-04 15:01:38 +04:00
unknown 8a0d34c288 Fix error «Call-time pass-by-reference has been deprecated» 2011-05-04 13:22:50 +04:00
unknown 0615574123 Fix return value email validator
add tests for email validator
2011-05-04 13:19:55 +04:00
unknown f98843b6cf Add email validators 2011-05-03 19:08:10 +04:00
Alexandre Gomes Gaigalas cdafd4b1ff Testes, fixed last merge. 2011-05-03 10:31:31 -03:00
Morf 5b0954a5c7 Extend Zend validator 2011-05-03 02:21:42 -07:00
Alexandre Gomes Gaigalas 81515706b9 Fixed bug on AbstractNestedException 2011-05-02 19:35:08 -03:00
Alexandre Gomes Gaigalas 67c789fa92 Added {{input}} param on AbstractRule 2011-04-29 16:17:20 -03:00
Alexandre Gomes Gaigalas e635db4a19 New API for findRelated() and findMessages() on AbstractNestedException 2011-04-29 16:00:39 -03:00
Alexandre Gomes Gaigalas 1ae18f2f5a Fixed key validator error on non-array input. 2011-04-28 11:04:57 -03:00
Alexandre Gomes Gaigalas 5d7a9e191d Removed AtLeast and MostOf (pointless validators). Lots of fixes and new tests and assertions. >96% code coverage achieved. 2011-04-27 20:41:12 -03:00
Alexandre Gomes Gaigalas 63cc857801 Cleanup on Validator class (removed some old stuff that i don't even know how ended up there), fixed findMessages and findRelated quirks 2011-04-27 14:35:12 -03:00
Alexandre Gomes Gaigalas d254d466cc Fixed Rules\Attribute and Rules\Key on non-mandatory rule checking. 2011-04-27 11:07:17 -03:00
Morf 2b3de5988f Fix use var $this->rule 2011-04-27 02:02:19 -07:00
Alexandre 3ed3114e58 Added AbstractRule->setTemplate to support custom template messages. 2011-04-17 12:29:48 -03:00
Alexandre Gomes Gaigalas 81076e0777 Added support for objects in Rules\Length 2011-04-15 18:13:38 -03:00
Alexandre Gomes Gaigalas 9b04572604 Fixed E_DEPRECATED 2011-04-14 19:32:48 -03:00
Alexandre Gomes Gaigalas de059a8ba1 pear package 2011-04-12 15:28:38 -03:00
Alexandre Gomes Gaigalas 5718a80167 Fixed return value on ValidationException::guessId() 2011-04-12 15:26:03 -03:00
Alexandre Gomes Gaigalas 7a4d52cd38 Changed Not rule rewriting to clone objects 2011-04-11 14:20:39 -03:00
Alexandre 9b6da3e3e2 Better Rules\Not() implementation. Works on composite rules now. 2011-04-09 21:00:50 -03:00
Alexandre cc278caffd Revert "Revert "Message modes for exceptions (in draft)""
This reverts commit 2041d4a33a.
2011-04-09 20:34:21 -03:00
Alexandre 2041d4a33a Revert "Message modes for exceptions (in draft)"
This reverts commit 6f0dd5c072.
2011-04-09 20:30:49 -03:00
Alexandre Gomes Gaigalas 6f0dd5c072 Message modes for exceptions (in draft) 2011-04-08 16:39:10 -03:00
Alexandre Gomes Gaigalas 182425ee0a Merge branch 'marcelo-develop' into develop 2011-04-04 16:03:47 -03:00
Marcelo Araujo 64254ee83c removing unnecessary else statements 2011-04-04 15:21:26 -03:00
Marcelo Araujo cc89eb713e removing unnecessary else statements 2011-04-04 15:13:46 -03:00
Marcelo Araujo 83e6e70421 removing unnecessary else statements 2011-04-04 15:07:12 -03:00
Marcelo Araujo 1536b87c66 removing unnecessary else/elseif statements 2011-04-04 15:03:30 -03:00
Alexandre Gomes Gaigalas e3a2578ce8 Indentation. 2011-04-04 14:37:40 -03:00
Marcelo Araujo 523bcccd58 removing unnecessary else/elseif statements 2011-04-04 14:00:41 -03:00
Marcelo Araujo 16394d451b removing unnecessary else statements 2011-04-04 13:40:47 -03:00
Alexandre Gomes Gaigalas 2e8dd7b171 Export exceptions to plain arrays (to use in template engines, for example) 2011-03-30 19:06:59 -03:00
Alexandre Gomes Gaigalas f9ce2c389c Improved factory. Should speed up performance. 2011-03-23 19:17:20 -03:00
Alexandre Gomes Gaigalas a76a2d4e95 Removed Contexts implementation. Needs another approach. 2011-03-18 16:08:04 -03:00
Alexandre Gomes Gaigalas 7abb73430e removed unecessary check() method on Rules\Not 2011-03-18 12:29:44 -03:00
Alexandre 10813d136e Licensing. 2011-03-13 11:50:47 -03:00
Alexandre 0b37041481 Not validator for negating rules (v::not(v::string()) means not string). Improvements on the Domain validator. Needs Refactoring. 2011-02-21 00:42:32 -03:00
Alexandre 191065bf4c Very early stage Internet Domain Name validators. New Contains and Tld (top-level domain) validators. NoWhitespace now validates for null values. 2011-02-20 21:53:21 -03:00
Alexandre b12b81685e StartsWith and EndsWith validators 2011-02-20 15:54:11 -03:00
Alexandre 62f19fe798 New tests for exceptions. 2011-02-20 15:03:09 -03:00
Alexandre 91da403137 -Merge branch 'develop' of github.com:Respect/Validation into develop
-Fixed package.xml
Conflicts:
	library/Respect/Validation/package.xml
2011-02-20 14:07:00 -03:00
Alexandre 47e8c47e9e Cleanup, fixed AbstractRelatedException inheritance problems. 2011-02-20 13:59:53 -03:00
Alexandre b13ef8f072 More compositing messages adjustments 2011-02-19 17:47:34 -02:00
Alexandre 45b4a4dfad Fixed composite exceptions 2011-02-18 23:07:14 -02:00
Alexandre Gomes Gaigalas 1e48eb3ee1 Changed test to work on 32bit systems 2011-02-18 11:00:25 -02:00
Alexandre 28603d74a3 Improved message compositing and iteration. Cleanup. 2011-02-18 01:08:46 -02:00
Alexandre 895ce93ed1 - Splitted up ValidationException into simple exceptions and composite exceptions
- Changed the string formater from sprintf to custom function. Exception parameters should be more readable now.
	- Several refactorings on the exception reporting model
	- Improved builders ( new v(array('int', 'positive', 'between'=>array(1,256))); is now possible, great for dependency injection.
	Note: There are nasty things on this commit. Duplicated code, orphan methods and such. Next step is a nice quality-wide refactoring.
2011-02-10 18:49:48 -02:00
Alexandre bf5ed1e64d Changes in the bootstrap, replaced SplClassLoader for a lighter implementation. 2011-02-09 18:39:32 -02:00
Alexandre 4e068bf204 -Messages are now imperative ("foo must be bar") instead of informative ("foo is not bar").
-Several improvements on the messaging system and error reporting, lots of refactored code.
-Validators can now be safely named $val->setName('My Field'), and that name will reflect on the validation message ("My Field must be bla bla bla" instead of "incorrect value" must be bla bla bla)
2011-02-08 20:10:58 -02:00
Alexandre 4fd6f282bf Prototype for ValidationException contexts (messages contextualized for forms, APIs, command line, translation, etc) 2011-02-07 15:21:58 -02:00
Alexandre 644d521663 Better docs, quick reference 2011-02-07 12:46:08 -02:00
Alexandre e46dc1d36c Hide exception messages on tests 2011-02-07 12:23:24 -02:00
Alexandre 822fd269f8 Better README, fixed bugs on AllOf and AlphaException 2011-02-07 12:22:30 -02:00
Alexandre 58c16154e4 Guess I woke up today a little obsessive. Sorted all the class declarations/methods/properties/namespace imports in alphabetic/visibility order. 2011-02-07 08:52:18 -02:00
Alexandre cd6449ff81 Using constants for template messages. 2011-02-06 23:12:41 -02:00
Alexandre 6c0573e171 New README, fixes on positive and negative validator messages 2011-02-06 20:51:50 -02:00
Alexandre 8098321bcd A lot of refactoring, tests on ValidationException, improvements on AllOf::validate 2011-02-06 20:21:15 -02:00
Alexandre e252c404ba Some refactoring, new tests 2011-02-05 15:32:21 -02:00
Alexandre 99996267d9 ValidationException->findRelated can now be used to find child exceptions. It should be easy to report messages now. 2011-02-03 20:16:58 -02:00
Alexandre 35c4d5febe -ExceptionIterator now can be configured to skip composite redundant messages or iterate over them all
-Rules\Each improvements and new tests, now can validate array keys too. Better exception reports for it.
-A very abrangent test including several cases on ValidatorTest
2011-02-02 00:28:02 -02:00
Alexandre (@alganet) 5830711f5a Several Improvements:
-Simplified defaultTemplates on Exceptions
	-Exceptions now can be iterated and recursively iterated
	-Messages built by RecursiveTreeIterator (SPL), faster an simpler
	-attribute, key and composite exceptions message plays nicer (no redundant messages)
2011-01-30 22:17:06 -02:00
Alexandre Gomes Gaigalas 03b2aca115 Fixed some interfaces 2010-12-23 18:15:54 -02:00
Alexandre Gomes Gaigalas 9a5536dd69 Several new validators (Int, In, Negative, Positive, String). Refactored Length to work with strings and arrays. Better tests for several validators. Updated README and PEAR package file. 2010-12-07 17:17:43 -02:00
Alexandre Gomes Gaigalas 896fe166c8 Small improvements 2010-12-07 11:37:07 -02:00
Alexandre Gomes Gaigalas b3cc2285fc Less Reflection on Validator, better tests for AllOf 2010-12-07 10:11:14 -02:00
Alexandre Gomes Gaigalas 71b510cd51 Equals validator for equality/identity. Tests for AbstractRelated 2010-12-07 10:02:57 -02:00
Alexandre Gomes Gaigalas 8f206ede7c StringLength refactoring (i'm very proud of this one!) 2010-12-06 19:20:13 -02:00
Alexandre Gomes Gaigalas 32c5fe4ce0 Refactoring on AbstractRelated, Call validator for validating inputs after passing them for a callback 2010-12-06 19:00:28 -02:00
Alexandre Gomes Gaigalas e38135ba78 Refactored AbstractVector into Each, improved Validator extensibility 2010-12-06 18:35:43 -02:00
Alexandre Gomes Gaigalas fa11c79339 Namespace use cleanup 2010-12-06 17:31:50 -02:00
Alexandre Gomes Gaigalas dc8a07c091 Improved interface Validatable 2010-12-06 17:05:36 -02:00
Alexandre Gomes Gaigalas 9a16edf053 Moved assert() to AbstractRule, improved extensibility for rules moving Exception creation to createException() 2010-12-06 17:02:21 -02:00
Alexandre Gomes Gaigalas 92d7c1e919 New Each validator. Removed Traversable and refactored Arr. Moved check() to AbstractRule, just the rules that need to overload it now implement it. 2010-12-06 16:30:56 -02:00
Alexandre Gomes Gaigalas 35aee77111 Refactored names for some validators 2010-12-05 23:17:12 -02:00
Alexandre Gomes Gaigalas f776bde6b8 Refactored HasKey, HasAttribute, HasOptionalKey and HasOptionalAttribute into AbstractRelated 2010-12-05 22:44:05 -02:00
Alexandre Gomes Gaigalas 0dceb11976 Refactoring on some validators. Still need refactoring on many of them 2010-12-05 18:26:04 -02:00
Alexandre Gomes Gaigalas 248fbdcf4f More stable Exceptions API 2010-12-03 19:36:46 -02:00
Alexandre Gomes Gaigalas 7c889b2d4b Changes on the Exception model 2010-12-02 22:23:02 -02:00
Alexandre Gomes Gaigalas 42999f796a Very unstable commit. Lot of changes to the exception model. 2010-12-02 19:04:10 -02:00
Alexandre Gomes Gaigalas 1c15766fcd Rules for Traversable items 2010-12-01 11:08:18 -02:00
Alexandre Gomes Gaigalas de3c73ab91 New rule for Traversable objects (arrays, arrayobjects, etc) 2010-11-30 17:53:22 -02:00
Alexandre Gomes Gaigalas 8ec90e00f1 Small fix. 2010-11-30 14:24:44 -02:00
Alexandre Gomes Gaigalas ae952fa073 Now HasAttribute works on private, protected and inacessible attributes. 2010-11-30 14:21:33 -02:00
Alexandre Gomes Gaigalas 945c9c6b33 PEAR package update 2010-11-30 13:37:39 -02:00
Alexandre Gomes Gaigalas 2408730f48 Changed the Exceptions to Match Rules names 2010-11-30 13:36:04 -02:00
Alexandre Gomes Gaigalas 460b744ee1 README update, deleted old files 2010-11-09 13:32:08 -02:00
Alexandre Gomes Gaigalas 234f74a058 Refactored one, all, most and none to oneOf, allOf, noneOf and mostOf 2010-11-09 01:35:19 -02:00
Alexandre Gomes Gaigalas b403f67739 Small fix 2010-11-09 00:32:36 -02:00
Alexandre Gomes Gaigalas f9b98679b2 Optional key and attribute validators 2010-11-08 23:56:28 -02:00
Alexandre Gomes Gaigalas 0d4e686a26 Rules for types: array, object, instances 2010-11-08 22:37:50 -02:00
Alexandre Gomes Gaigalas 1d7a721298 Faster validation for compositing rules, new check() method for validators 2010-10-18 07:15:44 -02:00
Alexandre Gomes Gaigalas 1d1c5d4b4c Removed nasty eval'd code from tests 2010-10-18 06:40:44 -02:00
Alexandre Gomes Gaigalas bc63da4e0e Major refactoring on the validation exceptions and messages. 2010-10-18 06:18:46 -02:00
Alexandre Gomes Gaigalas 87f88ae641 HasKey validator for arrays, tests improved on HasAttribute validator 2010-10-18 03:41:22 -02:00
Alexandre Gomes Gaigalas 605b6b00fa Changed some methods to protected 2010-10-18 03:24:19 -02:00
Alexandre Gomes Gaigalas f8639f488a Improvements on date validation and tests 2010-10-18 03:05:37 -02:00
Alexandre Gomes Gaigalas 611dbc1cd6 Parameter validation for Callback validator 2010-10-18 02:53:20 -02:00
Alexandre Gomes Gaigalas c29295a4d0 Better tests, parameter validation for Alnum and Alpha 2010-10-18 02:48:13 -02:00
Alexandre Gomes Gaigalas f18d700b9f New validators for numbers (digits, float, hexa, etc), alpha, regex, generic between, ip addresses. Improvements on several existent validators. 2010-10-18 02:26:02 -02:00
Alexandre Gomes Gaigalas 91d10f6ba1 Removed the ghost explain() method 2010-10-16 20:44:21 -03:00
Alexandre Gomes Gaigalas 0d3487679b Fixed a nasty bug on StringLength validator identified by Augusto.
Merged the NumericBetween validator also created by Augusto.
Fixed a bug on the Zend and Sf tests that skipped tests inapropriately.
2010-10-16 20:40:04 -03:00
Augusto Pascutti b9a7e1efe1 Added NumericBetween and its tests. Made some more dataProviders for some tests. 2010-10-17 07:02:22 +08:00
Augusto Pascutti a34946a7e3 Changed SplClassLoader to work better with class_exists() and changed external lib tests to check for vendor classes first. 2010-10-17 07:02:28 +08:00
Alexandre Gomes Gaigalas cb8edeccf6 Refactored interface declarations 2010-10-06 19:21:01 -03:00
Alexandre Gomes Gaigalas df3533c9c8 Refactored all mentions of "message" to "message template" for further refactorings 2010-10-06 18:27:14 -03:00
Alexandre Gomes Gaigalas 7012d62e0e PEAR package including Zend 2.0 and Symfony 2.0 validator bindings. 2010-10-06 18:09:56 -03:00
Alexandre Gomes Gaigalas a2fbdc340f New Sf valitador that uses Symfony 2.0 Validators and Constraints. Moved Zend validator to support only the 2.x ZF. 2010-10-06 18:06:55 -03:00
Alexandre Gomes Gaigalas fc661bcfec Added Zend Validation support 2010-10-06 15:52:06 -03:00
Alexandre Gomes Gaigalas 27c7739abd Callback validation, fixed bootstrap 2010-10-05 12:55:12 -03:00
Alexandre Gomes Gaigalas ef0257dadd PEAR package 2010-10-05 11:09:41 -03:00
Alexandre Gomes Gaigalas ffb2e3cdb5 Readme 2010-09-27 18:44:56 -03:00
Alexandre Gomes Gaigalas 82e26fa159 New Validators 2010-09-27 18:02:30 -03:00
Alexandre Gomes Gaigalas 8651990e17 Nothing really 2010-09-26 03:18:40 -03:00
Alexandre Gomes Gaigalas b43371315a Major refactoring. Removed a layer from the validator rules, now all of them have a single level. Simplified fluent interface (chains and static validators), improved folder organization. 2010-09-26 02:16:02 -03:00
Alexandre Gomes Gaigalas 85f4843df7 Better exceptions 2010-09-25 02:54:10 -03:00
Alexandre Gomes Gaigalas 0491cd885f Turned Fluent Interface into a composite validator by nature, added support for chained composite validations, small fix on String\NotEmpty validator 2010-09-25 01:48:49 -03:00
Alexandre Gomes Gaigalas 9bcdb56189 Refactored "validator" name to "rule" in many places, fluent interface improvements, validatior chaining for fluent interfaces and small fixes 2010-09-25 01:13:26 -03:00
Alexandre Gomes Gaigalas d25f7220dc Fluent interface for Valitation\Validator, draft string validator, better tests, composite validation improvements 2010-09-24 21:28:03 -03:00
Alexandre Gomes Gaigalas 5850afdad5 CompositeValidator split in two (All and One), removed Chain for further rewrite 2010-09-24 15:46:59 -03:00
Alexandre Gomes Gaigalas 9aee2ea16d Name refactorings, interface for simple validator calls, date improvements 2010-09-24 00:32:00 -03:00
Alexandre Gomes Gaigalas 348cb019fe Optional Abstract Validator which implements messages methods, better message handling 2010-09-23 23:30:16 -03:00
Alexandre Gomes Gaigalas 666c0d5330 Better exceptions (component exceptions separate from validation exceptions), date default timezone on bootstrap, Date\Between validator 2010-09-23 22:56:17 -03:00
Alexandre Gomes Gaigalas f6871cbc7d Chain validators, better tests 2010-09-23 20:24:22 -03:00
Alexandre Gomes Gaigalas 2043c1129c Validator composite structure and tests, base for new Validators 2010-09-23 16:46:46 -03:00