Skip to content

Commit

Permalink
Merge pull request #19 from lemoinem/fix/symfony-3-compatibility
Browse files Browse the repository at this point in the history
[Symfony3] Fix compatibility
  • Loading branch information
Burgov committed Dec 18, 2015
2 parents d7b60f1 + 7abd902 commit b466760
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion Form/Type/KeyValueType.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,14 @@ public function configureOptions(OptionsResolver $resolver)
));

$resolver->setRequired(array('value_type'));
$resolver->setAllowedTypes(array('allowed_keys' => array('null', 'array')));

if (method_exists($resolver, 'setDefined')) {
// Symfony 2.6+ API
$resolver->setAllowedTypes('allowed_keys', array('null', 'array'));
} else {
// Symfony <2.6 API
$resolver->setAllowedTypes(array('allowed_keys' => array('null', 'array')));
}
}

public function getParent()
Expand Down

0 comments on commit b466760

Please sign in to comment.