fix deprecations: use fqcn for form creations in controllers

This commit is contained in:
nobohan 2018-04-03 17:29:26 +02:00
parent 7922f8f181
commit 5e577c3272
4 changed files with 9 additions and 8 deletions

View File

@ -64,7 +64,7 @@ class CenterController extends Controller
*/
private function createCreateForm(Center $center)
{
$form = $this->createForm(new CenterType(), $center, array(
$form = $this->createForm(CenterType::class, $center, array(
'action' => $this->generateUrl('admin_center_create'),
'method' => 'POST',
));
@ -138,7 +138,7 @@ class CenterController extends Controller
*/
private function createEditForm(Center $center)
{
$form = $this->createForm(new CenterType(), $center, array(
$form = $this->createForm(CenterType::class, $center, array(
'action' => $this->generateUrl('admin_center_update', array('id' => $center->getId())),
'method' => 'PUT',
));

View File

@ -68,7 +68,7 @@ class PermissionsGroupController extends Controller
*/
private function createCreateForm(PermissionsGroup $permissionsGroup)
{
$form = $this->createForm(new PermissionsGroupType(), $permissionsGroup, array(
$form = $this->createForm(PermissionsGroupType::class, $permissionsGroup, array(
'action' => $this->generateUrl('admin_permissionsgroup_create'),
'method' => 'POST',
));
@ -229,7 +229,7 @@ class PermissionsGroupController extends Controller
*/
private function createEditForm(PermissionsGroup $permissionsGroup)
{
$form = $this->createForm(new PermissionsGroupType(), $permissionsGroup, array(
$form = $this->createForm(PermissionsGroupType::class, $permissionsGroup, array(
'action' => $this->generateUrl('admin_permissionsgroup_update', array('id' => $permissionsGroup->getId())),
'method' => 'PUT',
));

View File

@ -4,10 +4,11 @@ namespace Chill\MainBundle\Controller;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\Form\Extension\Core\Type\SubmitType;
use Chill\MainBundle\Entity\Scope;
use Chill\MainBundle\Form\ScopeType;
use Symfony\Component\Form\Extension\Core\Type\SubmitType;
/**
* Scope controller.

View File

@ -73,7 +73,7 @@ class UserController extends Controller
*/
private function createCreateForm(User $entity)
{
$form = $this->createForm(new UserType(), $entity, array(
$form = $this->createForm(UserType::class, $entity, array(
'action' => $this->generateUrl('admin_user_create'),
'method' => 'POST',
'is_creation' => true
@ -177,7 +177,7 @@ class UserController extends Controller
*/
private function createEditPasswordForm(User $user)
{
return $this->createForm(new UserPasswordType(), $user, array(
return $this->createForm(UserPasswordType::class, $user, array(
'action' =>
$this->generateUrl('admin_user_update_password', array('id' => $user->getId())),
'method' => 'PUT'
@ -292,7 +292,7 @@ class UserController extends Controller
*/
private function createEditForm(User $user)
{
$form = $this->createForm(new UserType(), $user, array(
$form = $this->createForm(UserType::class, $user, array(
'action' => $this->generateUrl('admin_user_update', array('id' => $user->getId())),
'method' => 'PUT',
));