- deprecated
ApcCache
in favor ofDoctrineCache
- added
DoctrineCache
to adapt any Doctrine cache
- added a constraint the uses the expression language
- added
minRatio
,maxRatio
,allowSquare
,allowLandscape
, andallowPortrait
to Image validator
- added the ISBN, ISSN, and IBAN validators
- copied the constraints
Optional
andRequired
to theSymfony\Component\Validator\Constraints\
namespace and deprecated the original classes. - added comparison validators (EqualTo, NotEqualTo, LessThan, LessThanOrEqualTo, GreaterThan, GreaterThanOrEqualTo, IdenticalTo, NotIdenticalTo)
- added a CardScheme validator
- added a Luhn validator
- moved @api-tags from
Validator
toValidatorInterface
- moved @api-tags from
ConstraintViolation
to the newConstraintViolationInterface
- moved @api-tags from
ConstraintViolationList
to the newConstraintViolationListInterface
- moved @api-tags from
ExecutionContext
to the newExecutionContextInterface
- [BC BREAK]
ConstraintValidatorInterface::initialize
is now type hinted againstExecutionContextInterface
instead ofExecutionContext
- [BC BREAK] changed the visibility of the properties in
Validator
from protected to private - deprecated
ClassMetadataFactoryInterface
in favor of the newMetadataFactoryInterface
- deprecated
ClassMetadataFactory::getClassMetadata
in favor ofgetMetadataFor
- created
MetadataInterface
,PropertyMetadataInterface
,ClassBasedInterface
andPropertyMetadataContainerInterface
- deprecated
GraphWalker
in favor of the newValidationVisitorInterface
- deprecated
ExecutionContext::addViolationAtPath
- deprecated
ExecutionContext::addViolationAtSubPath
in favor ofExecutionContextInterface::addViolationAt
- deprecated
ExecutionContext::getCurrentClass
in favor ofExecutionContextInterface::getClassName
- deprecated
ExecutionContext::getCurrentProperty
in favor ofExecutionContextInterface::getPropertyName
- deprecated
ExecutionContext::getCurrentValue
in favor ofExecutionContextInterface::getValue
- deprecated
ExecutionContext::getGraphWalker
in favor ofExecutionContextInterface::validate
andExecutionContextInterface::validateValue
- improved
ValidatorInterface::validateValue
to accept arrays of constraints - changed
ValidatorInterface::getMetadataFactory
to return aMetadataFactoryInterface
instead of aClassMetadataFactoryInterface
- removed
ClassMetadataFactoryInterface
type hint fromValidatorBuilderInterface::setMetadataFactory
. As of Symfony 2.3, this method will be typed againstMetadataFactoryInterface
instead. - [BC BREAK] the switches
traverse
anddeep
in theValid
constraint and inGraphWalker::walkReference
are ignored for arrays now. Arrays are always traversed recursively. - added dependency to Translation component
- violation messages are now translated with a TranslatorInterface implementation
- [BC BREAK] inserted argument
$message
in the constructor ofConstraintViolation
- [BC BREAK] inserted arguments
$translator
and$translationDomain
in the constructor ofExecutionContext
- [BC BREAK] inserted arguments
$translator
and$translationDomain
in the constructor ofGraphWalker
- [BC BREAK] inserted arguments
$translator
and$translationDomain
in the constructor ofValidationVisitor
- [BC BREAK] inserted arguments
$translator
and$translationDomain
in the constructor ofValidator
- [BC BREAK] added
setTranslator()
andsetTranslationDomain()
toValidatorBuilderInterface
- improved the Validator to support pluralized messages by default
- [BC BREAK] changed the source of all pluralized messages in the translation files to the pluralized version
- added ExceptionInterface, BadMethodCallException and InvalidArgumentException
- added support for
ctype_*
assertions inTypeValidator
- improved the ImageValidator with min width, max width, min height, and max height constraints
- added support for MIME with wildcard in FileValidator
- changed Collection validator to add "missing" and "extra" errors to individual fields
- changed default value for
extraFieldsMessage
andmissingFieldsMessage
in Collection constraint - made ExecutionContext immutable
- deprecated Constraint methods
setMessage
,getMessageTemplate
andgetMessageParameters
- added support for dynamic group sequences with the GroupSequenceProvider pattern
- [BC BREAK] ConstraintValidatorInterface method
isValid
has been renamed tovalidate
, its return value was dropped. ConstraintValidator still containsisValid
for BC - [BC BREAK] collections in fields annotated with
Valid
are not traversed recursively anymore by default.Valid
contains a new propertydeep
which enables the BC behavior. - added Count constraint
- added Length constraint
- added Range constraint
- deprecated the Min and Max constraints
- deprecated the MinLength and MaxLength constraints
- added Validation and ValidatorBuilderInterface
- deprecated ValidatorContext, ValidatorContextInterface and ValidatorFactory