diff --git a/src/Rector/v11/v5/tca/SimplifyCheckboxItemsTCARector.php b/src/Rector/v11/v5/tca/SimplifyCheckboxItemsTCARector.php index 526559593..3bf263df1 100644 --- a/src/Rector/v11/v5/tca/SimplifyCheckboxItemsTCARector.php +++ b/src/Rector/v11/v5/tca/SimplifyCheckboxItemsTCARector.php @@ -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; } diff --git a/tests/Rector/v11/v5/tca/SimplifyCheckboxItemsTCARector/Fixture/fixture.php.inc b/tests/Rector/v11/v5/tca/SimplifyCheckboxItemsTCARector/Fixture/fixture.php.inc index e2a4bf112..f472df6da 100644 --- a/tests/Rector/v11/v5/tca/SimplifyCheckboxItemsTCARector/Fixture/fixture.php.inc +++ b/tests/Rector/v11/v5/tca/SimplifyCheckboxItemsTCARector/Fixture/fixture.php.inc @@ -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', + ], + ], + ], + ], ], ]; ?> @@ -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', + ], + ], + ], + ], ], ]; ?>