luyadev / luya-module-cms

The LUYA CMS module provides a full functional CMS for adding contents based on blocks.
https://luya.io
MIT License
33 stars 46 forks source link

Fixed website and theme status ActiveButtons (PHP 8) #406

Closed hbugdoll closed 10 months ago

hbugdoll commented 10 months ago

What are you changing/introducing

What is the reason for changing/introducing

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).

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.

QA

Q A
Is bugfix? yes
New feature? no
Breaks BC? no
Tests pass? yes
Fixed issues Closes #405
nadar commented 10 months ago

Perfect! Thanks