cs: Enable more risky rules.

This commit is contained in:
Pol Dellaiera
2021-11-30 11:37:57 +01:00
parent c8195e6df5
commit a9188355c5
193 changed files with 306 additions and 63 deletions

View File

@@ -21,6 +21,10 @@ 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;
use function is_array;
use function LogicException;
class CustomFieldChoice extends AbstractCustomField
@@ -229,10 +233,10 @@ class CustomFieldChoice extends AbstractCustomField
if ($cf->getOptions()[self::MULTIPLE]) {
if ($cf->getOptions()[self::ALLOW_OTHER]) {
return \in_array($choiceSlug, $this->deserialize($data, $cf)['_choices']);
return in_array($choiceSlug, $this->deserialize($data, $cf)['_choices']);
}
return \in_array($choiceSlug, $this->deserialize($data, $cf));
return in_array($choiceSlug, $this->deserialize($data, $cf));
}
if ($cf->getOptions()[self::ALLOW_OTHER]) {

View File

@@ -21,6 +21,9 @@ 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;
class CustomFieldLongChoice extends AbstractCustomField
{

View File

@@ -18,6 +18,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
{