cs: Enable a couple of risky rules.

This commit is contained in:
Pol Dellaiera
2021-11-24 12:38:18 +01:00
parent acc4647346
commit f531cdc0ec
51 changed files with 130 additions and 132 deletions

View File

@@ -15,6 +15,6 @@ abstract class AbstractCustomField implements CustomFieldInterface
{
public function isEmptyValue($value, CustomField $customField)
{
return empty($value) and false !== $value;
return empty($value) && false !== $value;
}
}

View File

@@ -191,7 +191,7 @@ class CustomFieldChoice extends AbstractCustomField
if ($this->allowOtherChoice($cf)) {
$labels = $cf->getOptions()[self::OTHER_VALUE_LABEL];
if (!is_array($labels) or count($labels) === 0) {
if (!is_array($labels) || count($labels) === 0) {
$labels['back'] = 'other value';
}
$choices['_other'] = $this->translatableStringHelper

View File

@@ -59,7 +59,7 @@ class CustomFieldNumber extends AbstractCustomField
$options = $customField->getOptions();
//select the type depending to the SCALE
$type = (0 === $options[self::SCALE] or null === $options[self::SCALE]) ?
$type = (0 === $options[self::SCALE] || null === $options[self::SCALE]) ?
IntegerType::class : NumberType::class;
//'integer' : 'number';

View File

@@ -63,7 +63,7 @@ class CustomFieldText extends AbstractCustomField
$attrArray = [];
if (array_key_exists(self::MULTIPLE_CF_INLINE, $options)
and $options[self::MULTIPLE_CF_INLINE]) {
&& $options[self::MULTIPLE_CF_INLINE]) {
$attrArray['class'] = 'multiple-cf-inline';
}