8000 [Validator] fixed: Expressions always valid for null values by tommygnr · Pull Request #11590 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[Validator] fixed: Expressions always valid for null values #11590

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 559 commits into from
Closed
Show file tree
Hide file tree
Changes from 15 commits
Commits
Show all changes
559 commits
Select commit Hold shift + click to select a range
64ca6c3
bug #11099 [Debug] work-around https://bugs.php.net/61272 (nicolas-gr…
fabpot Jun 12, 2014
e74d37b
Merge branch '2.4' into 2.5
fabpot Jun 12, 2014
4ab34d6
Merge branch '2.5'
fabpot Jun 12, 2014
3d2dd81
[HttpKernel] Fix event dispatcher dependency
hacfi Jun 12, 2014
859f34e
Fixed undefined ImageValidator:: property when uploading an image dur…
OwlyCode Jun 12, 2014
267eaa3
bug #11111 Fixed undefined ImageValidator::$suffices property when up…
fabpot Jun 12, 2014
057c274
bug #11113 [HttpKernel] Fix event dispatcher dependency (hacfi)
fabpot Jun 12, 2014
9e3e89a
feature #8133 [Form] Add allow_extra_fields option on forms (felds)
fabpot Jun 13, 2014
aa6b08d
[Validator] Fix array notation in the PropertyPath::append()
jakzal Jun 7, 2014
88a954c
bug #11117 [Validator] Fix array notation in the PropertyPath::append…
fabpot Jun 1 8000 3, 2014
b35250f
[Process] Do not redirect output to file handles when output is disabled
romainneutron Jun 14, 2014
1b253cb
Disallow empty file in FileValidator
megazoll Jun 15, 2014
a1762fb
[HttpKernel] added value of DateTime object and objects implementing …
plandolt Jun 6, 2014
f4a087b
feature #11125 [Validator] Disallow empty file in FileValidator (mega…
fabpot Jun 16, 2014
1eed20a
feature #11086 [HttpFoundation] Added ParameterBag::getBoolean (peter…
fabpot Jun 16, 2014
fd1bfd4
bug #11121 [2.5][Process] Do not redirect output to file handles when…
fabpot Jun 16, 2014
349549c
Merge branch '2.4' into 2.5
fabpot Jun 16, 2014
074c381
Merge branch '2.5'
fabpot Jun 16, 2014
4a93d7f
feature #11070 [HttpKernel] added value of DateTime object to ValueEx…
fabpot Jun 16, 2014
839e9ac
[Debug] generalized ErrorHandler
nicolas-grekas May 26, 2014
1701447
[Debug] update FrameworkBundle and HttpKernel for new ErrorHandler
nicolas-grekas May 26, 2014
d55fe84
feature #10921 [Debug] generic ErrorHandler (nicolas-grekas)
nicolas-grekas Jun 16, 2014
6d9fd62
[FrameworkBundle] Redirect server output to /dev/null in case no verb…
romainneutron Jun 14, 2014
48ed754
[Validator] Support "maxSize" given in KiB
May 31, 2014
d217c7a
feature #11027 [Validator] Support "maxSize" given in KiB (Jérémy Der…
fabpot Jun 17, 2014
d18e758
[Translation] [Xliff] Support for <note>
May 18, 2014
6587b39
feature #10939 [Translation] [Xliff] Support for <note> (Jérémy Derussé)
fabpot Jun 17, 2014
b57024e
[Process] Add support for streams as input
romainneutron Apr 22, 2014
3b4afe7
feature #10934 [Process] Add support for streams as input (romainneut…
fabpot Jun 17, 2014
967576a
[Validator] smaller fixes for binary format
Tobion Jun 17, 2014
2025778
[Validator] no need to initialize properties with null
Tobion Jun 17, 2014
5febbb2
minor #11140 [Validator] smaller CS fixes (Tobion)
fabpot Jun 17, 2014
598d85c
minor #11122 [2.5][FrameworkBundle] Redirect server output to /dev/nu…
fabpot Jun 17, 2014
06cea08
SSI support
kingcrunch Mar 23, 2014
7bb98e2
Update WindowsPipes.php
jgonzalezlopez Jun 18, 2014
71c3a35
bug #11156 Update WindowsPipes.php (jgonzalezlopez)
romainneutron Jun 18, 2014
c117e8e
[Console] remove weird use statement
cordoval Jun 18, 2014
02614e0
[Yaml] refactoring of merges for performance
Tobion Jun 18, 2014
9fe4b88
[Console] Fixed notice in QuestionHelper
florianv Jun 18, 2014
bebd18c
bug #11170 [Console] Fixed notice in QuestionHelper (florianv)
fabpot Jun 19, 2014
8c621ab
[Yaml] fix priority of sequence merges according to spec
Tobion Jun 18, 2014
dee1562
[Yaml] fix overwriting of keys after merged map
Tobion Jun 18, 2014
cd0309f
minor #11162 [Console] remove weird use statement (cordoval)
fabpot Jun 19, 2014
83f4ac5
[HttpFoundation] ResponseHeaderBag::clearCookie now accepts secure/ht…
adrienbrault Jun 19, 2014
a50aca0
bug #11168 [YAML] fix merge node (<<) (Tobion)
fabpot Jun 20, 2014
76d3c9e
Merge branch '2.4' into 2.5
fabpot Jun 20, 2014
d38a4b3
Merge branch '2.5'
fabpot Jun 20, 2014
4450197
Merge branch '2.4' into 2.5
fabpot Jun 23, 2014
9dc55b5
Merge branch '2.5'
fabpot Jun 23, 2014
8308cfa
[Validator] Add en and ru translations for empty file message
megazoll Jun 23, 2014
e42c07b
minor #11196 [Validator] Add translation for empty file message (mega…
fabpot Jun 23, 2014
613c86d
[Validator] Added Hungarian translation for empty file
1ed Jun 24, 2014
55934aa
minor #11213 [Validator] Added Hungarian translation for empty file (…
fabpot Jun 24, 2014
0e46e91
[Validator] Added Slovenian translation for empty file
petk Jun 24, 2014
8e1f978
Add missing dot at the end of an exception message
rybakit Jun 24, 2014
ff13184
[Validator] added Japanese translation for empty file (id: 78)
issei-m Jun 25, 2014
eb5988d
minor #11214 [Validator] Added Slovenian translation for empty file (…
fabpot Jun 25, 2014
8ce7165
minor #11224 [Validator] added Japanese translation for empty file (i…
fabpot Jun 25, 2014
fc67000
Added missing dutch translation
wouterj Jun 25, 2014
3111c70
minor #11226 Added missing dutch translation (WouterJ)
fabpot Jun 25, 2014
6f881d4
Added missing Spanish translation
aeoris Jun 25, 2014
ce15db5
minor #11228 Added missing Spanish translation (Diego Agulló)
fabpot Jun 25, 2014
e712e89
[FrameworkBundle] Simplify "invokable" controllers as services
kbond Jun 21, 2014
579c465
feature #11193 [FrameworkBundle] Simplify "invokable" controllers as …
fabpot Jun 26, 2014
9567b9a
fixed CS
fabpot Jun 26, 2014
f5bf45e
[Serializer] Added a test for decoding xml with whitespaces
florianv Jun 26, 2014
8fe71a9
[Validator] Added missing Czech translation
hason Jun 27, 2014
c6b751c
minor #11243 [Validator] Added missing Czech translation (hason)
fabpot Jun 27, 2014
7212d0e
[Validator] Polish translation for "empty file" validation
stloyd Jun 27, 2014
279b5e5
minor #11247 [Validator] Polish translation for "empty file" validati…
fabpot Jun 28, 2014
a22858b
Merge branch '2.4' into 2.5
fabpot Jul 1, 2014
ab3fb14
Merge branch '2.5'
fabpot Jul 1, 2014
1951412
[Translation:update][Xliff Dumper] added target-language.
aitboudad Jun 29, 2014
585a045
Added SK translations
pulzarraider Jul 2, 2014
6a41ca0
minor #11271 [Validator] Added missing Slovak translations (pulzarrai…
fabpot Jul 2, 2014
8b54211
minor #11233 [Serializer] Added a test for decoding xml with whitespa…
fabpot Jul 4, 2014
1fff158
[HttpFoundation] Added a switch to delete file after the response is …
WybrenKoelmans Jul 4, 2014
13c011c
Added line feed to container alias description (text descriptor)
mdouailin Jul 5, 2014
7bc190a
New service to simplify password encoding
aferrandini Jul 5, 2014
f9b88c6
Improving the exception message when the bundle name is wrong for the…
weaverryan Jun 24, 2014
aae45ad
Make @inheritdoc consistent (lowercase)
hacfi Jul 5, 2014
a5f36a8
[Console] Add threshold for ProcessHelper verbosity
romainneutron Jun 17, 2014
6ca1c90
[FrameworkBundle] Use ProcessHelper for server:run command
romainneutron Jun 16, 2014
3779d71
[Debug] Fix tests on PHP 5.6
jakzal Jul 6, 2014
3466601
fix the return types
xabbuh Jul 6, 2014
605a533
minor #11337 [Process] fix the return types (xabbuh)
romainneutron Jul 7, 2014
5feb2b9
minor #11332 [Debug] Fix tests on PHP 5.6 (jakzal)
fabpot Jul 7, 2014
9d6817e
minor #11328 Make @inheritdoc consistent (lowercase) (hacfi)
fabpot Jul 7, 2014
47c686d
Merge branch '2.4' into 2.5
fabpot Jul 8, 2014
782ba96
Merge branch '2.5'
fabpot Jul 8, 2014
7a9d0b3
updated CHANGELOG for 2.5.1
fabpot Jul 8, 2014
e3d2844
updated VERSION for 2.5.1
fabpot Jul 8, 2014
f56b731
remove the scope from the output of the container:debug command
xabbuh Jul 5, 2014 8000
50a210b
bumped Symfony version to 2.5.2
fabpot Jul 8, 2014
d56b7be
[WIP][Form] Improve transformation failure message by providing prope…
jubianchi Jul 5, 2014
71286e1
feature #11318 [WIP][Form] Improve transformation failure message by …
fabpot Jul 8, 2014
adb7860
feature #11135 [FrameworkBundle] Use ProcessHelper for server:run com…
fabpot Jul 8, 2014
229828d
feature #11210 [FrameworkBundle] Improving bad bundle exception in _c…
fabpot Jul 8, 2014
17009c1
Merge branch '2.4' into 2.5
fabpot Jul 9, 2014
d941f80
Merge branch '2.5'
fabpot Jul 9, 2014
01346f7
feature #11212 [HttpFoundation] Added a switch to delete file after t…
fabpot Jul 9, 2014
cd5da9b
[Filesystem] Throw Exception on copying from an unreadable file or to…
djotto May 21, 2014
e40e325
feature #10960 [Filesystem] Throw Exception on copying from an unread…
fabpot Jul 9, 2014
fdc3fb1
[Translation:update][Xliff Dumper] Reviewed code and replaced undersc…
ClementGautier Jul 11, 2014
1ee4a41
feature #11371 [Translation:update][Xliff Dumper] added target-langua…
fabpot Jul 11, 2014
97e07d5
Check for xdebug link format via both ini_get and get_cfg_var
Jun 8, 2014
bde043d
[Validator] remove wrong deprecation message
Tobion Jul 11, 2014
8b2397c
Applyied code review
ClementGautier Jul 11, 2014
d23320f
feature #11378 Allow xdebug.file_link_format from php ini to work whe…
fabpot Jul 11, 2014
01efafe
minor #11377 [Validator] remove wrong deprecation message (Tobion)
fabpot Jul 12, 2014
9d6b20c
Added support for encoding and decoding namespaced xml (xmlns)
mattvick Aug 19, 2013
5ba40bf
server:run command: provide more error information
xabbuh Jul 13, 2014
2ac1bb4
[Console] Remove estimated field from debug_nomax
bburnichon Jul 3, 2014
7e1b4f6
bug #11284 [Console] Remove estimated field from debug_nomax (bburnic…
stof Jul 15, 2014
cd89270
Merge branch '2.4' into 2.5
fabpot Jul 15, 2014
05b2c4e
Merge branch '2.5'
fabpot Jul 15, 2014
ff4997f
Merge branch '2.4' into 2.5
fabpot Jul 15, 2014
890cd39
Merge branch '2.5'
fabpot Jul 15, 2014
ab765c9
[2.5][Form] solved dependency to ValidatorInterface, fix #11036
Jul 8, 2014
a32e819
bug #11350 [2.5][Form] solved dependency to ValidatorInterface, fix #…
fabpot Jul 15, 2014
705d67b
[2.5][Form] solved dependency to ValidatorInterface, fix #11036
Jul 8, 2014
f11da64
bug #11350 [2.5][Form] solved dependency to ValidatorInterface, fix #…
fabpot Jul 15, 2014
8805ee1
updated CHANGELOG for 2.5.2
fabpot Jul 15, 2014
e66ee96
updated VERSION for 2.5.2
fabpot Jul 15, 2014
28defa8
bumped Symfony version to 2.5.3
fabpot Jul 15, 2014
a9af6be
Merge branch '2.4' into 2.5
fabpot Jul 16, 2014
732c9e2
Merge branch '2.5'
fabpot Jul 16, 2014
afbaf19
Add compare method to Specificity
barryvdh Jul 17, 2014
b8f212d
feature #11404 [CssSelector] Add compare method to Specificity (barry…
fabpot Jul 17, 2014
e797659
fixed CS
fabpot Jul 17, 2014
98873b8
Rename Specificity->compare() to compareTo()
barryvdh Jul 18, 2014
397687f
minor #11416 [CssSelector] Rename Specificity->compare() to compareTo…
fabpot Jul 18, 2014
8be4c92
[Console] Fix test on windows
Seldaek Jul 20, 2014
ce04073
[Validator] Fixed object initializers in 2.5 version of the Validator
webmozart Jul 17, 2014
4c97420
bug #11410 [Validator] Fixed object initializers in 2.5 version of th…
webmozart Jul 21, 2014
d57471e
[Validator] Improve UserPassword message
redstar504 Jul 12, 2014
1fdd3df
minor #11383 [Validator] Improve UserPassword message (redstar504)
fabpot Jul 23, 2014
cbfcc77
minor #11430 [Console] Fix test on windows (Seldaek)
fabpot Jul 23, 2014
ee0a074
feature #11317 remove the scope from the output of the container:debu…
fabpot Jul 23, 2014
6f58674
[FrameworkBundle] changed KernelTestCase::getKernelClass() to check $…
iteman Jul 11, 2014
3f5d4c5
bug #11370 [FrameworkBundle] avoid raising unexpected RuntimeExceptio…
fabpot Jul 23, 2014
283387a
[Validator] Fixed memory leak in ValidatorBuilder
webmozart Jul 23, 2014
2fee576
[DomCrawler] Added node name getter
fejese Jul 18, 2014
2f7b702
bug #11454 [Validator] Fixed memory leak in ValidatorBuilder (webmozart)
fabpot Jul 23, 2014
da41eb1
[FrameworkBundle] improved controller name parse error message
jskvara Jul 5, 2014
b3b41d5
feature #11314 [FrameworkBundle] Improved controller class error (jsk…
fabpot Jul 24, 2014
91bf277
[Validator] Made sure that context changes don't leak out of (Context…
webmozart Jul 17, 2014
a260623
[HttpFoundation] moved test file to the right directory
fabpot Jul 24, 2014
fcb7f74
Allow exception bubbling in RememberMeListener
lstrojny Apr 27, 2014
d6d462a
[Validator] do not call getter inside ExecutionContext to prevent unn…
Tobion Jul 24, 2014
feb4f5c
Merge branch '2.4' into 2.5
fabpot Jul 24, 2014
3b837dc
Merge branch '2.5'
fabpot Jul 24, 2014
5b90572
feature #11173 [HttpFoundation] ResponseHeaderBag::clearCookie now ac…
fabpot Jul 25, 2014
d6bbf04
minor #11462 [HttpFoundation] moved test file to the right directory …
fabpot Jul 25, 2014
08529bb
feature #11385 server:run command: provide more error information (xa…
fabpot Jul 25, 2014
96cd78e
feature #11426 [DomCrawler] Added node name getter (fejese)
fabpot Jul 25, 2014
c0e4dc6
feature #11375 Added support for encoding and decoding namespaced xml…
fabpot Jul 25, 2014
21e7ad7
fixed CS
fabpot Jul 25, 2014
fb9dc6a
feature #10793 [Security] Allow exception bubbling in RememberMeListe…
fabpot Jul 25, 2014
bf140a8
feature #10702 [HttpKernel][FrameworkBundle] SSI support (KingCrunch)
fabpot Jul 25, 2014
eb48706
feature #11306 [DX] New service to simplify password encoding (aferra…
fabpot Jul 25, 2014
3666c05
minor #11305 [DX] Added line feed to container alias description (tex…
fabpot Jul 25, 2014
e4dd60a
minor #11215 [Security] Add missing dot at the end of an exception me…
fabpot Jul 25, 2014
14b60c8
[Validator] Fixed doc block
webmozart Jul 26, 2014
ff48939
[Validator] Added markObjectAsInitialized() and isObjectInitialized()…
webmozart Jul 26, 2014
a32646e
[SecurityBundle] fix constructor argument index
xabbuh Jul 26, 2014
7af2563
bug #11488 [SecurityBundle] fix constructor argument index (xabbuh)
fabpot Jul 26, 2014
e8b53e9
bug #11412 [Validator] Made sure that context changes don't leak out …
webmozart Jul 28, 2014
7e175ef
Merge branch '2.4' into 2.5
fabpot Jul 28, 2014
3e21c4d
Merge branch '2.5'
fabpot Jul 28, 2014
8e461af
[Validator] Constraint validators now use the 2.5 API. For incompatib…
webmozart Jul 24, 2014
7504448
[Validator] Added extensive test coverage for the constraint validato…
webmozart Jul 26, 2014
870a41a
[FrameworkBundle] Made ConstraintValidatorFactory aware of the legacy…
webmozart Jul 26, 2014
3bd6d80
[Validator] CS fixes
webmozart Jul 26, 2014
295e5bb
[Validator] Fixed failing tests
webmozart Jul 26, 2014
cd29962
minor #11463 [Validator] prevent unnecessary calls inside ExecutionCo…
webmozart Jul 28, 2014
8744826
Add point about ConsoleLogger to Console 2.5 changelog
JeroenDeDauw Jul 29, 2014
3ee327c
minor #11507 Add point about ConsoleLogger to Console 2.5 changelog (…
fabpot Jul 29, 2014
e238637
This files have an invalid namespace
Jul 30, 2014
b54a154
minor #11514 This files have an invalid namespace (mmoreram)
fabpot Jul 30, 2014
412f04f
[Validator] German translation for empty file errors
xabbuh Jul 31, 2014
7ee23c1
Replaced ESI mentions with SSI when appropriate
pgodel Jul 31, 2014
88eac04
Issue #11532 Translated 78 in Català
Jul 31, 2014
137db21
minor #11528 [Validator] German translation for empty file errors (xa…
fabpot Aug 1, 2014
94ff4e9
minor #11531 [HttpKernel][FrameworkBundle] Replaced ESI mentions with…
fabpot Aug 1, 2014
c812379
minor #11534 Issue #11489 Translated 78 in Català (mmoreram)
fabpot Aug 1, 2014
50791c6
[Validator] refs #11489 add some translations in french
vincentaubert Aug 2, 2014
3ecf685
minor #11546 [Validator] refs #11489 add some translations in french …
fabpot Aug 3, 2014
5f06d96
Fixed some extra empty spaces
eiannone Aug 3, 2014
ef6f5f5
[Validator] Fixed: Made it possible (again) to pass a class name to V…
webmozart Jul 28, 2014
2bf1b37
[Validator] Fixed ExpressionValidator when the validation root is not…
webmozart Jul 28, 2014
c43253e
bug #11498 [Validator] Made it possible (again) to pass a class name …
webmozart Aug 4, 2014
a6a7f5d
minor #11485 [Validator] Constraint validators now use the 2.5 API (w…
webmozart Aug 4, 2014
98c0621
Merge branch '2.4' into 2.5
webmozart Aug 5, 2014
27a2280
Merge branch '2.5'
webmozart Aug 5, 2014
6ac130e
[Form] Fixed FormValidator compatibility with the non-BC 2.5 Validati…
webmozart Aug 5, 2014
f6c070d
[Validator] Fixed group handling in composite constraints
webmozart Jul 29, 2014
09f252a
feature #11505 [Validator] Fixed group handling in composite constrai…
webmozart Aug 5, 2014
acab0a9
minor #11555 [TwigBridge] [Form] Fixed some extra empty spaces (eiann…
fabpot Aug 6, 2014
cd322c4
bug #11571 [Form] Fixed FormValidator compatibility with the non-BC 2…
fabpot Aug 6, 2014
6f07919
Merge branch '2.4' into 2.5
fabpot Aug 6, 2014
b8f6995
updated CHANGELOG for 2.5.3
fabpot Aug 6, 2014
f077a23
updated VERSION for 2.5.3
fabpot Aug 6, 2014
0c13296
bumped Symfony version to 2.5.4
fabpot Aug 6, 2014
0653426
[SecurityBundle] Added UserPasswordValidator tests for the different …
webmozart Aug 6, 2014
fba2393
minor #11585 [SecurityBundle] Added UserPasswordValidator tests for t…
webmozart Aug 6, 2014
f45f1ab
[DoctrineBridge] Changed UniqueEntityValidator to use the 2.5 Validat…
webmozart Aug 6, 2014
e844ed0
[Validator] Removed legacy validator classes
webmozart Aug 6, 2014
9a62ab3
provide a compiler pass for doctrine to register namespace aliases an…
dbu May 4, 2014
8bedf86
bug #11582 [DoctrineBridge] Changed UniqueEntityValidator to use the …
webmozart Aug 7, 2014
6b8fe14
minor #11587 [Validator] Removed legacy validator classes (webmozart)
fabpot Aug 7, 2014
d2bd92f
[Validator] Added Swedish translations
Nyholm Aug 7, 2014
56f934f
minor #11608 [Validator] Added Swedish translations (78) (Nyholm)
fabpot Aug 8, 2014
d3edc2d
feature #10853 provide a compiler pass for doctrine to register names…
fabpot Aug 8, 2014
bf7a90e
[Console] fixed output escaping when using the process helper
fabpot Aug 7, 2014
3baea1f
bug #11610 [Console] fixed output escaping when using the process hel…
fabpot Aug 8, 2014
5ca28c0
Merge branch '2.4' into 2.5
fabpot A 8000 ug 8, 2014
dcce035
add symfony/yaml suggestion to composer.json
xabbuh Aug 8, 2014
19f3b47
resolve parameters before the configs are processed
xabbuh Aug 9, 2014
2cf1205
minor #11623 add symfony/yaml suggestion to composer.json (xabbuh)
fabpot Aug 9, 2014
fd0e229
Move debug commands to debug namespace
Aug 9, 2014
fe2f007
fix dependencies on HttpFoundation component
xabbuh Aug 11, 2014
7283483
bug #11625 [FrameworkBundle] resolve parameters before the configs ar…
fabpot Aug 11, 2014
b8c0a12
[Validator] Fix little typo in ExecutionContextInterface::buildViolat…
Aug 12, 2014
1ce0ad5
minor #11656 [Validator] Fix little typo in ExecutionContextInterface…
webmozart Aug 12, 2014
479c833
[FrameworkBundle] Added Crontoller::isCsrfTokenValid
lyrixx Aug 7, 2014
9680c35
minor #11627 [FrameworkBundle] [TwigBundle] Move debug commands to de…
nicolas-grekas Aug 13, 2014
136c5cb
feature #11602 [DX] [FrameworkBundle] Added Crontoller::isCsrfTokenVa…
nicolas-grekas Aug 13, 2014
8c22211
bug #11637 fix dependencies on HttpFoundation component (xabbuh)
nicolas-grekas Aug 13, 2014
7f4f9ab
[DIC] Fixed: anonymous services are always private
lyrixx Aug 13, 2014
35994bf
bug #11666 [DIC] Fixed: anonymous services are always private (lyrixx)
nicolas-grekas Aug 14, 2014
0801a3a
Merge branch '2.4' into 2.5
webmozart Aug 14, 2014
8725243
Merge branch '2.5'
webmozart Aug 14, 2014
a74b758
[FrameworkBundle] Fixed validator factory definition when the Validat…
webmozart Aug 6, 2014
ff74f4e
[Form] Fixed ValidatorExtension to work with the 2.5 Validation API
webmozart Aug 8, 2014
cf8b4e2
bug #11645 [Form] Fixed ValidatorExtension to work with the 2.5 Valid…
webmozart Aug 15, 2014
de871dc
Merge branch '2.4' into 2.5
nicolas-grekas Aug 18, 2014
7f38207
Merge branch '2.5'
nicolas-grekas Aug 18, 2014
beca900
[HttpFoundation] MongoDbSessionHandler supports auto expiry via confi…
catchamonkey Jul 29, 2014
73c7eae
feature #11668 [HttpFoundation] MongoDbSessionHandler supports auto e…
nicolas-grekas Aug 18, 2014
d405f43
[Validator] Fixed Constraint class to not destroy custom groups upon …
webmozart Aug 18, 2014
bb9552f
bug #11584 [FrameworkBundle] Fixed validator factory definition when …
webmozart Aug 18, 2014
a6beede
bug #11691 [Validator] Fixed Constraint class to not destroy custom g…
webmozart Aug 19, 2014
59cd05f
Merge branch '2.4' into 2.5
webmozart Aug 19, 2014
fb97786
[Validator] Fixed missing use statements
webmozart Aug 19, 2014
1d7599d
Merge branch '2.5'
webmozart Aug 19, 2014
ce1d209
[Validator] Added ConstraintViolation::getConstraint()
webmozart Aug 12, 2014
2293556
feature #11657 [Validator] Added ConstraintViolation::getConstraint()…
webmozart Aug 19, 2014
e13aa6e
[Validator] fixed: Expressions always valid for null values
tommygnr Aug 6, 2014
cae9836
Add tests
tommygnr Aug 7, 2014
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -741,6 +741,7 @@ private function registerValidationConfiguration(array $config, ContainerBuilder
switch ($config['api']) {
case '2.4':
$api = Validation::API_VERSION_2_4;
$container->setParameter('validator.validator_factory.class', $container->getParameter('validator.legacy_validator_factory.class'));
break;
case '2.5':
$api = Validation::API_VERSION_2_5;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
<parameter key="validator.mapping.cache.apc.class">Symfony\Component\Validator\Mapping\Cache\ApcCache</parameter>
<parameter key="validator.mapping.cache.prefix" />
<parameter key="validator.validator_factory.class">Symfony\Bundle\FrameworkBundle\Validator\ConstraintValidatorFactory</parameter>
<parameter key="validator.legacy_validator_factory.class">Symfony\Bundle\FrameworkBundle\Validator\LegacyConstraintValidatorFactory</parameter>
<parameter key="validator.expression.class">Symfony\Component\Validator\Constraints\ExpressionValidator</parameter>
<parameter key="validator.email.class">Symfony\Component\Validator\Constraints\EmailValidator</parameter>
</parameters>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
<?php

/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

namespace Symfony\Bundle\FrameworkBundle\Validator;

use Symfony\Component\DependencyInjection\ContainerInterface;
use Symfony\Component\Validator\Constraint;
use Symfony\Component\Validator\ConstraintValidatorFactoryInterface;
use Symfony\Component\Validator\ConstraintValidatorInterface;
use Symfony\Component\Validator\Exception\UnexpectedTypeException;

/**
* Like {@link ConstraintValidatorFactory}, but aware of services compatible
* with the 2.4 API.
*
* @author Bernhard Schussek <bschussek@gmail.com>
* @author Kris Wallsmith <kris@symfony.com>
*
* @see ConstraintValidatorFactory
*/
class LegacyConstraintValidatorFactory implements ConstraintValidatorFactoryInterface
{
const BASE_NAMESPACE = 'Symfony\\Component\\Validator\\Constraints';

protected $container;
protected $validators;

/**
* Constructor.
*
* @param ContainerInterface $container The service container
* @param array $validators An array of validators
*/
public function __construct(ContainerInterface $container, array $validators = array())
{
$this->container = $container;
$this->validators = $validators;
}

/**
* Returns the validator for the supplied constraint.
*
* @param Constraint $constraint A constraint
*
* @return ConstraintValidatorInterface A validator for the supplied constraint
*
* @throws UnexpectedTypeException When the validator is not an instance of ConstraintValidatorInterface
*/
public function getInstance(Constraint $constraint)
{
$name = $constraint->validatedBy();

if (!isset($this->validators[$name])) {
switch (get_class($constraint)) {
case self::BASE_NAMESPACE.'\\All':
$name = self::BASE_NAMESPACE.'\\LegacyAllValidator';
break;
case self::BASE_NAMESPACE.'\\Choice':
$name = self::BASE_NAMESPACE.'\\LegacyChoiceValidator';
break;
case self::BASE_NAMESPACE.'\\Collection':
$name = self::BASE_NAMESPACE.'\\LegacyCollectionValidator';
break;
case self::BASE_NAMESPACE.'\\Count':
$name = self::BASE_NAMESPACE.'\\LegacyCountValidator';
break;
case self::BASE_NAMESPACE.'\\Length':
$name = self::BASE_NAMESPACE.'\\LegacyLengthValidator';
break;
}

$this->validators[$name] = new $name();
} elseif (is_string($this->validators[$name])) {
$this->validators[$name] = $this->container->get($this->validators[$name]);
}

if (!$this->validators[$name] instanceof ConstraintValidatorInterface) {
throw new UnexpectedTypeException($this->validators[$name], 'Symfony\Component\Validator\ConstraintValidatorInterface');
}

return $this->validators[$name];
}
}
1 change: 1 addition & 0 deletions src/Symfony/Component/Console/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ CHANGELOG
* deprecated the dialog helper (use the question helper instead)
* deprecated TableHelper in favor of Table
* deprecated ProgressHelper in favor of ProgressBar
* added ConsoleLogger
* added a question helper
* added a way to set the process name of a command
* added a way to set a default command instead of `ListCommand`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ protected function comparePasswords($password1, $password2)
/**
* Checks if the password is too long.
*
* @param string $password The password
* @param string $password The password to check
*
* @return bool true if the password is too long, false otherwise
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ public function testConstructorWithObjectDenormalize()
$data = new \stdClass();
$data->foo = 'foo';
$data->bar = 'bar';
$data->baz = true;
$data->fooBar = 'foobar';
$obj = $this->normalizer->denormalize($data, __NAMESPACE__.'\GetConstructorDummy', 'any');
$this->assertEquals('foo', $obj->getFoo());
Expand Down
5 changes: 2 additions & 3 deletions src/Symfony/Component/Validator/Constraints/AllValidator.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,10 @@ public function validate($value, Constraint $constraint)

$context = $this->context;
$group = $context->getGroup();
$validator = $context->getValidator()->inContext($context);

foreach ($value as $key => $element) {
foreach ($constraint->constraints as $constr) {
$context->validateValue($element, $constr, '['.$key.']', $group);
}
$validator->atPath('['.$key.']')->validate($element, $constraint->constraints, $group);
}
}
}
26 changes: 14 additions & 12 deletions src/Symfony/Component/Validator/Constraints/ChoiceValidator.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,33 +63,35 @@ public function validate($value, Constraint $constraint)
if ($constraint->multiple) {
foreach ($value as $_value) {
if (!in_array($_value, $choices, $constraint->strict)) {
$this->context->addViolation($constraint->multipleMessage, array(
'{{ value }}' => $this->formatValue($_value),
));
$this->context->buildViolation($constraint->multipleMessage)
->setParameter('{{ value }}', $this->formatValue($_value))
->addViolation();
}
}

$count = count($value);

if ($constraint->min !== null && $count < $constraint->min) {
$this->context->addViolation($constraint->minMessage, array(
'{{ limit }}' => $constraint->min
), null, (int) $constraint->min);
$this->context->buildViolation($constraint->minMessage)
->setParameter('{{ limit }}', $constraint->min)
->setPlural((int) $constraint->min)
->addViolation();

return;
}

if ($constraint->max !== null && $count > $constraint->max) {
$this->context->addViolation($constraint->maxMessage, array(
'{{ limit }}' => $constraint->max
), null, (int) $constraint->max);
$this->context->buildViolation($constraint->maxMessage)
->setParameter('{{ limit }}', $constraint->max)
->setPlural((int) $constraint->max)
->addViolation();

return;
}
} elseif (!in_array($value, $choices, $constraint->strict)) {
$this->context->addViolation($constraint->message, array(
'{{ value }}' => $this->formatValue($value)
));
$this->context->buildViolation($constraint->message)
->setParameter('{{ value }}', $this->formatValue($value))
->addViolation();
}
}
}
32 changes: 19 additions & 13 deletions src/Symfony/Component/Validator/Constraints/CollectionValidator.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,29 +50,35 @@ public function validate($value, Constraint $constraint)
// to validate() instead.
$context = $this->context;
$group = $context->getGroup();
$validator = $context->getValidator()->inContext($context);

foreach ($constraint->fields as $field => $fieldConstraint) {
if (
// bug fix issue #2779
(is_array($value) && array_key_exists($field, $value)) ||
($value instanceof \ArrayAccess && $value->offsetExists($field))
) {
foreach ($fieldConstraint->constraints as $constr) {
$context->validateValue($value[$field], $constr, '['.$field.']', $group);
// bug fix issue #2779
$existsInArray = is_array($value) && array_key_exists($field, $value);
$existsInArrayAccess = $value instanceof \ArrayAccess && $value->offsetExists($field);

if ($existsInArray || $existsInArrayAccess) {
if (count($fieldConstraint->constraints) > 0) {
$validator->atPath('['.$field.']')
->validate($value[$field], $fieldConstraint->constraints, $group);
}
} elseif (!$fieldConstraint instanceof Optional && !$constraint->allowMissingFields) {
$context->addViolationAt('['.$field.']', $constraint->missingFieldsMessage, array(
'{{ field }}' => $this->formatValue($field)
), null);
$context->buildViolation($constraint->missingFieldsMessage)
->atPath('['.$field.']')
->setParameter('{{ field }}', $this->formatValue($field))
->setInvalidValue(null)
->addViolation();
}
}

if (!$constraint->allowExtraFields) {
foreach ($value as $field => $fieldValue) {
if (!isset($constraint->fields[$field])) {
$context->addViolationAt('['.$field.']', $constraint->extraFieldsMessage, array(
'{{ field }}' => $this->formatValue($field)
), $fieldValue);
$context->buildViolation($constraint->extraFieldsMessage)
->atPath('['.$field.']')
->setParameter('{{ field }}', $this->formatValue($field))
->setInvalidValue($fieldValue)
->addViolation();
}
}
}
Expand Down
30 changes: 18 additions & 12 deletions src/Symfony/Component/Validator/Constraints/CountValidator.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,28 +36,34 @@ public function validate($value, Constraint $constraint)
$count = count($value);

if ($constraint->min == $constraint->max && $count != $constraint->min) {
$this->context->addViolation($constraint->exactMessage, array(
'{{ count }}' => $count,
'{{ limit }}' => $constraint->min,
), $value, (int) $constraint->min);
$this->context->buildViolation($constraint->exactMessage)
->setParameter('{{ count }}', $count)
->setParameter('{{ limit }}', $constraint->min)
->setInvalidValue($value)
->setPlural((int) $constraint->min)
->addViolation();

return;
}

if (null !== $constraint->max && $count > $constraint->max) {
$this->context->addViolation($constraint->maxMessage, array(
'{{ count }}' => $count,
'{{ limit }}' => $constraint->max,
), $value, (int) $constraint->max);
$this->context->buildViolation($constraint->maxMessage)
->setParameter('{{ count }}', $count)
->setParameter('{{ limit }}', $constraint->max)
->setInvalidValue($value)
->setPlural((int) $constraint->max)
->addViolation();

return;
}

if (null !== $constraint->min && $count < $constraint->min) {
$this->context->addViolation($constraint->minMessage, array(
'{{ count }}' => $count,
'{{ limit }}' => $constraint->min,
), $value, (int) $constraint->min);
$this->context->buildViolation($constraint->minMessage)
->setParameter('{{ count }}', $count)
->setParameter('{{ limit }}', $constraint->min)
->setInvalidValue($value)
->setPlural((int) $constraint->min)
->addViolation();
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,9 @@ public function validate($value, Constraint $constraint)
$value = (string) $value;

if (!preg_match(static::PATTERN, $value, $matches) || !checkdate($matches[2], $matches[3], $matches[1])) {
$this->context->addViolation($constraint->message, array('{{ value }}' => $value));
$this->context->addViolation($constraint->message, array(
'{{ value }}' => $this->formatValue($value),
));
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -74,14 +74,18 @@ public function validate($value, Constraint $constraint)
$variables['value'] = $value;
$variables['this'] = $value;
} else {
// Extract the object that the property belongs to from the object
// graph
$path = new PropertyPath($this->context->getPropertyPath());
$parentPath = $path->getParent();
$root = $this->context->getRoot();

$variables['value'] = $value;
$variables['this'] = $parentPath ? $this->getPropertyAccessor()->getValue($root, $parentPath) : $root;

if (is_object($root)) {
// Extract the object that the property belongs to from the object
// graph
$path = new PropertyPath($this->context->getPropertyPath());
$parentPath = $path->getParent();
$variables['this'] = $parentPath ? $this->getPropertyAccessor()->getValue($root, $parentPath) : $root;
} else {
$variables['this'] = null;
}
}

if (!$this->getExpressionLanguage()->evaluate($constraint->expression, $variables)) {
Expand Down
8 changes: 4 additions & 4 deletions src/Symfony/Component/Validator/Constraints/FileValidator.php
Original file line number Diff line number Diff line change
Expand Up @@ -156,10 +156,10 @@ public function validate($value, Constraint $constraint)
}

$this->context->addViolation($constraint->maxSizeMessage, array(
'{{ size }}' => $sizeAsString,
'{{ limit }}' => $limitAsString,
'{{ suffix }}' => self::$suffices[$coef],
'{{ file }}' => $path,
'{{ size }}' => $sizeAsString,
'{{ limit }}' => $limitAsString,
'{{ suffix }}' => self::$suffices[$coef],
'{{ file }}' => $this->formatValue($path),
));

return;
Expand Down
Loading
0