Skip to content

Commit

Permalink
ModifierAction cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
Thijzer committed Oct 18, 2023
1 parent fb57c59 commit 469d512
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/Component/Action/ModifierAction.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class ModifierAction implements OptionsInterface
/** @var array */
private $options = [
'modifier' => null,
'format' => null,
'formatter' => null,
'keys' => null,
];

Expand Down Expand Up @@ -55,7 +55,7 @@ public function apply($item)
}
$item[$key] = $modifier->modify($listItem);
}
if (null !== $listItem && $this->options['format'] && $formatter = $this->getFormatter($this->options['format'])) {
if (null !== $listItem && $this->options['formatter'] && $formatter = $this->getFormatter($this->options['formatter'])) {
if (is_array($listItem)) {
$item[$key] = array_map(function ($itemValue) use ($formatter) {
return is_string($itemValue) ? $formatter->format($itemValue) : $formatter->reverseFormat($itemValue);
Expand Down
2 changes: 1 addition & 1 deletion tests/Component/Action/ModifierActionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ public function test_it_should_format_a_boolean_action(): void

$action->setOptions(
[
'format' => 'boolean',
'formatter' => 'boolean',
'keys' => 'active',
'true' => 'TRUE',
'false' => 'FALSE',
Expand Down

0 comments on commit 469d512

Please sign in to comment.