Closed hbugdoll closed 10 months ago
enableValue=1
disableValue=0
ToggleStatusActiveButton
Website
Theme
Rector replaced the switch statement in luya-module-admin/src/buttons/ToggleStatusActiveButton::toggleValue() with new PHP 8 match statement (see https://github.com/luyadev/luya-module-admin/commit/5e0574ad26b76fa19b87f390bada6aaf7339605c).
switch
luya-module-admin/src/buttons/ToggleStatusActiveButton::toggleValue()
match
Because of
Unlike switch, the comparison is an identity check (===) rather than a weak equality check (==). https://www.php.net/manual/en/control-structures.match.php
toggling to other values than true or false leads into an InvalidArgumentException.
true
false
InvalidArgumentException
Perfect! Thanks
What are you changing/introducing
enableValue=1
anddisableValue=0
forToggleStatusActiveButton
inWebsite
andTheme
model.What is the reason for changing/introducing
Rector replaced the
switch
statement inluya-module-admin/src/buttons/ToggleStatusActiveButton::toggleValue()
with new PHP 8match
statement (see https://github.com/luyadev/luya-module-admin/commit/5e0574ad26b76fa19b87f390bada6aaf7339605c).Because of
toggling to other values than
true
orfalse
leads into anInvalidArgumentException
.QA