fix deprecations: use fqcn

This commit is contained in:
nobohan 2018-04-03 12:25:18 +02:00
parent 16b05d29e5
commit 24357ce3d6
2 changed files with 6 additions and 5 deletions

View File

@ -63,7 +63,7 @@ class ScopeController extends Controller
*/
private function createCreateForm(Scope $scope)
{
$form = $this->createForm(new ScopeType(), $scope, array(
$form = $this->createForm(ScopeType::class, $scope, array(
'action' => $this->generateUrl('admin_scope_create'),
'method' => 'POST',
));
@ -80,7 +80,7 @@ class ScopeController extends Controller
public function newAction()
{
$scope = new Scope();
$form = $this->createCreateForm($scope);
$form = $this->createCreateForm($scope);
return $this->render('ChillMainBundle:Scope:new.html.twig', array(
'entity' => $scope,
@ -138,12 +138,12 @@ class ScopeController extends Controller
*/
private function createEditForm(Scope $scope)
{
$form = $this->createForm(new ScopeType(), $scope, array(
$form = $this->createForm(ScopeType::class, $scope, array(
'action' => $this->generateUrl('admin_scope_update', array('id' => $scope->getId())),
'method' => 'PUT',
));
$form->add('submit', 'submit', array('label' => 'Update'));
$form->add('submit', SubmitType::class, array('label' => 'Update'));
return $form;
}

View File

@ -9,6 +9,7 @@ namespace Chill\MainBundle\Form\Type;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\Translation\Translator;
use Symfony\Component\Form\Extension\Core\Type\TextType;
class TranslatableStringFormType extends AbstractType
{
@ -22,7 +23,7 @@ class TranslatableStringFormType extends AbstractType
public function buildForm(FormBuilderInterface $builder, array $options) {
foreach ($this->availableLanguages as $lang) {
$builder->add($lang, 'text',
$builder->add($lang, TextType::class,
array('required' => (in_array($lang,
$this->frameworkTranslatorFallback))));
}