|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2016-04-16 13:56 UTC] nikic@php.net
-Status: Open
+Status: Duplicate
[2016-04-16 13:56 UTC] nikic@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Oct 24 11:00:02 2025 UTC |
Description: ------------ Some weeks ago, there was a change in the PHP master branch that changed the way interfaces are enforced and which creates a fatal error since then: Fatal error: Declaration of MShop_Coupon_Provider_Decorator_Abstract::__construct() must be compatible with MShop_Coupon_Provider_Factory_Interface::__construct(MShop_Context_Item_Interface $context, MShop_Coupon_Item_Interface $item, $code) in /home/travis/build/aimeos/arcavias-core/lib/mshoplib/src/MShop/Coupon/Provider/Decorator/Abstract.php on line 18 Test script: --------------- interface MShop_Coupon_Provider_Decorator_Interface extends MShop_Coupon_Provider_Interface { public function __construct( MShop_Context_Item_Interface $context, MShop_Coupon_Item_Interface $item, $code, MShop_Coupon_Provider_Interface $provider ); } interface MShop_Coupon_Provider_Factory_Interface extends MShop_Coupon_Provider_Interface { public function __construct( MShop_Context_Item_Interface $context, MShop_Coupon_Item_Interface $item, $code ); } interface MShop_Coupon_Provider_Interface { } abstract class MShop_Coupon_Provider_Abstract { public function __construct( MShop_Context_Item_Interface $context, MShop_Coupon_Item_Interface $item, $code ) { } } abstract class MShop_Coupon_Provider_Decorator_Abstract extends MShop_Coupon_Provider_Abstract implements MShop_Coupon_Provider_Decorator_Interface { public function __construct(MShop_Context_Item_Interface $context, MShop_Coupon_Item_Interface $couponItem, $code, MShop_Coupon_Provider_Interface $provider ) { parent::__construct( $context, $couponItem, $code ); } } Expected result: ---------------- Should work as before because the MShop_Coupon_Provider_Factory_Interface isn't used for MShop_Coupon_Provider_Decorator_Abstract. The original files are: - https://github.com/aimeos/arcavias-core/blob/master/lib/mshoplib/src/MShop/Coupon/Provider/Decorator/Interface.php - https://github.com/aimeos/arcavias-core/blob/master/lib/mshoplib/src/MShop/Coupon/Provider/Interface.php - https://github.com/aimeos/arcavias-core/blob/master/lib/mshoplib/src/MShop/Coupon/Provider/Factory/Interface.php - https://github.com/aimeos/arcavias-core/blob/master/lib/mshoplib/src/MShop/Coupon/Provider/Abstract.php -https://github.com/aimeos/arcavias-core/blob/master/lib/mshoplib/src/MShop/Coupon/Provider/Decorator/Abstract.php Actual result: -------------- Fatal error: Declaration of MShop_Coupon_Provider_Decorator_Abstract::__construct() must be compatible with MShop_Coupon_Provider_Factory_Interface::__construct(MShop_Context_Item_Interface $context, MShop_Coupon_Item_Interface $item, $code) in /home/travis/build/aimeos/arcavias-core/lib/mshoplib/src/MShop/Coupon/Provider/Decorator/Abstract.php on line 18