cs: Fix code-style (using PHPCSFixer and PHPCS).

This commit is contained in:
Pol Dellaiera
2021-12-21 10:59:23 +01:00
parent b7360955f7
commit 8401ce2656
280 changed files with 742 additions and 319 deletions

View File

@@ -25,6 +25,7 @@ use Symfony\Component\Console\Question\Question;
use Symfony\Component\Validator\Validator\ValidatorInterface;
use Symfony\Component\Yaml\Exception\ParseException;
use Symfony\Component\Yaml\Parser;
use function count;
/**

View File

@@ -23,6 +23,7 @@ use Symfony\Bridge\Twig\TwigEngine;
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Contracts\Translation\TranslatorInterface;
use function array_key_exists;
use function count;
use function in_array;

View File

@@ -135,7 +135,7 @@ class CustomFieldDate extends AbstractCustomField
return null;
}
return $date->format('Y-m-d');
return $date->format('Y-m-d');
default:
$template = 'ChillCustomFieldsBundle:CustomFieldsRendering:date.'

View File

@@ -21,6 +21,7 @@ use LogicException;
use Symfony\Bridge\Twig\TwigEngine;
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
use Symfony\Component\Form\FormBuilderInterface;
use function get_class;
use function gettype;
use function is_object;

View File

@@ -18,7 +18,6 @@ use Symfony\Component\Form\Extension\Core\Type\IntegerType;
use Symfony\Component\Form\Extension\Core\Type\NumberType;
use Symfony\Component\Form\Extension\Core\Type\TextType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\Validator\Constraints\GreaterThanOrEqual;
use Symfony\Component\Validator\Constraints\LessThanOrEqual;

View File

@@ -20,6 +20,7 @@ use Symfony\Component\Form\Extension\Core\Type\TextareaType;
use Symfony\Component\Form\Extension\Core\Type\TextType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\HttpFoundation\RequestStack;
use function array_key_exists;
class CustomFieldText extends AbstractCustomField
@@ -65,8 +66,10 @@ class CustomFieldText extends AbstractCustomField
$attrArray = [];
if (array_key_exists(self::MULTIPLE_CF_INLINE, $options)
&& $options[self::MULTIPLE_CF_INLINE]) {
if (
array_key_exists(self::MULTIPLE_CF_INLINE, $options)
&& $options[self::MULTIPLE_CF_INLINE]
) {
$attrArray['class'] = 'multiple-cf-inline';
}

View File

@@ -20,6 +20,7 @@ use Symfony\Component\Form\FormEvent;
use Symfony\Component\Form\FormEvents;
use Symfony\Component\OptionsResolver\OptionsResolver;
use Symfony\Component\Translation\TranslatorInterface;
use function count;
class CustomFieldsGroupType extends AbstractType

View File

@@ -15,6 +15,7 @@ use Chill\CustomFieldsBundle\Entity\CustomFieldsGroup;
use Doctrine\Persistence\ObjectManager;
use Symfony\Component\Form\DataTransformerInterface;
use Symfony\Component\Form\Exception\TransformationFailedException;
use function gettype;
class CustomFieldsGroupToIdTransformer implements DataTransformerInterface

View File

@@ -14,7 +14,9 @@ namespace Chill\CustomFieldsBundle\Form\DataTransformer;
use Chill\CustomFieldsBundle\Entity\CustomField;
use Doctrine\Persistence\ObjectManager;
use Symfony\Component\Form\DataTransformerInterface;
use function array_key_exists;
use const JSON_THROW_ON_ERROR;
class JsonCustomFieldToArrayTransformer implements DataTransformerInterface
@@ -33,7 +35,9 @@ class JsonCustomFieldToArrayTransformer implements DataTransformerInterface
// @TODO: in the array_map callback, CustomField::getLabel() does not exist. What do we do here?
$customFieldsLablels = array_map(
static function ($e) { return $e->getLabel(); },
static function ($e) {
return $e->getLabel();
},
$customFields
);

View File

@@ -15,6 +15,7 @@ use Symfony\Component\Form\AbstractTypeExtension;
use Symfony\Component\Form\FormInterface;
use Symfony\Component\Form\FormView;
use Symfony\Component\OptionsResolver\OptionsResolver;
use function array_key_exists;
/**

View File

@@ -17,7 +17,6 @@ use Symfony\Component\Form\Extension\Core\Type\CheckboxType;
use Symfony\Component\Form\Extension\Core\Type\HiddenType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\Form\FormEvent;
use Symfony\Component\Form\FormEvents;
class ChoicesListType extends AbstractType

View File

@@ -18,7 +18,8 @@ use Symfony\Component\HttpFoundation\Request;
// This check prevents access to debug front controllers that are deployed by accident to production servers.
// Feel free to remove this, extend it, or make something more sophisticated.
if (isset($_SERVER['HTTP_CLIENT_IP'])
if (
isset($_SERVER['HTTP_CLIENT_IP'])
|| isset($_SERVER['HTTP_X_FORWARDED_FOR'])
|| !(in_array($_SERVER['REMOTE_ADDR'], ['127.0.0.1', 'fe80::1', '::1'], true) || \PHP_SAPI === 'cli-server')
) {