Skip to content

Commit

Permalink
Merge pull request #72 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 96cfd59 + bf70cdc commit 694d48c
Show file tree
Hide file tree
Showing 15 changed files with 70 additions and 62 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 @@ -33,7 +33,7 @@
{{ 'button.logout'|trans }}
</button>
</form>
{% set locale_switcher = stepup_locale_switcher('ss_switch_locale', {'return-url': app.request.uri}) %}
{% set locale_switcher = stepup_locale_switcher(app.request.locale, 'ss_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
3 changes: 2 additions & 1 deletion app/config/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ framework:
validation: { enable_annotations: true }
templating:
engines: ['twig']
assets_version: %asset_version%
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
80 changes: 43 additions & 37 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 @@ -18,14 +18,15 @@

namespace Surfnet\StepupSelfService\SelfServiceBundle\Command;

use Surfnet\StepupBundle\Value\PhoneNumber\Country;
use Symfony\Component\Validator\Constraints as Assert;

class SendSmsChallengeCommand
{
/**
* @var string
* @var Country
*/
public $countryCode;
public $country;

/**
* @Assert\NotBlank(message="ss.send_sms_challenge_command.recipient.may_not_be_empty")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
use Symfony\Component\Form\ButtonTypeInterface;
use Symfony\Component\Form\FormInterface;
use Symfony\Component\Form\FormView;
use Symfony\Component\OptionsResolver\OptionsResolverInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;

class AnchorType extends AbstractType implements ButtonTypeInterface
{
Expand All @@ -36,7 +36,7 @@ public function getName()
return 'anchor';
}

public function setDefaultOptions(OptionsResolverInterface $resolver)
public function configureOptions(OptionsResolver $resolver)
{
$resolver->setDefaults([
'route' => null,
Expand All @@ -45,9 +45,7 @@ public function setDefaultOptions(OptionsResolverInterface $resolver)

$resolver->setRequired(['route']);

$resolver->setAllowedTypes([
'route' => 'string',
]);
$resolver->setAllowedTypes('route', 'string');
}

public function buildView(FormView $view, FormInterface $form, array $options)
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 ProveYubikeyPossessionType extends AbstractType
{
Expand All @@ -39,7 +39,7 @@ public function buildForm(FormBuilderInterface $builder, array $options)
]);
}

public function setDefaultOptions(OptionsResolverInterface $resolver)
public function configureOptions(OptionsResolver $resolver)
{
$resolver->setDefaults([
'data_class' => 'Surfnet\StepupSelfService\SelfServiceBundle\Command\VerifyYubikeyOtpCommand',
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 RevokeSecondFactorType extends AbstractType
{
Expand All @@ -38,7 +38,7 @@ public function buildForm(FormBuilderInterface $builder, array $options)
]);
}

public function setDefaultOptions(OptionsResolverInterface $resolver)
public function configureOptions(OptionsResolver $resolver)
{
$resolver->setDefaults([
'data_class' => 'Surfnet\StepupSelfService\SelfServiceBundle\Command\RevokeCommand',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,18 +21,20 @@
use Surfnet\StepupBundle\Value\PhoneNumber\CountryCodeListing;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolverInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;

class SendSmsChallengeType extends AbstractType
{
public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder
->add('countryCode', 'choice', [
->add('country', 'choice', [
'label' => /** @Ignore */ 'country code',
'horizontal_label_class' => 'sr-only',
'required' => true,
'choice_list' => CountryCodeListing::asChoiceList(),
'preferred_choices' =>
['Surfnet\StepupBundle\Value\PhoneNumber\CountryCodeListing', 'isPreferredChoice'],
'horizontal_input_wrapper_class' => 'foo',
])
->add('subscriber', 'text', [
Expand All @@ -51,7 +53,7 @@ public function buildForm(FormBuilderInterface $builder, array $options)
]);
}

public function setDefaultOptions(OptionsResolverInterface $resolver)
public function configureOptions(OptionsResolver $resolver)
{
$resolver->setDefaults([
'attr' => ['class' => 'form-inline'],
Expand Down
Loading

0 comments on commit 694d48c

Please sign in to comment.