Skip to content

Commit

Permalink
Merge pull request #73 from SURFnet/maintenance/symfony-2.7
Browse files Browse the repository at this point in the history
Upgrade to Symfony 2.7 LTS
  • Loading branch information
rjkip committed Jun 4, 2015
2 parents 71d0839 + 3cfff09 commit cd10a25
Show file tree
Hide file tree
Showing 20 changed files with 99 additions and 84 deletions.
2 changes: 1 addition & 1 deletion app/Resources/views/base.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
<button type="submit" class="btn btn-link"><i class="fa fa-sign-out"></i> {{ 'button.logout'|trans }}</button>
</form>
{% if app.user %}
{% set locale_switcher = stepup_locale_switcher('ra_switch_locale', {'return-url': app.request.uri}) %}
{% set locale_switcher = stepup_locale_switcher(app.request.locale, 'ra_switch_locale', {'return-url': app.request.uri}) %}
{{ form_start(locale_switcher, { attr: { class: 'form-inline' }}) }}
{{ form_widget(locale_switcher.locale) }}
{{ form_widget(locale_switcher.switch) }}
Expand Down
5 changes: 3 additions & 2 deletions app/config/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,9 @@ framework:
csrf_protection: ~
validation: { enable_annotations: true }
templating:
engines: ['twig']
assets_version: %asset_version%
engines: ['twig', 'php']
assets:
version: %asset_version%
default_locale: "%default_locale%"
trusted_hosts: ~
trusted_proxies: %trusted_proxies%
Expand Down
2 changes: 1 addition & 1 deletion app/console
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ $debug = getenv('SYMFONY_DEBUG') !== '0' && !$input->hasParameterOption(array('-
&& $env !== 'build';

if ($debug) {
Debug::enable();
Debug::enable(~E_USER_DEPRECATED);
}

$kernel = new AppKernel($env, $debug);
Expand Down
2 changes: 1 addition & 1 deletion app_dev.php.dist
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\Debug\Debug;

$loader = require_once __DIR__.'/../app/bootstrap.php.cache';
Debug::enable();
Debug::enable(~E_USER_DEPRECATED);

require_once __DIR__.'/../app/AppKernel.php';

Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"minimum-stability": "stable",
"require": {
"php": ">=5.4",
"symfony/symfony": "~2.6,>=2.6.6",
"symfony/symfony": "^2.7",
"twig/extensions": "~1.0",
"symfony/assetic-bundle": "~2.3",
"symfony/monolog-bundle": "~2.4",
Expand Down
99 changes: 56 additions & 43 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@

use Surfnet\StepupMiddlewareClientBundle\Identity\Dto\InstitutionListing;
use Surfnet\StepupMiddlewareClientBundle\Identity\Service\InstitutionListingService;
use Symfony\Component\Form\Extension\Core\ChoiceList\SimpleChoiceList;

class InstitutionListingChoiceList
{
Expand All @@ -38,7 +37,7 @@ public function __construct(InstitutionListingService $institutionListingService
}

/**
* @return SimpleChoiceList
* @return array
*/
public function create()
{
Expand All @@ -50,6 +49,7 @@ public function create()
}, $listings);

$selectOptions = array_combine($options, $options);
return new SimpleChoiceList($selectOptions);

return $selectOptions;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,22 +18,21 @@

namespace Surfnet\StepupRa\RaBundle\Form\Extension;

use Symfony\Component\Form\Extension\Core\ChoiceList\SimpleChoiceList;

class RaRoleChoiceList
{
/**
* @return SimpleChoiceList
* @return array
*/
public static function createChoiceList()
public static function create()
{
$choices = self::getChoices();
$labels = array_map(function ($choice) {
return 'ra.form.extension.ra_role_choice.' . $choice;
}, $choices);

$combined = array_combine($choices, $labels);
return new SimpleChoiceList($combined);
$combined = array_combine($labels, $choices);

return $combined;
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolverInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;

class AmendRegistrationAuthorityInformationType extends AbstractType
{
Expand Down Expand Up @@ -49,7 +49,7 @@ public function buildForm(FormBuilderInterface $builder, array $options)
;
}

public function setDefaultOptions(OptionsResolverInterface $resolver)
public function configureOptions(OptionsResolver $resolver)
{
$resolver->setDefaults([
'data_class' => 'Surfnet\StepupRa\RaBundle\Command\AmendRegistrationAuthorityInformationCommand'
Expand Down
Loading

0 comments on commit cd10a25

Please sign in to comment.