我使用的是CakePHP 2.2.4和MongoDB2.2.2
我已经处理了几个问题,但是在cakephp主页上有以下错误
Strict (2048): Declaration of MongodbSource::execute() should be compatible with DboSource::execute($sql, $options = Array, $params = Array) [APP/Plugin/Mongodb/Model/Datasource/MongodbSource.php, line 36]对于这些函数声明,我得到了类似的错误。
MongodbSource扩展DbSource
在DbSource中:
public function execute($sql, $options = array(), $params = array()) { <code here> }在MongodbSource中:
public function execute($query, $params = array()) { <code here> }我有点理解发生了什么,但我不知道该如何解决。
发布于 2012-12-16 06:45:27
重写父方法的方法应该实现相同的参数,即execute方法在MongodbSource中的签名应该是:
public function execute($sql, $options = array(), $params = array())另请参阅:
Declaration of Methods should be Compatible with Parent Methods in PHP
https://www.google.com/search?q=php+Declaration+of+should+be+compatible+with
http://php.net/manual/en/migration51.oop.php#migration51.oop-inheritance
https://stackoverflow.com/questions/13898511
复制相似问题