Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Sign in
Toggle navigation
S
Silex
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
common
Silex
Commits
3a0eac09
Commit
3a0eac09
authored
Mar 09, 2014
by
Dominik Zogg
Committed by
Fabien Potencier
Mar 11, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
allow to add object initializers, for complex valdations as unique entity
parent
b40e5b2b
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
1 deletion
+7
-1
src/Silex/Provider/ValidatorServiceProvider.php
src/Silex/Provider/ValidatorServiceProvider.php
+7
-1
No files found.
src/Silex/Provider/ValidatorServiceProvider.php
View file @
3a0eac09
...
...
@@ -38,7 +38,9 @@ class ValidatorServiceProvider implements ServiceProviderInterface
return
new
Validator
(
$app
[
'validator.mapping.class_metadata_factory'
],
$app
[
'validator.validator_factory'
],
isset
(
$app
[
'translator'
])
?
$app
[
'translator'
]
:
new
DefaultTranslator
()
isset
(
$app
[
'translator'
])
?
$app
[
'translator'
]
:
new
DefaultTranslator
(),
'validators'
,
$app
[
'validator.object_initializers'
]
);
});
...
...
@@ -51,6 +53,10 @@ class ValidatorServiceProvider implements ServiceProviderInterface
return
new
ConstraintValidatorFactory
(
$app
,
$validators
);
});
$app
[
'validator.object_initializers'
]
=
$app
->
share
(
function
(
$app
)
{
return
array
();
});
}
public
function
boot
(
Application
$app
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment