Skip to content

[FrameworkBundle] add config translator cache_dir #32543

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

Merged
merged 550 commits into from
Aug 4, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
550 commits
Select commit Hold shift + click to select a range
3e2ee71
feature #32423 [ServerBundle] Display all logs by default (lyrixx)
fabpot Jul 8, 2019
14614bd
feature #32284 [Cache] Add argument $prefix to AdapterInterface::clea…
fabpot Jul 8, 2019
87a6f04
feature #31554 [SECURITY] AbstractAuthenticationListener.php error in…
fabpot Jul 8, 2019
15ba579
[Console] Added Application::reset()
lyrixx Jul 8, 2019
400eaa6
feature #31217 [WebserverBundle] Deprecate the bundle in favor of sym…
fabpot Jul 8, 2019
7647209
feature #32418 [Console] Added Application::reset() (lyrixx)
fabpot Jul 8, 2019
df551e9
[Console] don't redraw progress bar more than every 100ms by default
nicolas-grekas Jul 8, 2019
ea0da05
feature #32424 [Console] don't redraw progress bar more than every 10…
fabpot Jul 8, 2019
2d04e20
bug #32056 [DI] deprecate booting the kernel twices (Simperfit)
fabpot Jul 8, 2019
527bf89
Fix missing deprecations
yceruto Jul 8, 2019
2b50990
[Validator] Allow to use property paths to get limits in range constr…
Lctrs May 16, 2019
e1cea97
feature #31511 [Validator] Allow to use property paths to get limits …
fabpot Jul 8, 2019
350ec6c
minor #32428 [Stopwatch] Fix missing deprecations (yceruto)
fabpot Jul 8, 2019
d243058
[VarDumper] Let browsers trigger their own search on double CMD/CTRL …
ogizanagi Jul 8, 2019
91fcbea
[Lock] Split \"StoreInterface\" into multiple interfaces with less re…
Simperfit Jun 25, 2019
608d428
feature #32198 [Lock] Split "StoreInterface" into multiple interfaces…
fabpot Jul 8, 2019
d9aace2
fixed CS
fabpot Jul 8, 2019
29654a4
feature #32429 [VarDumper] Let browsers trigger their own search on d…
fabpot Jul 8, 2019
2c5089b
[Lock] Fix tests
Simperfit Jul 8, 2019
f1dff5e
minor #32434 [Lock] Fix tests (Simperfit)
fabpot Jul 8, 2019
eda49e2
[Debug] Restoring back the state of the Debug component (1st step)
yceruto Jul 4, 2019
4a50400
minor #32377 [Debug] Restoring back the state of the Debug component …
nicolas-grekas Jul 9, 2019
fc75eb9
[Lock] rename and deprecate Factory into LockFactory
Simperfit Jul 9, 2019
c16fcc9
Dynamic bundle assets
garak Jun 20, 2019
de710f6
feature #31975 Dynamic bundle assets (garak)
fabpot Jul 9, 2019
4078686
feature #32446 [Lock] rename and deprecate Factory into LockFactory (…
fabpot Jul 9, 2019
f1e98f2
[Lock] minor: add missing alias for PersistenStoreInterface
Simperfit Jul 9, 2019
3424610
minor #32449 [Lock] minor: add missing alias for PersistStoreInterfac…
fabpot Jul 9, 2019
41de633
[Lock][Console] bump lock requirement in console
Simperfit Jul 9, 2019
ac7938b
minor #32450 [Lock][Console] bump lock requirement in console (Simper…
fabpot Jul 9, 2019
9d72505
[Validator] Fix Changelog for #31511
Lctrs Jul 9, 2019
8935ea5
minor #32451 [Validator] Fix Changelog for #31511 (Lctrs)
fabpot Jul 9, 2019
2e81e45
Deprecating templateExists method
yceruto Jul 9, 2019
d3c17f2
feature #32462 [WebProfilerBundle] Deprecating templateExists method …
fabpot Jul 9, 2019
a060642
Replace missing message parameter
Jul 10, 2019
2e5a8c8
Merge branch '4.3' into 4.4
nicolas-grekas Jul 10, 2019
d1a0ca6
[LDAP] add new option implemented in php 7.1
Simperfit Jul 9, 2019
fb5b042
Rename ErrorCatcher to ErrorRenderer (rendering part only)
yceruto Jul 9, 2019
4499e2a
feature #32470 Rename ErrorCatcher to ErrorRenderer (rendering part o…
nicolas-grekas Jul 11, 2019
ea92f38
Fix root composer.json
nicolas-grekas Jul 11, 2019
390c9a6
Remove experimental notice from components
teohhanhui Jul 10, 2019
d7d2eac
remove invalid test cases
xabbuh Jul 11, 2019
f4f5ea6
minor #32498 [Validator] remove invalid test cases (xabbuh)
nicolas-grekas Jul 11, 2019
c4568d1
minor #32478 Remove experimental notice from components (teohhanhui)
fabpot Jul 12, 2019
4ab2f99
[Bundles] Rename getPublicPath() as getPublicDir()
javiereguiluz Jul 9, 2019
adcd643
minor #32452 [Bundles] Rename getPublicPath() as getPublicDir() (javi…
fabpot Jul 12, 2019
8c1f61f
fixed CS
fabpot Jul 12, 2019
aefb8bd
minor #32447 [LDAP] add new option implemented in php 7.1 (Simperfit)
fabpot Jul 12, 2019
c5488bc
[Validator] Add a new constraint message when there is both min and max
Lctrs Jul 8, 2019
fd3ad65
feature #32435 [Validator] Add a new constraint message when there is…
fabpot Jul 12, 2019
6f73e62
minor #32476 Add missing message parameter (apfelbox)
fabpot Jul 12, 2019
03b0284
fixed CS
fabpot Jul 12, 2019
871ca37
Added Nl translations
JoppeDC Jul 12, 2019
0f1ad9b
minor #32509 Added Nl translations (JoppeDC)
fabpot Jul 12, 2019
24b7fef
fix typo
xabbuh Jul 13, 2019
fa317f2
fix some deprecations and add upgrade instructions
xabbuh Jul 13, 2019
06930ac
minor #32533 fix some deprecations and add upgrade instructions (xabbuh)
fabpot Jul 15, 2019
95e8a65
fixed CS
fabpot Jul 15, 2019
5f30168
[Lock] add aliases for LockFactory
Simperfit Jul 12, 2019
f90a9fd
Improve errors when trying to find a writable property
pierredup Apr 22, 2019
9ab4f14
feature #31194 [PropertyAccess] Improve errors when trying to find a …
fabpot Jul 15, 2019
e9ab234
minor #32508 [Lock] add aliases for LockFactory (Simperfit)
nicolas-grekas Jul 15, 2019
613dbb2
[VarDumper] Allow to configure VarDumperTestTrait casters & flags
ogizanagi Jul 9, 2019
52e9fb9
Merge branch '4.3' into 4.4
fabpot Jul 16, 2019
2e03f9d
[Mailer] added XML configuration for the mailer envelope
fabpot Jul 16, 2019
90e46ab
[HttpClient] make toStream() throw by default
nicolas-grekas Jul 16, 2019
da6cbab
bug #32556 [Mailer] Add XML configuration for the mailer envelope (fa…
fabpot Jul 16, 2019
af309b0
minor #32557 [HttpClient] make toStream() throw by default (nicolas-g…
fabpot Jul 16, 2019
9988844
[Lock] remove uusage of the StoreInterface
Simperfit Jul 16, 2019
5b9cded
Add transport factories (closes #31385, closes #32523)
Koc Jun 5, 2019
e5ad989
feature #31946 [Mailer] Extract transport factory and allow create cu…
fabpot Jul 17, 2019
25f1804
minor #32562 [Lock] remove usage of the StoreInterface (Simperfit)
fabpot Jul 17, 2019
ffb22ef
[WebProfilerBundle] Remove unneeded information in the routing panel
javiereguiluz Jul 17, 2019
22150bc
[Process] Path resolution for FCGI configuration
romantymoshyk Jul 17, 2019
f900c97
bug #32570 [WebProfilerBundle] Remove unneeded information in the rou…
fabpot Jul 17, 2019
c893986
[DI] Allow dumping the container in one file instead of many files
nicolas-grekas Jul 17, 2019
ba988ac
feature #32463 [VarDumper] Allow to configure VarDumperTestTrait cast…
nicolas-grekas Jul 17, 2019
b1b6e80
Add a new ErrorHandler component (mirror of the Debug component)
yceruto Jul 10, 2019
9ed1dd1
feature #32471 Add a new ErrorHandler component (mirror of the Debug …
fabpot Jul 18, 2019
6f78ad8
minor #32573 [Process] Path resolution for FCGI configuration (roman…
fabpot Jul 18, 2019
c8eed54
fixed missing license
fabpot Jul 18, 2019
d2f33d2
[Mailer] added debug info for HTTP mailers
fabpot Jul 17, 2019
2887724
[Mailer] fixed logic
fabpot Jul 18, 2019
ed0b361
Merge branch '4.3' into 4.4
nicolas-grekas Jul 18, 2019
fcb3309
fix merge
nicolas-grekas Jul 18, 2019
fded3cd
[Mailer] added support ffor debug info when using SMTP
fabpot Jul 17, 2019
3849e1c
feature #32583 [Mailer] Logger vs debug mailer (fabpot)
fabpot Jul 18, 2019
8173c47
[Lock] feature: lock split interface fix post-merge review
Simperfit Jul 11, 2019
e80d405
minor #32492 [Lock] feature: lock split interface fix post-merge revi…
nicolas-grekas Jul 18, 2019
1d3db3d
Merge branch '4.3' into 4.4
nicolas-grekas Jul 18, 2019
af9bad3
[Process] Deprecate Process::inheritEnvironmentVariables()
ogizanagi Jul 10, 2019
b07933d
feature #32475 [Process] Deprecate Process::inheritEnvironmentVariabl…
nicolas-grekas Jul 18, 2019
88196ef
[DI] Move non removing compiler passes to after removing passes
alexpott Jul 3, 2019
c9b149c
feature #32332 [DI] Move non removing compiler passes to after removi…
fabpot Jul 18, 2019
d3a50d6
Merge branch '4.3' into 4.4
nicolas-grekas Jul 18, 2019
edd4a74
[Mailer] fix merge
nicolas-grekas Jul 18, 2019
0d8f5fe
Merge branch '4.3' into 4.4
nicolas-grekas Jul 19, 2019
8c24a53
[Mailer][DX] Improve exception message for unsupported scheme
Koc Jul 16, 2019
7dfc97b
minor #32608 [Mailer][DX] Improve exception message for unsupported s…
fabpot Jul 22, 2019
f84c71b
Remove hack to access class scope inside closures
carusogabriel Jul 22, 2019
b28986f
Making debug = false by default and cleanup
yceruto Jul 22, 2019
e726161
minor #32648 Remove hack to access class scope inside closures (carus…
Tobion Jul 22, 2019
b946b11
[Form] Repeat preferred choices in the main list
Seb33300 Jul 27, 2017
475c7a4
adapt tests
xabbuh Jul 22, 2019
1548101
[Routing] Deprecate ServiceRouterLoader and ObjectRouteLoader in favo…
fancyweb Jul 17, 2019
710b51d
Fixed the priority order of the error renderers registration
yceruto Jul 22, 2019
41c530f
minor #32660 [ErrorRenderer] Making debug = false by default and clea…
Tobion Jul 22, 2019
759f91c
minor #32659 [ErrorRenderer] Fixed the priority order of the error re…
Tobion Jul 22, 2019
5d76eb7
[ErrorRenderer] Improving the exception page provided by HtmlErrorRen…
yceruto Jul 22, 2019
12f99c0
feature #32661 [ErrorRenderer] Improving the exception page provided …
fabpot Jul 23, 2019
c6daa61
[Lock] Add missing changelog entry for Factory deprecation
Simperfit Jul 23, 2019
2ab1521
minor #32671 [Lock] Add missing changelog entry for Factory deprecati…
nicolas-grekas Jul 23, 2019
396f4be
feature #32582 [Routing] Deprecate ServiceRouterLoader and ObjectRout…
nicolas-grekas Jul 23, 2019
a688787
Merge branch '4.3' into 4.4
nicolas-grekas Jul 23, 2019
699a88b
[Lock] remove all mention to StoreInterface in comments and tests
Simperfit Jul 23, 2019
cc25ab1
minor #32678 [Lock] remove all mention to StoreInterface in comments …
nicolas-grekas Jul 23, 2019
542f42f
Merge branch '4.3' into 4.4
nicolas-grekas Jul 23, 2019
a7852c0
Merge branch '4.3' into 4.4
nicolas-grekas Jul 23, 2019
33ed4e4
[HttpClient] rewind streams created from strings
nicolas-grekas Jul 23, 2019
846d3e0
Decoupling TwigBundle and using the new ErrorRenderer mechanism
yceruto Jul 23, 2019
bf0c24a
Deprecating error templates for non-html formats and using ErrorRenderer
yceruto Jul 22, 2019
a6bef5e
Allow disabling debug content in debug mode (preview mode)
yceruto Jul 23, 2019
379b525
minor #32693 [ErrorRenderer] Allow disabling debug content in debug m…
Tobion Jul 24, 2019
4045a13
feature #31398 [TwigBundle] Deprecating error templates for non-html …
Tobion Jul 24, 2019
35b0d57
[WebProfilerBundle] mark all classes as internal
Tobion Jul 24, 2019
e4fc5c0
[Messenger][Profiler] Remove cutting caster to dump full objects
ogizanagi Jul 23, 2019
fad4104
bug #32691 [HttpClient] rewind streams created from strings (nicolas-…
fabpot Jul 24, 2019
f492ba5
feature #32695 [WebProfilerBundle] Decoupling TwigBundle and using th…
fabpot Jul 24, 2019
cf4d945
feature #32698 [WebProfilerBundle] mark all classes as internal (Tobion)
fabpot Jul 24, 2019
6f648c9
minor #32681 [Messenger][Profiler] Remove cutting caster to dump full…
nicolas-grekas Jul 24, 2019
5af1a90
feature #32658 [Form] repeat preferred choices in list of all choices…
nicolas-grekas Jul 24, 2019
5a7b737
[Form][Validator] Generate accept attribute with file constraint and …
Coosos Jul 17, 2019
71687e0
feature #32587 [Form][Validator] Generate accept attribute with file …
nicolas-grekas Jul 24, 2019
5db58f6
Merge branch '4.3' into 4.4
nicolas-grekas Jul 24, 2019
ce61879
fix expected exception message regex
xabbuh Jul 24, 2019
c7a09dc
minor #32721 [PropertyAccess] fix expected exception message regex (x…
xabbuh Jul 24, 2019
4260c3b
Merge branch '4.3' into 4.4
xabbuh Jul 24, 2019
3304e57
skip updated ChoiceType tests on older versions
xabbuh Jul 24, 2019
39c98b9
use a reference date to handle times during DST
xabbuh Jul 24, 2019
a86cdb5
minor #32725 [Form] skip updated ChoiceType tests on older versions (…
xabbuh Jul 24, 2019
9a5003e
Merge branch '4.3' into 4.4
xabbuh Jul 24, 2019
eda4f01
[Mailer][DX][RFC] Rename mailer bridge transport classes
Koc Jul 18, 2019
fc14cb7
feature #32609 [Mailer][DX][RFC] Rename mailer bridge transport class…
fabpot Jul 25, 2019
8f13fc0
[ErrorHandler] Decouple from ErrorRenderer component
yceruto Jul 20, 2019
f6e93de
feature #32637 [ErrorHandler] Decouple from ErrorRenderer component (…
fabpot Jul 25, 2019
28a7ab8
[TwigBundle] Update tests inline with master version
yceruto Jul 25, 2019
ba24a51
Rename the new exception controller and mark it as internal
yceruto Jul 25, 2019
c6a9e7a
minor #32740 [TwigBundle] Update tests inline with master version (yc…
Tobion Jul 25, 2019
a28609c
minor #32741 [WebProfilerBundle] Rename the new exception controller …
Tobion Jul 25, 2019
86440a4
feature #32718 [Form] use a reference date to handle times during DST…
fabpot Jul 25, 2019
784d1d0
Typo in variable name
OskarStark Jul 25, 2019
e3afab7
minor #32748 Typo in variable name (OskarStark)
yceruto Jul 25, 2019
5d64009
[Mailer] Make transport factory test case public
Koc Jul 25, 2019
9282f4f
[VarDumper] Add missing changelog entry for VarDumperTestTrait::setUp…
ogizanagi Jul 26, 2019
ee68b1d
[Messenger][Profiler] Collect the stamps at the end of dispatch
ogizanagi Jul 23, 2019
9216cb7
feature #32749 [Mailer] Make transport factory test case public (Koc)
fabpot Jul 26, 2019
9ac7e42
[Messenger][Profiler] Attempt to give more useful source info when us…
ogizanagi Jul 25, 2019
c8d420d
[VarDumper] added support for Imagine/Image
lyrixx Jul 26, 2019
47ffbad
Avoid using huge amount of memory when formatting long exception
paxal Jul 25, 2019
29ba2e1
minor #32736 [Console] avoid using huge amount of memory when formatt…
Jul 27, 2019
65f0d6f
feature #32683 [VarDumper] added support for Imagine/Image (lyrixx)
fabpot Jul 27, 2019
6aec129
feature #32680 [Messenger][Profiler] Collect the stamps at the end of…
fabpot Jul 27, 2019
9595503
feature #32745 [Messenger][Profiler] Attempt to give more useful sour…
fabpot Jul 27, 2019
da54325
[FrameworkBundle] added type-hints on private methods
fabpot Jul 27, 2019
dd5aa5d
minor #32772 [FrameworkBundle] Add type-hints on private methods (fab…
fabpot Jul 27, 2019
a12edec
Merge branch '4.3' into 4.4
fabpot Jul 27, 2019
bba6230
[Messenger] fixed tests
fabpot Jul 27, 2019
119ac78
minor #32773 [Messenger] fix tests (fabpot)
fabpot Jul 27, 2019
44ee056
[Console] Fix disabling ChoiceQuestion answer trimming
Jul 27, 2019
a29aff0
bug #32781 [Console] Fix disabling ChoiceQuestion answer trimming (ch…
fabpot Jul 27, 2019
7b2c326
Ensure $request->hasSession() is always checked before calling getSes…
Arman-Hosseini Jul 24, 2019
a62feea
[DX] derive default timezone from reference_date option when possible
yceruto Jul 26, 2019
489f36d
[Lock] Add return type to the new LockFactory
Jul 29, 2019
66eb964
minor #32794 [Lock] Add return type to the new LockFactory (chalasr)
Tobion Jul 29, 2019
bd45789
feature #32762 [Form][DX] derive default timezone from reference_date…
xabbuh Jul 29, 2019
f453503
Merge branch '4.3' into 4.4
Tobion Jul 29, 2019
b2dadc1
Merge branch '4.3' into 4.4
nicolas-grekas Jul 29, 2019
eaad40e
let BlockingStoreInterface extend PersistingStoreInterface
xabbuh Jul 29, 2019
5824ab8
bug #32703 Ensure $request->hasSession() is always checked before cal…
nicolas-grekas Jul 30, 2019
40fe161
bug #32803 [Lock] let BlockingStoreInterface extend PersistingStoreIn…
nicolas-grekas Jul 30, 2019
652a063
[Ldap][Security] use right arguments count in sercurity factories
Simperfit Jul 31, 2019
05cfc2b
[Contracts] Fix branch alias
fancyweb Jul 31, 2019
d25448c
minor #32829 [Contracts] Fix branch alias (fancyweb)
nicolas-grekas Jul 31, 2019
ca7b7b6
Merge branch '4.3' into 4.4
nicolas-grekas Jul 31, 2019
92ceb80
bug #32825 [Ldap][Security] use right arguments count in security fac…
nicolas-grekas Jul 31, 2019
3b84a1a
Merge branch '4.3' into 4.4
nicolas-grekas Jul 31, 2019
c5a283d
[Security] Revise UserPasswordEncoderInterface::needsRehash()
ro0NL Jul 31, 2019
f4ceb91
bug #32831 [Security] Revise UserPasswordEncoderInterface::needsRehas…
nicolas-grekas Jul 31, 2019
ab6aae1
[ErrorHandler] Added type declarations where possible
Jul 30, 2019
67d7dda
minor #32812 [ErrorHandler] Added type declarations where possible (T…
nicolas-grekas Jul 31, 2019
3216caf
[ErrorHandler] Relax transition to the new Debug class
yceruto Jul 22, 2019
537114d
bug #32665 [ErrorHandler] Relax transition to the new Debug class (yc…
nicolas-grekas Jul 31, 2019
85058f5
feature #32581 [DI] Allow dumping the container in one file instead o…
nicolas-grekas Jul 31, 2019
1b2aaa4
add parameter type declarations to private methods
xabbuh Jul 27, 2019
13f7616
Merge branch '4.3' into 4.4
nicolas-grekas Jul 31, 2019
b5f592e
Merge branch '4.3' into 4.4
nicolas-grekas Jul 31, 2019
f830226
minor #32786 add parameter type declarations to private methods (xabbuh)
fabpot Aug 1, 2019
749c11d
[Yaml] Add flag to dump NULL as ~
OskarStark Jul 23, 2019
d18d646
revert added type declarations
xabbuh Aug 1, 2019
1414cd4
Sync UPGRADE-5.0.md
fancyweb Aug 1, 2019
7f62b7b
Merge branch '4.3' into 4.4
nicolas-grekas Aug 1, 2019
71ba5b0
minor #32849 [TwigBridge] revert added type declarations (xabbuh)
nicolas-grekas Aug 1, 2019
a0db1a0
minor #32851 Sync UPGRADE-5.0.md (fancyweb)
nicolas-grekas Aug 1, 2019
a13e1af
Merge branch '4.3' into 4.4
nicolas-grekas Aug 1, 2019
0de86a2
Merge branch '4.3' into 4.4
nicolas-grekas Aug 1, 2019
5de0198
add parameter type declarations to private methods
xabbuh Aug 1, 2019
51ba665
Fix assertInternalType deprecation in phpunit 9
jderusse Aug 1, 2019
122a7cf
Merge branch '4.3' into 4.4
nicolas-grekas Aug 1, 2019
e712241
minor #32858 [PhpUnitBridge] Fix deprecation assertInternalType - 4.4…
nicolas-grekas Aug 1, 2019
c11f200
Twig's namespaces can be null
yceruto Aug 1, 2019
76cbdbf
Merge branch '4.3' into 4.4
nicolas-grekas Aug 1, 2019
a837aa1
minor #32867 [TwigBundle] Twig's namespaces can be null (yceruto)
yceruto Aug 1, 2019
f6b73e1
Merge branch '4.3' into 4.4
nicolas-grekas Aug 1, 2019
20adf46
[Twig/Bridge] fix perf issue on composer update with deps=low
nicolas-grekas Aug 1, 2019
151415b
[DoctrineBridge] Deprecated RegistryInterface
Koc Jul 30, 2019
97c8968
[ErrorRenderer] Add DebugCommand for easy debugging and testing
yceruto Jul 11, 2019
861f792
feature #32504 [ErrorRenderer] Add DebugCommand for easy debugging an…
Tobion Aug 1, 2019
bb74384
feature #32817 [DoctrineBridge] Deprecate RegistryInterface (Koc)
Tobion Aug 1, 2019
181ef13
Merge branch '4.3' into 4.4
nicolas-grekas Aug 1, 2019
57725de
Merge branch '4.3' into 4.4
nicolas-grekas Aug 1, 2019
b21d1e5
Merge branch '4.3' into 4.4
nicolas-grekas Aug 1, 2019
1facaad
minor #32859 [TwigBridge] add parameter type declarations to private …
Tobion Aug 2, 2019
daa4e40
Merge branch '4.3' into 4.4
nicolas-grekas Aug 2, 2019
215ba8a
Merge branch '4.3' into 4.4
nicolas-grekas Aug 2, 2019
a68c16d
Polyfill the method createPartialMock
jderusse Aug 2, 2019
253d6f5
minor #32893 [PhpUnitBridge] Polyfill the method createPartialMock (j…
nicolas-grekas Aug 3, 2019
39ebb84
[Mailer] added debug info to TransportExceptionInterface
fabpot Aug 3, 2019
87458fc
Merge branch '4.3' into 4.4
fabpot Aug 3, 2019
eefcb33
feature #32896 [Mailer] added debug info to TransportExceptionInterfa…
fabpot Aug 3, 2019
621c740
Merge branch '4.3' into 4.4
fabpot Aug 3, 2019
3450c17
[PhpUnitBridge] Add polyfill for methods assertNan, assertFinite and …
jderusse Aug 2, 2019
b3cf2d4
minor #32886 [PhpUnitBridge] Add polyfill for methods assertNan, asse…
nicolas-grekas Aug 3, 2019
0868b35
[Bridge/PhpUnit] cleanup fix
nicolas-grekas Aug 3, 2019
83f1dca
Merge branch '4.3' into 4.4
nicolas-grekas Aug 3, 2019
d56bc3b
[PhpUnitBridge] cleanup implementation of expectException*()
nicolas-grekas Aug 3, 2019
42a4de0
minor #32905 [PhpUnitBridge] cleanup implementation of expectExceptio…
nicolas-grekas Aug 3, 2019
1602441
[PhpUnitBridge] added polyfill for assertStringContainsString*()
Aug 2, 2019
d01ec68
minor #32878 [PhpUnitBridge] added polyfill for assertStringContainsS…
nicolas-grekas Aug 3, 2019
54ddfd2
[PhpUnitBridge] add more assert*() polyfills
nicolas-grekas Aug 3, 2019
5d5e04b
minor #32907 [PhpUnitBridge] add more assert*() polyfills (nicolas-gr…
nicolas-grekas Aug 3, 2019
4cfb4b9
[Mailer] added debug info on HTTP transport exceptions
fabpot Aug 3, 2019
f1801a4
bug #32908 [Mailer] Add debug info on HTTP transport exceptions (fabpot)
fabpot Aug 3, 2019
9614f48
Merge branch '4.3' into 4.4
nicolas-grekas Aug 3, 2019
016bd8d
Inject ForwardCompatibiliy in TestCase
jderusse Aug 2, 2019
9279f04
minor #32882 [PhpUnitBridge] Inject ForwardCompatibiliy in TestCase (…
nicolas-grekas Aug 3, 2019
d588be2
Merge branch '4.3' into 4.4
nicolas-grekas Aug 3, 2019
6328eff
Merge branch '4.3' into 4.4
nicolas-grekas Aug 3, 2019
5eed0d7
fix merge
nicolas-grekas Aug 3, 2019
7479543
feature #32669 [Yaml] Add flag to dump NULL as ~ (OskarStark)
fabpot Aug 4, 2019
7613c7d
[FrameworkBundle] add config translator cache_dir
Raulnet Jul 13, 2019
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
Prev Previous commit
Next Next commit
[Validator] Allow to use property paths to get limits in range constr…
…aint
  • Loading branch information
Lctrs authored and fabpot committed Jul 8, 2019
commit 2b509904c836fc773299e7b51a63c0cd7d720777
6 changes: 6 additions & 0 deletions src/Symfony/Component/Validator/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@ CHANGELOG
* added the `compared_value_path` parameter in violations when using any
comparison constraint with the `propertyPath` option.
* added support for checking an array of types in `TypeValidator`
* Added new `minPropertyPath` and `maxPropertyPath` options
to `Range` constraint in order to get the value to compare
from an array or object
* added the `limit_path` parameter in violations when using
`Range` constraint with the `minPropertyPath` or
`maxPropertyPath` options.

4.3.0
-----
Expand Down
23 changes: 21 additions & 2 deletions src/Symfony/Component/Validator/Constraints/Range.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,10 @@

namespace Symfony\Component\Validator\Constraints;

use Symfony\Component\PropertyAccess\PropertyAccess;
use Symfony\Component\Validator\Constraint;
use Symfony\Component\Validator\Exception\ConstraintDefinitionException;
use Symfony\Component\Validator\Exception\LogicException;
use Symfony\Component\Validator\Exception\MissingOptionsException;

/**
Expand All @@ -36,14 +39,30 @@ class Range extends Constraint
public $maxMessage = 'This value should be {{ limit }} or less.';
public $invalidMessage = 'This value should be a valid number.';
public $min;
public $minPropertyPath;
public $max;
public $maxPropertyPath;

public function __construct($options = null)
{
if (\is_array($options)) {
if (isset($options['min']) && isset($options['minPropertyPath'])) {
throw new ConstraintDefinitionException(sprintf('The "%s" constraint requires only one of the "min" or "minPropertyPath" options to be set, not both.', \get_class($this)));
}

if (isset($options['max']) && isset($options['maxPropertyPath'])) {
throw new ConstraintDefinitionException(sprintf('The "%s" constraint requires only one of the "max" or "maxPropertyPath" options to be set, not both.', \get_class($this)));
}

if ((isset($options['minPropertyPath']) || isset($options['maxPropertyPath'])) && !class_exists(PropertyAccess::class)) {
throw new LogicException(sprintf('The "%s" constraint requires the Symfony PropertyAccess component to use the "minPropertyPath" or "maxPropertyPath" option.', \get_class($this)));
}
}

parent::__construct($options);

if (null === $this->min && null === $this->max) {
throw new MissingOptionsException(sprintf('Either option "min" or "max" must be given for constraint %s', __CLASS__), ['min', 'max']);
if (null === $this->min && null === $this->minPropertyPath && null === $this->max && null === $this->maxPropertyPath) {
throw new MissingOptionsException(sprintf('Either option "min", "minPropertyPath", "max" or "maxPropertyPath" must be given for constraint %s', __CLASS__), ['min', 'max']);
}
}
}
75 changes: 65 additions & 10 deletions src/Symfony/Component/Validator/Constraints/RangeValidator.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,26 @@

namespace Symfony\Component\Validator\Constraints;

use Symfony\Component\PropertyAccess\Exception\NoSuchPropertyException;
use Symfony\Component\PropertyAccess\PropertyAccess;
use Symfony\Component\PropertyAccess\PropertyAccessorInterface;
use Symfony\Component\Validator\Constraint;
use Symfony\Component\Validator\ConstraintValidator;
use Symfony\Component\Validator\Exception\ConstraintDefinitionException;
use Symfony\Component\Validator\Exception\UnexpectedTypeException;

/**
* @author Bernhard Schussek <bschussek@gmail.com>
*/
class RangeValidator extends ConstraintValidator
{
private $propertyAccessor;

public function __construct(PropertyAccessorInterface $propertyAccessor = null)
{
$this->propertyAccessor = $propertyAccessor;
}

/**
* {@inheritdoc}
*/
Expand All @@ -42,8 +53,8 @@ public function validate($value, Constraint $constraint)
return;
}

$min = $constraint->min;
$max = $constraint->max;
$min = $this->getLimit($constraint->minPropertyPath, $constraint->min, $constraint);
$max = $this->getLimit($constraint->maxPropertyPath, $constraint->max, $constraint);

// Convert strings to DateTimes if comparing another DateTime
// This allows to compare with any date/time value supported by
Expand All @@ -59,22 +70,66 @@ public function validate($value, Constraint $constraint)
}
}

