Skip to content
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

[Form] Don't rely on `Symfony\Component\HttpFoundation\File\File` if http-foundation isn't installed in FileType #25152

Closed
wants to merge 2 commits into from
Closed
Changes from 1 commit
Commits
File filter...
Filter file types
Jump to…
Jump to file or symbol
Failed to load files and symbols.

Always

Just for now

Prev

[Form] Move check of class existence out of closure

  • Loading branch information...
issei-m committed Nov 26, 2017
commit 043658722dd352ea11ba1bbe3a2685fe7d57be50
@@ -92,9 +92,12 @@ public function finishView(FormView $view, FormInterface $form, array $options)
*/
public function configureOptions(OptionsResolver $resolver)
{
$dataClass = function (Options $options) {
return $options['multiple'] || !class_exists('Symfony\Component\HttpFoundation\File\File') ? null : 'Symfony\Component\HttpFoundation\File\File';
};
$dataClass = null;
if (class_exists('Symfony\Component\HttpFoundation\File\File')) {
$dataClass = function (Options $options) {
return $options['multiple'] ? null : 'Symfony\Component\HttpFoundation\File\File';
};
}
$emptyData = function (Options $options) {
return $options['multiple'] ? array() : null;
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.