php cs fixes after updating php cs fixer

This commit is contained in:
2024-01-10 10:31:25 +01:00
parent 60ede58af0
commit 3c8e59e088
682 changed files with 2097 additions and 882 deletions

View File

@@ -86,7 +86,7 @@ class CreateFieldsOnGroupCommand extends Command
$em = $this->entityManager;
$customFieldsGroups = $em
->getRepository(\Chill\CustomFieldsBundle\Entity\CustomFieldsGroup::class)
->getRepository(CustomFieldsGroup::class)
->findAll();
if (0 === \count($customFieldsGroups)) {

View File

@@ -25,7 +25,9 @@ use Symfony\Contracts\Translation\TranslatorInterface;
*/
class CustomFieldController extends AbstractController
{
public function __construct(private readonly TranslatorInterface $translator) {}
public function __construct(private readonly TranslatorInterface $translator)
{
}
/**
* Creates a new CustomField entity.
@@ -121,7 +123,7 @@ class CustomFieldController extends AbstractController
{
$em = $this->getDoctrine()->getManager();
$entity = $em->getRepository(\Chill\CustomFieldsBundle\Entity\CustomField::class)->find($id);
$entity = $em->getRepository(CustomField::class)->find($id);
if (!$entity) {
throw $this->createNotFoundException('Unable to find CustomField entity.');

View File

@@ -36,7 +36,9 @@ class CustomFieldsGroupController extends AbstractController
/**
* CustomFieldsGroupController constructor.
*/
public function __construct(private readonly CustomFieldProvider $customFieldProvider, private readonly TranslatorInterface $translator) {}
public function __construct(private readonly CustomFieldProvider $customFieldProvider, private readonly TranslatorInterface $translator)
{
}
/**
* Creates a new CustomFieldsGroup entity.
@@ -78,7 +80,7 @@ class CustomFieldsGroupController extends AbstractController
{
$em = $this->getDoctrine()->getManager();
$entity = $em->getRepository(\Chill\CustomFieldsBundle\Entity\CustomFieldsGroup::class)->find($id);
$entity = $em->getRepository(CustomFieldsGroup::class)->find($id);
if (!$entity) {
throw $this->createNotFoundException('Unable to find CustomFieldsGroup entity.');
@@ -101,7 +103,7 @@ class CustomFieldsGroupController extends AbstractController
{
$em = $this->getDoctrine()->getManager();
$cfGroups = $em->getRepository(\Chill\CustomFieldsBundle\Entity\CustomFieldsGroup::class)->findAll();
$cfGroups = $em->getRepository(CustomFieldsGroup::class)->findAll();
$defaultGroups = $this->getDefaultGroupsId();
$makeDefaultFormViews = [];
@@ -133,13 +135,13 @@ class CustomFieldsGroupController extends AbstractController
$em = $this->getDoctrine()->getManager();
$cFGroup = $em->getRepository(\Chill\CustomFieldsBundle\Entity\CustomFieldsGroup::class)->findOneById($cFGroupId);
$cFGroup = $em->getRepository(CustomFieldsGroup::class)->findOneById($cFGroupId);
if (!$cFGroup) {
throw $this->createNotFoundException('customFieldsGroup not found with '."id {$cFGroupId}");
}
$cFDefaultGroup = $em->getRepository(\Chill\CustomFieldsBundle\Entity\CustomFieldsDefaultGroup::class)
$cFDefaultGroup = $em->getRepository(CustomFieldsDefaultGroup::class)
->findOneByEntity($cFGroup->getEntity());
if ($cFDefaultGroup) {
@@ -194,7 +196,7 @@ class CustomFieldsGroupController extends AbstractController
{
$em = $this->getDoctrine()->getManager();
$entity = $em->getRepository(\Chill\CustomFieldsBundle\Entity\CustomFieldsGroup::class)->find($id);
$entity = $em->getRepository(CustomFieldsGroup::class)->find($id);
if (!$entity) {
throw $this->createNotFoundException('Unable to find CustomFieldsGroups entity.');
@@ -238,7 +240,7 @@ class CustomFieldsGroupController extends AbstractController
{
$em = $this->getDoctrine()->getManager();
$entity = $em->getRepository(\Chill\CustomFieldsBundle\Entity\CustomFieldsGroup::class)->find($id);
$entity = $em->getRepository(CustomFieldsGroup::class)->find($id);
if (!$entity) {
throw $this->createNotFoundException('Unable to find CustomFieldsGroup entity.');
@@ -262,7 +264,7 @@ class CustomFieldsGroupController extends AbstractController
{
$em = $this->getDoctrine()->getManager();
$entity = $em->getRepository(\Chill\CustomFieldsBundle\Entity\CustomFieldsGroup::class)->find($id);
$entity = $em->getRepository(CustomFieldsGroup::class)->find($id);
if (!$entity) {
throw $this->createNotFoundException('Unable to find CustomFieldsGroup entity.');

View File

@@ -43,7 +43,8 @@ class CustomFieldChoice extends AbstractCustomField
* @var TranslatableStringHelper Helper that find the string in current locale from an array of translation
*/
private readonly TranslatableStringHelper $translatableStringHelper
) {}
) {
}
public function allowOtherChoice(CustomField $cf)
{

View File

@@ -45,7 +45,8 @@ class CustomFieldDate extends AbstractCustomField
public function __construct(
private readonly Environment $templating,
private readonly TranslatableStringHelper $translatableStringHelper
) {}
) {
}
public function buildForm(FormBuilderInterface $builder, CustomField $customField)
{

View File

@@ -28,7 +28,8 @@ class CustomFieldLongChoice extends AbstractCustomField
private readonly OptionRepository $optionRepository,
private readonly TranslatableStringHelper $translatableStringHelper,
private readonly \Twig\Environment $templating,
) {}
) {
}
public function buildForm(FormBuilderInterface $builder, CustomField $customField)
{

View File

@@ -42,7 +42,8 @@ class CustomFieldNumber extends AbstractCustomField
public function __construct(
private readonly Environment $templating,
private readonly TranslatableStringHelper $translatableStringHelper
) {}
) {
}
public function buildForm(FormBuilderInterface $builder, CustomField $customField)
{

View File

@@ -29,7 +29,8 @@ class CustomFieldText extends AbstractCustomField
public function __construct(
private readonly Environment $templating,
private readonly TranslatableStringHelper $translatableStringHelper
) {}
) {
}
/**
* Create a form according to the maxLength option.

View File

@@ -32,7 +32,8 @@ class CustomFieldTitle extends AbstractCustomField
* @var TranslatableStringHelper Helper that find the string in current locale from an array of translation
*/
private readonly TranslatableStringHelper $translatableStringHelper
) {}
) {
}
public function buildForm(FormBuilderInterface $builder, CustomField $customField)
{

View File

@@ -30,7 +30,9 @@ use Symfony\Component\OptionsResolver\OptionsResolver;
class CustomFieldType extends AbstractType
{
public function __construct(private readonly CustomFieldProvider $customFieldProvider, private readonly ObjectManager $om, private readonly TranslatableStringHelper $translatableStringHelper) {}
public function __construct(private readonly CustomFieldProvider $customFieldProvider, private readonly ObjectManager $om, private readonly TranslatableStringHelper $translatableStringHelper)
{
}
public function buildForm(FormBuilderInterface $builder, array $options)
{

View File

@@ -27,7 +27,8 @@ class CustomFieldsGroupType extends AbstractType
private readonly array $customizableEntities,
// TODO : add comment about this variable
private readonly TranslatorInterface $translator
) {}
) {
}
// TODO : details about the function
public function buildForm(FormBuilderInterface $builder, array $options)

View File

@@ -17,7 +17,9 @@ use Symfony\Component\Form\DataTransformerInterface;
class CustomFieldDataTransformer implements DataTransformerInterface
{
public function __construct(private readonly CustomFieldInterface $customFieldDefinition, private readonly CustomField $customField) {}
public function __construct(private readonly CustomFieldInterface $customFieldDefinition, private readonly CustomField $customField)
{
}
public function reverseTransform($value)
{

View File

@@ -18,7 +18,9 @@ use Symfony\Component\Form\Exception\TransformationFailedException;
class CustomFieldsGroupToIdTransformer implements DataTransformerInterface
{
public function __construct(private readonly ObjectManager $om) {}
public function __construct(private readonly ObjectManager $om)
{
}
/**
* Transforms a string (id) to an object (CustomFieldsGroup).

View File

@@ -16,7 +16,9 @@ use Symfony\Component\Form\FormBuilderInterface;
class CustomFieldsTitleType extends AbstractType
{
public function buildForm(FormBuilderInterface $builder, array $options) {}
public function buildForm(FormBuilderInterface $builder, array $options)
{
}
public function getBlockPrefix()
{

View File

@@ -42,7 +42,9 @@ class LinkedCustomFieldsType extends AbstractType
*/
private array $options = [];
public function __construct(private readonly TranslatableStringHelper $translatableStringHelper) {}
public function __construct(private readonly TranslatableStringHelper $translatableStringHelper)
{
}
/**
* append Choice on POST_SET_DATA event.

View File

@@ -29,7 +29,9 @@ class CustomFieldsHelper
* @param CustomFieldProvider $provider The customfield provider that
* contains all the declared custom fields
*/
public function __construct(private readonly EntityManagerInterface $em, private readonly CustomFieldProvider $provider) {}
public function __construct(private readonly EntityManagerInterface $em, private readonly CustomFieldProvider $provider)
{
}
public function isEmptyValue(array $fields, CustomField $customField)
{

View File

@@ -31,7 +31,9 @@ class CustomFieldRenderingTwig extends AbstractExtension
'label_layout' => '@ChillCustomFields/CustomField/render_label.html.twig',
];
public function __construct(private readonly CustomFieldsHelper $customFieldsHelper) {}
public function __construct(private readonly CustomFieldsHelper $customFieldsHelper)
{
}
/**
* (non-PHPdoc).

View File

@@ -29,7 +29,7 @@ use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase;
final class CustomFieldsChoiceTest extends KernelTestCase
{
/**
* @var \Chill\CustomFieldsBundle\CustomFields\CustomFieldChoice
* @var CustomFieldChoice
*/
private $cfChoice;

View File

@@ -43,7 +43,7 @@ final class CustomFieldsTextTest extends WebTestCase
$customField
);
$this->assertInstanceOf(
\Chill\CustomFieldsBundle\CustomFields\CustomFieldText::class,
CustomFieldText::class,
$customField
);
}