if (null !== $constraint->max && $value > $max) {
$this->context->buildViolation($constraint->maxMessage)
if (null !== $max && $value > $max) {
$violationBuilder = $this->context->buildViolation($constraint->maxMessage)
->setParameter('{{ value }}', $this->formatValue($value, self::PRETTY_DATE))
->setParameter('{{ limit }}', $this->formatValue($max, self::PRETTY_DATE))
->setCode(Range::TOO_HIGH_ERROR)
->addViolation();
->setCode(Range::TOO_HIGH_ERROR);

if (null !== $constraint->maxPropertyPath) {
$violationBuilder->setParameter('{{ max_limit_path }}', $constraint->maxPropertyPath);
}

if (null !== $constraint->minPropertyPath) {
$violationBuilder->setParameter('{{ min_limit_path }}', $constraint->minPropertyPath);
}

$violationBuilder->addViolation();

return;
}

if (null !== $constraint->min && $value < $min) {
$this->context->buildViolation($constraint->minMessage)
if (null !== $min && $value < $min) {
$violationBuilder = $this->context->buildViolation($constraint->minMessage)
->setParameter('{{ value }}', $this->formatValue($value, self::PRETTY_DATE))
->setParameter('{{ limit }}', $this->formatValue($min, self::PRETTY_DATE))
->setCode(Range::TOO_LOW_ERROR)
->addViolation();
->setCode(Range::TOO_LOW_ERROR);

if (null !== $constraint->maxPropertyPath) {
$violationBuilder->setParameter('{{ max_limit_path }}', $constraint->maxPropertyPath);
}

if (null !== $constraint->minPropertyPath) {
$violationBuilder->setParameter('{{ min_limit_path }}', $constraint->minPropertyPath);
}

$violationBuilder->addViolation();
}
}

private function getLimit($propertyPath, $default, Constraint $constraint)
{
if (null === $propertyPath) {
return $default;
}

if (null === $object = $this->context->getObject()) {
return $default;
}

try {
return $this->getPropertyAccessor()->getValue($object, $propertyPath);
} catch (NoSuchPropertyException $e) {
throw new ConstraintDefinitionException(sprintf('Invalid property path "%s" provided to "%s" constraint: %s', $propertyPath, \get_class($constraint), $e->getMessage()), 0, $e);
}
}

private function getPropertyAccessor(): PropertyAccessorInterface
{
if (null === $this->propertyAccessor) {
$this->propertyAccessor = PropertyAccess::createPropertyAccessor();
}

return $this->propertyAccessor;
}
}
51 changes: 51 additions & 0 deletions src/Symfony/Component/Validator/Tests/Constraints/RangeTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
<?php

