Magestore / Bannerslider-Magento2

Banner Slider Extension on Magento 2 - best way to capture the eyes of visitors!
http://www.magestore.com/banner-slider-on-magento2.html/
82 stars 100 forks source link

Incompatible argument type: Required type: \Magento\Framework\DB\Adapter\AdapterInterface. Actual type: \Zend_Db_Adapter_Abstract #132

Closed fluidum closed 7 months ago

fluidum commented 7 months ago

Update to Magento 2.4.4-p6, PHP 8.1.27 caused me an error when I ran bin/magento setup:di:compile:

Errors during compilation:
        Magestore\Bannerslider\Model\ResourceModel\Report\Collection
                Incompatible argument type: Required type: \Magento\Framework\DB\Adapter\AdapterInterface. Actual type: \Zend_Db_Adapter_Abstract; File:
/opt/magento/app/code/Magestore/Bannerslider/Model/ResourceModel/Report/Collection.php

        Magestore\Bannerslider\Model\ResourceModel\Slider\Collection
                Incompatible argument type: Required type: \Magento\Framework\DB\Adapter\AdapterInterface. Actual type: \Zend_Db_Adapter_Abstract; File:
/opt/magento/app/code/Magestore/Bannerslider/Model/ResourceModel/Slider/Collection.php

        Magestore\Bannerslider\Model\ResourceModel\Banner\Collection
                Incompatible argument type: Required type: \Magento\Framework\DB\Adapter\AdapterInterface. Actual type: \Zend_Db_Adapter_Abstract; File:
/opt/magento/app/code/Magestore/Bannerslider/Model/ResourceModel/Banner/Collection.php

Total Errors Count: 3

In Log.php line 92:

  Error during compilation

Solution

Changed from * @param \Zend_Db_Adapter_Abstract $connection to: * @param \Magento\Framework\DB\Adapter\AdapterInterface $connection in /opt/magento/app/code/Magestore/Bannerslider/Model/ResourceModel/Banner/Collection.php /opt/magento/app/code/Magestore/Bannerslider/Model/ResourceModel/Slider/Collection.php /opt/magento/app/code/Magestore/Bannerslider/Model/ResourceModel/Report/Collection.php