mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-20 22:53:49 +00:00
apply more cs rules for php-cs
This commit is contained in:
@@ -27,7 +27,6 @@ use Symfony\Component\Form\Extension\Core\Type\SubmitType;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
use Symfony\Component\Routing\Annotation\Route;
|
||||
use Symfony\Contracts\Translation\TranslatorInterface;
|
||||
use function in_array;
|
||||
|
||||
/**
|
||||
* Class CustomFieldsGroupController.
|
||||
@@ -41,6 +40,7 @@ class CustomFieldsGroupController extends AbstractController
|
||||
|
||||
/**
|
||||
* Creates a new CustomFieldsGroup entity.
|
||||
*
|
||||
* @Route("/{_locale}/admin/customfieldsgroup/create", name="customfieldsgroup_create")
|
||||
*/
|
||||
public function createAction(Request $request)
|
||||
@@ -71,6 +71,7 @@ class CustomFieldsGroupController extends AbstractController
|
||||
|
||||
/**
|
||||
* Displays a form to edit an existing CustomFieldsGroup entity.
|
||||
*
|
||||
* @Route("/{_locale}/admin/customfieldsgroup/{id}/edit", name="customfieldsgroup_edit")
|
||||
*/
|
||||
public function editAction(mixed $id)
|
||||
@@ -106,7 +107,7 @@ class CustomFieldsGroupController extends AbstractController
|
||||
$makeDefaultFormViews = [];
|
||||
|
||||
foreach ($cfGroups as $group) {
|
||||
if (!in_array($group->getId(), $defaultGroups, true)) {
|
||||
if (!\in_array($group->getId(), $defaultGroups, true)) {
|
||||
$makeDefaultFormViews[$group->getId()] = $this->createMakeDefaultForm($group)->createView();
|
||||
}
|
||||
}
|
||||
@@ -120,6 +121,7 @@ class CustomFieldsGroupController extends AbstractController
|
||||
|
||||
/**
|
||||
* Set the CustomField Group with id $cFGroupId as default.
|
||||
*
|
||||
* @Route("/{_locale}/admin/customfieldsgroup/makedefault", name="customfieldsgroup_makedefault")
|
||||
*/
|
||||
public function makeDefaultAction(Request $request)
|
||||
@@ -134,9 +136,7 @@ class CustomFieldsGroupController extends AbstractController
|
||||
$cFGroup = $em->getRepository(\Chill\CustomFieldsBundle\Entity\CustomFieldsGroup::class)->findOneById($cFGroupId);
|
||||
|
||||
if (!$cFGroup) {
|
||||
throw $this
|
||||
->createNotFoundException('customFieldsGroup not found with '
|
||||
. "id {$cFGroupId}");
|
||||
throw $this->createNotFoundException('customFieldsGroup not found with '."id {$cFGroupId}");
|
||||
}
|
||||
|
||||
$cFDefaultGroup = $em->getRepository(\Chill\CustomFieldsBundle\Entity\CustomFieldsDefaultGroup::class)
|
||||
@@ -207,7 +207,7 @@ class CustomFieldsGroupController extends AbstractController
|
||||
|
||||
$this->get('twig.loader')
|
||||
->addPath(
|
||||
__DIR__ . '/../Tests/Fixtures/App/app/Resources/views/',
|
||||
__DIR__.'/../Tests/Fixtures/App/app/Resources/views/',
|
||||
$namespace = 'test'
|
||||
);
|
||||
|
||||
@@ -219,8 +219,8 @@ class CustomFieldsGroupController extends AbstractController
|
||||
]);
|
||||
}
|
||||
|
||||
//dump($form->getData());
|
||||
//dump(json_enccode($form->getData()));
|
||||
// dump($form->getData());
|
||||
// dump(json_enccode($form->getData()));
|
||||
}
|
||||
|
||||
return $this
|
||||
@@ -233,7 +233,6 @@ class CustomFieldsGroupController extends AbstractController
|
||||
* Finds and displays a CustomFieldsGroup entity.
|
||||
*
|
||||
* @Route("/{_locale}/admin/customfieldsgroup/{id}/show", name="customfieldsgroup/show")
|
||||
*
|
||||
*/
|
||||
public function showAction(mixed $id)
|
||||
{
|
||||
@@ -294,8 +293,7 @@ class CustomFieldsGroupController extends AbstractController
|
||||
{
|
||||
$fieldChoices = [];
|
||||
|
||||
foreach ($this->customFieldProvider->getAllFields()
|
||||
as $key => $customType) {
|
||||
foreach ($this->customFieldProvider->getAllFields() as $key => $customType) {
|
||||
$fieldChoices[$key] = $customType->getName();
|
||||
}
|
||||
|
||||
@@ -361,11 +359,9 @@ class CustomFieldsGroupController extends AbstractController
|
||||
/**
|
||||
* create a form to make the group default.
|
||||
*
|
||||
* @param CustomFieldsGroup $group
|
||||
*
|
||||
* @return \Symfony\Component\Form\Form
|
||||
*/
|
||||
private function createMakeDefaultForm(?CustomFieldsGroup $group = null)
|
||||
private function createMakeDefaultForm(CustomFieldsGroup $group = null)
|
||||
{
|
||||
return $this->createFormBuilder($group, [
|
||||
'method' => 'POST',
|
||||
@@ -387,8 +383,8 @@ class CustomFieldsGroupController extends AbstractController
|
||||
$em = $this->getDoctrine()->getManager();
|
||||
|
||||
$customFieldsGroupIds = $em->createQuery('SELECT g.id FROM '
|
||||
. 'ChillCustomFieldsBundle:CustomFieldsDefaultGroup d '
|
||||
. 'JOIN d.customFieldsGroup g')
|
||||
.'ChillCustomFieldsBundle:CustomFieldsDefaultGroup d '
|
||||
.'JOIN d.customFieldsGroup g')
|
||||
->getResult(Query::HYDRATE_SCALAR);
|
||||
|
||||
$result = [];
|
||||
@@ -409,7 +405,7 @@ class CustomFieldsGroupController extends AbstractController
|
||||
private function getOptionsAvailable($entity)
|
||||
{
|
||||
$options = $this->getParameter('chill_custom_fields.'
|
||||
. 'customizables_entities');
|
||||
.'customizables_entities');
|
||||
|
||||
foreach ($options as $key => $definition) {
|
||||
if ($definition['class'] === $entity) {
|
||||
|
Reference in New Issue
Block a user