Skip to content

Commit

Permalink
Removed unused code
Browse files Browse the repository at this point in the history
  • Loading branch information
zmitic committed Aug 5, 2022
1 parent d1265fa commit 1711feb
Showing 1 changed file with 0 additions and 15 deletions.
15 changes: 0 additions & 15 deletions src/Accessor/CollectionMapper.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,10 @@ public function update(array $options, &$data, FormInterface $form): void
}

$removeEntry = $options['entry_options']['remove_entry'] ?? null;
$removalCallback = $this->extractRemoveEntryFromCollection($form);
foreach ($toRemove as $item) {
if ($removeEntry) {
$removeEntry($item);
}
if ($removalCallback) {
$removalCallback($item);
}
$this->submit($data, $item, $removerReflection);
}
}
Expand Down Expand Up @@ -123,15 +119,4 @@ private function search(callable $compare, int|string $key, object|array $value,

return false;
}

private function extractRemoveEntryFromCollection(FormInterface $form): ?Closure
{
foreach ($form as $child) {
$options = $child->getConfig()->getOptions();

return $options['remove_entry'] ?? null;
}

return null;
}
}

0 comments on commit 1711feb

Please sign in to comment.