Bug #69629 [NEW]: PHP Fatal error: Not compatible with interface
From: toco at aimeos dot org
Operating system: Travis-ci
PHP version: master-Git-2015-05-13 (Git)
Package: *General Issues
Bug Type: Bug
Bug description:PHP Fatal error: Not compatible with interface
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 bug report at https://bugs.php.net/bug.php?id=69629&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=69629&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=69629&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=69629&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=69629&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=69629&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=69629&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=69629&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=69629&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=69629&r=support
Expected behavior: https://bugs.php.net/fix.php?id=69629&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=69629&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=69629&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=69629&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=69629&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=69629&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=69629&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=69629&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=69629&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=69629&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=69629&r=mysqlcfg
Thread (2 messages)
- toco at aimeos dot org