mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-20 14:43:49 +00:00
cs: Enable a couple of risky rules.
This commit is contained in:
@@ -197,7 +197,7 @@ class CreateFieldsOnGroupCommand extends Command
|
||||
$em->persist($cf);
|
||||
$output->writeln('<info>Adding Custom Field of type '
|
||||
. $cf->getType() . "\t with slug " . $cf->getSlug() .
|
||||
"\t and names : " . implode($names, ', ') . '</info>');
|
||||
"\t and names : " . implode(', ', $names) . '</info>');
|
||||
} else {
|
||||
throw new RuntimeException('Error in field ' . $slug);
|
||||
}
|
||||
|
@@ -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;
|
||||
}
|
||||
}
|
||||
|
@@ -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
|
||||
|
@@ -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';
|
||||
|
||||
|
@@ -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';
|
||||
}
|
||||
|
||||
|
@@ -104,7 +104,7 @@ class CustomFieldsGroup
|
||||
|
||||
foreach ($this->customFields as $cf) {
|
||||
if ($cf->isActive()) {
|
||||
array_push($this->activeCustomFields, $cf);
|
||||
$this->activeCustomFields[] = $cf;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -43,12 +43,10 @@ class CustomFieldsGroupToIdTransformer implements DataTransformerInterface
|
||||
|
||||
if ($id instanceof CustomFieldsGroup) {
|
||||
throw new TransformationFailedException(
|
||||
sprintf(
|
||||
'The transformation failed: the expected argument on '
|
||||
'The transformation failed: the expected argument on '
|
||||
. 'reverseTransform is an object of type int,'
|
||||
. 'Chill\CustomFieldsBundle\Entity\CustomFieldsGroup, '
|
||||
. 'given'
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user