namespace Symfony\Component\Validator\Tests\Constraints;

use PHPUnit\Framework\TestCase;
use Symfony\Component\Validator\Constraints\Range;

class RangeTest extends TestCase
{
/**
* @expectedException \Symfony\Component\Validator\Exception\ConstraintDefinitionException
* @expectedExceptionMessage requires only one of the "min" or "minPropertyPath" options to be set, not both.
*/
public function testThrowsConstraintExceptionIfBothMinLimitAndPropertyPath()
{
new Range([
'min' => 'min',
'minPropertyPath' => 'minPropertyPath',
]);
}

/**
* @expectedException \Symfony\Component\Validator\Exception\ConstraintDefinitionException
* @expectedExceptionMessage requires only one of the "max" or "maxPropertyPath" options to be set, not both.
*/
public function testThrowsConstraintExceptionIfBothMaxLimitAndPropertyPath()
{
new Range([
'max' => 'min',
'maxPropertyPath' => 'maxPropertyPath',
]);
}

/**
* @expectedException \Symfony\Component\Validator\Exception\MissingOptionsException
* @expectedExceptionMessage Either option "min", "minPropertyPath", "max" or "maxPropertyPath" must be given
*/
public function testThrowsConstraintExceptionIfNoLimitNorPropertyPath()
{
new Range([]);
}

/**
* @expectedException \Symfony\Component\Validator\Exception\ConstraintDefinitionException
* @expectedExceptionMessage No default option is configured
*/
public function testThrowsNoDefaultOptionConfiguredException()
{
new Range('value');
}
}
Loading