Я получаю следующую ошибку при запуске PHP 5.3.13 и не понимаю почему.
Объявление CustomCourse :: toArray () должно быть совместимо с объявлением BaseCourse :: toArray ()
Это мой PHP-код ниже, хотя он сокращен до важных вещей, чтобы длина сообщения оставалась только необходимой.
Я также должен добавить, что класс Course
не предоставляет метода toArray
.
Я вижу другие похожие темы на SO, но, похоже, ни одна из них не предлагает мне решения.
/**
* this is the CHILD class
*/
class CustomCourse extends BaseCourse {
public function toArray() {
$values = parent::toArray();
// do some more with $values here
return $values;
}
}
/**
* this is the PARENT class
*/
class BaseContact extends Course {
public function toArray($platform = GOLF_PLATFORM) {
$values = array();
$values['user_id'] = $this->getUserId();
// do some more in here
return $values;
}
}
childClass::customMethod() has different arguments, or a different access level (public/private/protected) than parentClass::customMethod().
ко мне не относится. - person crmpicco   schedule 20.05.2013