From 5e577c32727feee86463055d94ce695101dd4443 Mon Sep 17 00:00:00 2001 From: nobohan Date: Tue, 3 Apr 2018 17:29:26 +0200 Subject: [PATCH] fix deprecations: use fqcn for form creations in controllers --- Controller/CenterController.php | 4 ++-- Controller/PermissionsGroupController.php | 4 ++-- Controller/ScopeController.php | 3 ++- Controller/UserController.php | 6 +++--- 4 files changed, 9 insertions(+), 8 deletions(-) diff --git a/Controller/CenterController.php b/Controller/CenterController.php index 73fb17a84..9fabb50aa 100644 --- a/Controller/CenterController.php +++ b/Controller/CenterController.php @@ -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', )); diff --git a/Controller/PermissionsGroupController.php b/Controller/PermissionsGroupController.php index cf17e7473..911fff79b 100644 --- a/Controller/PermissionsGroupController.php +++ b/Controller/PermissionsGroupController.php @@ -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', )); diff --git a/Controller/ScopeController.php b/Controller/ScopeController.php index 36d2b75d2..a999a0b3b 100644 --- a/Controller/ScopeController.php +++ b/Controller/ScopeController.php @@ -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. diff --git a/Controller/UserController.php b/Controller/UserController.php index 7bce03f65..3e4c0c560 100644 --- a/Controller/UserController.php +++ b/Controller/UserController.php @@ -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', ));