Skip to content

Commit

Permalink
Merge pull request Sylius#6300 from pamil/resource/improve-collection…
Browse files Browse the repository at this point in the history
…-extension

[Resource] Improve CollectionExtension
  • Loading branch information
Paweł Jędrzejewski committed Oct 5, 2016
2 parents 4f7fcd4 + 675114f commit 4b32282
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 64 deletions.
14 changes: 2 additions & 12 deletions Form/Extension/CollectionExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,25 +26,15 @@ class CollectionExtension extends AbstractTypeExtension
*/
public function buildView(FormView $view, FormInterface $form, array $options)
{
if (array_key_exists('button_add_label', $options)) {
$view->vars['button_add_label'] = $options['button_add_label'];
}

if (array_key_exists('button_delete_label', $options)) {
$view->vars['button_delete_label'] = $options['button_delete_label'];
}
$view->vars['button_add_label'] = $options['button_add_label'];
$view->vars['button_delete_label'] = $options['button_delete_label'];
}

/**
* {@inheritdoc}
*/
public function configureOptions(OptionsResolver $resolver)
{
$resolver->setDefined([
'button_add_label',
'button_delete_label',
]);

$resolver->setDefaults([
'button_add_label' => 'sylius.form.collection.add',
'button_delete_label' => 'sylius.form.collection.delete',
Expand Down
52 changes: 0 additions & 52 deletions spec/Form/Extension/CollectionExtensionSpec.php

This file was deleted.

0 comments on commit 4b32282

Please sign in to comment.