Martin Hason
345981f6b6
[Validator] added support for plural messages
2012-02-09 07:57:17 +01:00
Bernhard Schussek
2e4ebe444f
[Validator] Renamed methods addViolationAtRelativePath() and getAbsolutePropertyPath() in ExecutionContext
2012-02-02 10:13:41 +01:00
Bernhard Schussek
9153f0e569
[Validator] Deprecated ConstraintValidator methods setMessage(), getMessageTemplate() and getMessageParameters()
...
Had to refactor the validation tests at the same time and fixed various small bugs while doing so.
2012-02-01 14:03:13 +01:00
Bernhard Schussek
a30a679135
[Validator] Made ExecutionContext immutable and introduced new class GlobalExecutionContext
...
A new ExecutionContext is now created everytime that GraphWalker::walkConstraint() is
launched. Because of this, a validator B launched from within a validator A can't break
A anymore by changing the context.
Because we have a new ExecutionContext for every constraint validation, there is no point
in modifying its state anymore. Because of this it is now immutable.
2012-01-31 21:35:48 +01:00
Bernhard Schussek
fe85bbdb06
[Validator] Simplified ExecutionContext::addViolation(), added ExecutionContext::addViolationAt()
2012-01-31 18:42:14 +01:00
Bernhard Schussek
a103c28b08
[Validator] The Collection constraint adds "missing" and "extra" errors to the individual fields now
2012-01-30 20:57:20 +01:00
Fabien Potencier
e8f9a55012
fixed CS
2012-01-17 11:23:46 +01:00
Bernhard Schussek
509c7bfb5b
[Validator] Moved Optional and Required constraints to dedicated sub namespace.
2012-01-16 11:30:56 +01:00
Bernhard Schussek
bf5901850a
[Validator] Removed @api-tag from Optional and Required constraint, since these two are new.
2012-01-16 11:30:56 +01:00
Bernhard Schussek
6641f3e231
[Validator] Added constraints Optional and Required for the CollectionValidator
2012-01-16 11:30:56 +01:00
Fabien Potencier
5fa0f2d92b
merged 2.0
2012-01-16 07:44:08 +01:00
Dariusz Górecki
253eebad88
[BugFix][Validator] Fix for PHP incosistent behaviour of ArrayAccess
...
Bug fix: yes
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: yes
Fixes the following tickets: #2779
Todo: -
Because PHP function `array_key_exists` is buggy, it works great with native
PHP `ArrayObject` instances, but hand written implementations of `ArrayAccess`
and `Traversable` objects will fail to work with `CollectionValidator`
2012-01-10 11:06:00 +01:00
Fabien Potencier
5d6a7d35b0
merged 2.0
2011-12-18 14:48:17 +01:00
Fabien Potencier
4316595dbb
fixed CS
2011-12-18 14:42:59 +01:00
Fabien Potencier
142cef21bb
merged 2.0
2011-12-13 16:12:53 +01:00
Fabien Potencier
e3421a0b1d
[DoctrineBridge] fixed some CS
2011-12-13 10:22:12 +01:00
Fabien Potencier
b8e0f411d7
merged 2.0
2011-11-11 23:22:38 +01:00
Fabien Potencier
fb0fffe6db
[Validator] fixed a unit test for PHP 5.4 ( closes #2585 )
2011-11-11 23:22:12 +01:00
Joseph Rouff
fb0379d3b7
Fix some CheckStyle violations on Components.
...
On casts, Control signature etc.
2011-11-11 20:46:32 +01:00
Fabien Potencier
04a1deace0
updated CHANGELOG for 2.1
2011-11-01 15:30:43 +01:00
Benjamin Dulau
05a4e9d386
[Validators][Type] Added support for ctype_* functions + tests
2011-11-01 13:01:54 +01:00
Fabien Potencier
d34d50f0b0
fixed CS
2011-10-29 12:05:45 +02:00
Fabien Potencier
dec43f5539
merged 2.0
2011-10-29 12:01:39 +02:00
Fabien Potencier
851eb73778
removed unused use statements
2011-10-29 11:56:30 +02:00
Hugo Hamon
73312ab5e9
[Validator] The Type constraint now accepts the "Boolean" type instead of "boolean".
...
Bug fix: yes
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: yes
Fixes the following tickets: -
2011-10-11 12:27:45 +02:00
Fabien Potencier
41a55ba8d7
Merge branch '2.0'
...
* 2.0:
[Validator] added support for grapheme_strlen when mbstring is not installed but intl is installed
removed separator of choice widget when the separator is null
2011-09-29 16:17:23 +02:00
Fabien Potencier
1cf3e91365
[Validator] added support for grapheme_strlen when mbstring is not installed but intl is installed
2011-09-29 16:17:19 +02:00
Fabien Potencier
600b8ef5af
[Validator] added support for grapheme_strlen when mbstring is not installed but intl is installed
2011-09-29 16:15:57 +02:00
Fabien Potencier
d6c4bfb001
added a Size validator
2011-09-29 15:56:37 +02:00
Fabien Potencier
b9ba117208
[Validator] added a SizeLength validator
2011-09-29 15:45:52 +02:00
jdreesen
1134c1a1d8
[Validator] Fixed typo in Image constraint
2011-09-06 16:59:08 +02:00
Arnout Boks
522addebe5
[Validator] Fixed typo in Image constraint
2011-09-06 14:34:25 +02:00
Benjamin Dulau
89f4791704
Fixed CS
2011-09-04 19:10:51 +02:00
Benjamin Dulau
a348efec19
Removed trailing whitespaces
2011-09-04 18:12:05 +02:00
Benjamin Dulau
6ad83e7970
Updated according to PR review
2011-09-04 17:45:25 +02:00
Benjamin Dulau
a5a2dfaaa6
[ImageValidator] Added dedicated ImageValidator class with min width, max width, min height and max height validations
2011-09-04 17:28:46 +02:00
Fabien Potencier
e7b2d2d659
merged 2.0 branch
2011-09-04 09:28:37 +02:00
Fabien Potencier
adb7291b67
Merge branch 'EvanK-patch-1' into 2.0
...
* EvanK-patch-1:
Per the [documentation][1], the `NotBlank` constraint should be using the `empty` language construct, otherwise it will not trigger on, for example, a boolean false from an unchecked checkbox field.
2011-09-02 09:39:11 +02:00
Evan Kaufman
639513a67a
Per the [documentation][1], the NotBlank
constraint should be using the empty
language construct, otherwise it will not trigger on, for example, a boolean false from an unchecked checkbox field.
...
[1]: http://symfony.com/doc/2.0/reference/constraints/NotBlank.html
2011-09-02 09:37:48 +02:00
Fabien Potencier
74a77af694
merged branch stealth35/mime_wildcard (PR #2075 )
...
Commits
-------
5a47010
[Validator] FileValidator allow MIME with wildcard
Discussion
----------
[Validator] FileValidator allow MIME with wildcard
- Allow MIME with wildcard like `image/*`
- Image constraint use wildcard mime
(squash failed sorry #2068 )
2011-09-01 16:19:23 +02:00
stealth35
5a470103f0
[Validator] FileValidator allow MIME with wildcard
2011-09-01 16:10:16 +02:00
Fabien Potencier
0eae562cb2
converted file_exists calls to either is_file or is_dir where it makes sense
2011-08-29 15:28:26 +02:00
Fabien Potencier
ea800c2e51
merged branch hidenorigoto/validator_pattern_late_static_bind (PR #1914 )
...
Commits
-------
275da0d
[Validator] changed 'self' to 'static' for child class to override pattern constant
Discussion
----------
[Validator] change 'self::' to 'static::' for PATTERN constant overridable in child classes
In TimeValidator and UrlValidator, PATTERN constant is not used with late static bind(static::) while DateValidator supports it.
2011-08-19 14:11:41 +02:00
Hugo Hamon
d7c93cacd0
[Validator] fixed phpdoc.
2011-08-10 16:11:31 +02:00
hidenorigoto
275da0d478
[Validator] changed 'self' to 'static' for child class to override pattern constant
2011-08-07 15:48:14 +09:00
Fabien Potencier
b36c002fa4
[Validator] tagged the public @api
2011-07-20 10:37:57 +02:00
Deni
0f328d228b
[Validator] Fixed using the strict option in the choice validator.
2011-07-16 21:16:21 +04:00
Fabien Potencier
fe6f23163e
removed unused use statements
2011-07-12 17:58:39 +02:00
Fabien Potencier
88d915d175
[Validator] fixed Min and Max validator when the input value is not a number (now return an error message instead of an exception which does not make sense in this context)
2011-07-12 17:40:02 +02:00
Fabien Potencier
4a7b7597d8
merged branch marcw/validator-choice (PR #1577 )
...
Commits
-------
df57e0f
[Validator] Added strict option to ChoiceConstraint.
Discussion
----------
[Validator] Added strict option to ChoiceConstraint.
By default, ChoiceValidator was ensuring strict type when checking if value is present in choices. This behavior is a problem when you want to validate against integer values. As all data you will receive from a request will be typed as a string, you won't be able to validate these numeric values.
This patch solves this.
In order for being nice to developers, I've set "strict" to false by default.
2011-07-09 09:19:08 +02:00