Bug #69629 [Opn->Dup]: PHP Fatal error: Not compatible with interface
| From: | nikic@php.net | Date: | Sat, 16 Apr 2016 13:56:25 +0000 |
| Subject: | Bug #69629 [Opn->Dup]: PHP Fatal error: Not compatible with interface | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-200595@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=69629&edit=1
ID: 69629
Updated by: nikic@php.net
Reported by: toco at aimeos dot org
Summary: PHP Fatal error: Not compatible with interface
-Status: Open
+Status: Duplicate
Type: Bug
Package: *General Issues
Operating System: Travis-ci
PHP Version: master-Git-2015-05-13 (Git)
Block user comment: N
Private report: N
New Comment:
Duplicate of the bug linked by cmb.
Previous Comments:
------------------------------------------------------------------------
[2016-01-03 13:13:00] cmb@php.net
Related To: Bug #71248
------------------------------------------------------------------------
[2015-05-13 11:05:56] toco at aimeos dot org
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
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=69629&edit=1