Skip to content

Commit

Permalink
scrutinizer code quality fix #4
Browse files Browse the repository at this point in the history
  • Loading branch information
sadikoff committed Dec 22, 2017
1 parent fac271e commit 8ddb275
Showing 1 changed file with 3 additions and 16 deletions.
19 changes: 3 additions & 16 deletions src/Form/Manipulator/DefaultManipulator.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
use Symfony\Component\Form\FormInterface;

/**
* Class DefaultManipulator
* Class DefaultManipulator.
*
* @author David ALLIX
* @author Sadicov Vladimir <sadikoff@gmail.com>
Expand Down Expand Up @@ -36,7 +36,6 @@ public function getFieldsConfig(FormInterface $form)
{
$class = $this->getDataClass($form);
$formOptions = $form->getConfig()->getOptions();

$formFields = $formOptions['fields'];

$objectFields = $this->objectInfo->getFieldsConfig($class);
Expand All @@ -49,14 +48,7 @@ public function getFieldsConfig(FormInterface $form)
$this->checkUnknownFields($formFields, $objectFields, $class);

$fieldsConfig = $this->filterFields($formFields);

array_walk(
$fieldsConfig,
function (&$v, $k, $d) {
$v += $d[$k];
},
$objectFields
);
array_walk($fieldsConfig, function (&$v, $k, $d) {$v += $d[$k]; }, $objectFields);

return $fieldsConfig;
}
Expand Down Expand Up @@ -116,11 +108,6 @@ private function filterObjectFields(array $objectFieldsConfig, array $formExclud

private function filterFields($fields)
{
return array_filter(
$fields,
function ($v) {
return !(null === $v || (array_key_exists('display', $v) && !$v['display']));
}
);
return array_filter($fields, function ($v) {return !(null === $v || (array_key_exists('display', $v) && !$v['display'])); });
}
}

0 comments on commit 8ddb275

Please sign in to comment.