From 37b5b18e436b488a8be9eef67725cb203a1b3a99 Mon Sep 17 00:00:00 2001 From: Petr Skoda Date: Sun, 20 Dec 2009 16:34:18 +0000 Subject: [PATCH] MDL-21150 finally we have a general agreement that plugin_renderes now "magically extend" the core_renderer by using of __call() + fixed problems with protected methods --- lib/outputrenderers.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/outputrenderers.php b/lib/outputrenderers.php index 15c2c98d60..fe6aa4a1cc 100644 --- a/lib/outputrenderers.php +++ b/lib/outputrenderers.php @@ -238,10 +238,11 @@ class plugin_renderer_base extends renderer_base { * @param string $method * @param array $arguments * @return mixed - * - * TODO: this might not be the best idea, see MDL-21148 for pros&cons */ public function __call($method, $arguments) { + if (method_exists('renderer_base', $method)) { + throw new coding_exception('Protected method called against '.__CLASS__.' :: '.$method); + } if (method_exists($this->output, $method)) { return call_user_func_array(array($this->output, $method), $arguments); } else { -- 2.39.5