PHP警告:声明应与

时间:2019-01-31 16:45:37

标签: php

我有一堂课,扩展了另一堂课。在我的课程中,我正在重载方法并在其中传递参数。一切正常,但是我在PHP中收到警告,因为基本方法没有参数:

  

PHP警告:的声明   WC_Email_Subscription_Notification :: get_content($ categories)应该是   与WC_Email :: get_content()兼容

我无法更改替代方法!:

public function trigger( $categories ) {
    $content = $this->get_content( $categories );
}

public function get_content( $categories ) {
    $this->sending = true;
    $email_content = str_replace( '{categories}', implode( ', ', $categories ), $this->get_content_html() );
    return wordwrap( $email_content, 70 );
}

如何防止PHP现在向我发出此警告?还是有更好的方法来传递参数?

0 个答案:

没有答案