I have a website (Magento 2.4.2 + php7.4) which runs well,then I upgraded it to (Magento 2.4.7-beta1 + php8.2) via composer, upgradtion succeeded,if the 3rd party app "Amasty" is removed from the project,"sudo php bin/magento setup:di:compile" ran well too; if the 3rd party app "Amasty" is kept on the project, "sudo php bin/magento setup:di:compile" got error: Compilation was started. Repositories code generation... 1/9 [===>------------------------] 11% < 1 sec 125.0 MiBPHP Fatal error: Cannot declare class Amasty\AdminActionsLog\lib\HtmlNode, because the name is already in use in /var/www/html/mydomain.com/app/code/Amasty/AdminActionsLog/lib/HtmlNode.php on line 6, note : line 6 content is "class HtmlNode {" below are 3 files of php partial source code among Amasty: (1) app\code\Amasty\AdminActionsLog\lib\HtmlNode.php
<?php
namespace Amasty\AdminActionsLog\lib;
include_once 'HtmlNodeText.php';
include_once 'HtmlSelector.php';
class HtmlNode {
const NODE_ELEMENT = 0;
(2) app\code\Amasty\AdminActionsLog\lib\HtmlNodeCdata.php
<?php
namespace Amasty\AdminActionsLog\lib;
class HtmlNodeCdata extends HtmlNode {
(3) app\code\Amasty\AdminActionsLog\lib\HtmlNodeComment.php
<?php
namespace Amasty\AdminActionsLog\lib;
class HtmlNodeComment extends HtmlNode {
my question is : why "sudo php bin/magento setup:di:compile" ran well in php7.4 but got errors in php8.2 and how to fix it ?
thank you in advance.