You wrote
public static _fromJSON($data) {
instead of
public static function _fromJSON($data) {
The Fatal Error you get when you fix this is because your Constructor signature is not identical to the Constructor signature demanded by the interface PuSHSubscriptionInterface
, which is defined at the bottom of your PuSHSubscriber.php
public function __construct(
$domain, $subscriber_id, $hub,
$topic, $secret, $status = '',
$callback_url, $verify_token, $lease_time='');
while yours is
public function __construct(
$domain, $subscriber_id, $hub,
$topic, $secret, $status = '',
$callback_url, $verify_token, $lease_time)
You made the last argument required. The note in the PHP Manual clearly says:
The class implementing the interface must use the exact same method signatures as are defined in the interface. Not doing so will result in a fatal error.
The point of an interface is have a contract. Classes implementing this contract may not alter the method signatures defined by the interface, because that would break the contract and defeat the purpose of the interface.
When the interface IFoo
says you should have
public function fn($arg1, $arg2, $arg3 = NULL);
then every class implementing IFoo
must implement the methods as defined in the interface.