Skip to content

Commit

Permalink
[BUGFIX] Fix check for renderType
Browse files Browse the repository at this point in the history
  • Loading branch information
simonschaufi committed Jan 30, 2024
1 parent 5d63e98 commit bf42f06
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/Rector/v11/v5/tca/SimplifyCheckboxItemsTCARector.php
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,11 @@ protected function refactorColumn(Expr $columnName, Expr $columnTca): void
return;
}

if (! $this->isConfigType($configArray, 'check')
&& ! $this->configIsOfRenderType($configArray, 'checkboxToggle')
) {
if (! $this->isConfigType($configArray, 'check')) {
return;
}

if (! $this->configIsOfRenderType($configArray, 'checkboxToggle')) {
return;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,20 @@ return [
],
],
],
'leave_as_is' => [
'label' => 'Leave as is!',
'config' => [
'type' => 'check',
'renderType' => 'checkboxLabeledToggle',
'items' => [
[
'label' => 'Enabled/Disabled',
'labelChecked' => 'Enabled',
'labelUnchecked' => 'Disabled',
],
],
],
],
],
];
?>
Expand Down Expand Up @@ -96,6 +110,20 @@ return [
],
],
],
'leave_as_is' => [
'label' => 'Leave as is!',
'config' => [
'type' => 'check',
'renderType' => 'checkboxLabeledToggle',
'items' => [
[
'label' => 'Enabled/Disabled',
'labelChecked' => 'Enabled',
'labelUnchecked' => 'Disabled',
],
],
],
],
],
];
?>

0 comments on commit bf42f06

Please sign in to comment.