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

Drop old versions of Symfony #352

Merged
merged 1 commit into from
Jan 9, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
24 changes: 6 additions & 18 deletions Block/BlockContextManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -158,24 +158,12 @@ protected function configureSettings(OptionsResolver $optionsResolver, BlockInte
'ttl' => (int) $block->getTtl(),
));

// TODO: Remove it when bumping requirements to SF 2.6+
if (method_exists($optionsResolver, 'setDefined')) {
$optionsResolver
->addAllowedTypes('use_cache', 'bool')
->addAllowedTypes('extra_cache_keys', 'array')
->addAllowedTypes('attr', 'array')
->addAllowedTypes('ttl', 'int')
->addAllowedTypes('template', array('string', 'bool'))
;
} else {
$optionsResolver->addAllowedTypes(array(
'use_cache' => array('bool'),
'extra_cache_keys' => array('array'),
'attr' => array('array'),
'ttl' => array('int'),
'template' => array('string', 'bool'),
));
}
$optionsResolver
->addAllowedTypes('use_cache', 'bool')
->addAllowedTypes('extra_cache_keys', 'array')
->addAllowedTypes('attr', 'array')
->addAllowedTypes('ttl', 'int')
->addAllowedTypes('template', array('string', 'bool'));

// add type and class settings for block
$class = ClassUtils::getClass($block);
Expand Down
10 changes: 1 addition & 9 deletions Block/Service/MenuBlockService.php
Original file line number Diff line number Diff line change
Expand Up @@ -164,15 +164,7 @@ protected function getFormSettingsKeys()
$choices = $this->menuRegistry->getAliasNames();
}

// NEXT_MAJOR: remove SF 2.7+ BC
if (method_exists('Symfony\Component\Form\AbstractType', 'configureOptions')) {
$choices = array_flip($choices);

// choice_as_value options is not needed in SF 3.0+
if (method_exists('Symfony\Component\Form\FormTypeInterface', 'setDefaultOptions')) {
$choiceOptions['choices_as_values'] = true;
}
}
$choices = array_flip($choices);

$choiceOptions['choices'] = $choices;

Expand Down
3 changes: 0 additions & 3 deletions Resources/views/Profiler/block.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,6 @@
{% endblock %}

{% block panel %}
{# NEXT_MAJOR : remove this when Symfony Requirement will be bumped to 2.8+ #}
{% set profiler_markup_version = profiler_markup_version|default(1) %}

<h2>Events Blocks</h2>
<table>
<tr>
Expand Down
14 changes: 1 addition & 13 deletions Tests/Block/Service/MenuBlockServiceTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,19 +50,7 @@ public function testBuildEditForm()
'required' => false,
);

$choices = array(
'acme:demobundle:menu' => 'Test Menu',
);

// NEXT_MAJOR: remove SF 2.7+ BC
if (method_exists('Symfony\Component\Form\AbstractType', 'configureOptions')) {
$choices = array_flip($choices);

// choice_as_value options is not needed in SF 3.0+
if (method_exists('Symfony\Component\Form\FormTypeInterface', 'setDefaultOptions')) {
$choiceOptions['choices_as_values'] = true;
}
}
$choices = array('Test Menu' => 'acme:demobundle:menu');

$choiceOptions['choices'] = $choices;

Expand Down
6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,14 @@
"doctrine/common": "^2.3",
"sonata-project/cache": "^1.0",
"sonata-project/core-bundle": "^3.0",
"symfony/form": "^2.3 || ^3.0",
"symfony/http-kernel": "^2.3 || ^3.0"
"symfony/form": "^2.8 || ^3.0",
"symfony/http-kernel": "^2.8 || ^3.0"
},
"require-dev": {
"knplabs/knp-menu-bundle": "^2.0",
"sllh/php-cs-fixer-styleci-bridge": "^2.0",
"sonata-project/admin-bundle": "^3.0 || ^4.0@dev",
"symfony/phpunit-bridge": "^2.7 || ^3.0"
"symfony/phpunit-bridge": "^2.8 || ^3.0"
},
"suggest": {
"knplabs/knp-menu-bundle": "^2.0",
Expand Down