From 25e2797c158bcc7e3a9491e2f762e9890a6aa936 Mon Sep 17 00:00:00 2001 From: David Watson <14983002+watson8@users.noreply.github.com> Date: Mon, 9 Sep 2024 15:36:59 +0100 Subject: [PATCH] CTP-3690 correct commit 16f5fa2c wrapped_object --- classes/decorators/submission_groups_decorator.php | 6 +++--- classes/framework/decorator.php | 12 ++++++------ 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/classes/decorators/submission_groups_decorator.php b/classes/decorators/submission_groups_decorator.php index c67e4db1..8756dc7b 100644 --- a/classes/decorators/submission_groups_decorator.php +++ b/classes/decorators/submission_groups_decorator.php @@ -31,7 +31,7 @@ * submissions enabled. We want to make sure that the students get the grade of the group thing rather * than their own missing assignment. * - * @property submission wrapped_object + * @property submission wrappedobject * @package mod_coursework\decorators */ class submission_groups_decorator extends decorator { @@ -43,11 +43,11 @@ class submission_groups_decorator extends decorator { */ public function user_is_in_same_group($user) { - if (!$this->wrapped_object->get_coursework()->is_configured_to_have_group_submissions()) { + if (!$this->wrappedobject->get_coursework()->is_configured_to_have_group_submissions()) { throw new \coding_exception('Asking for groups membership of a submissions when we are not using groups'); } - $group = $this->wrapped_object->get_allocatable(); + $group = $this->wrappedobject->get_allocatable(); return groups_is_member($group->id, $user->id); } diff --git a/classes/framework/decorator.php b/classes/framework/decorator.php index 1f137f98..6f520d90 100644 --- a/classes/framework/decorator.php +++ b/classes/framework/decorator.php @@ -36,10 +36,10 @@ class decorator { protected $wrappedobject; /** - * @param $wrapped_object + * @param $wrappedobject */ public function __construct($wrappedobject) { - $this->wrapped_object = $wrappedobject; + $this->wrappedobject = $wrappedobject; } /** @@ -50,7 +50,7 @@ public function __construct($wrappedobject) { * @return mixed */ public function __call($method, $args) { - return call_user_func_array([$this->wrapped_object, + return call_user_func_array([$this->wrappedobject, $method], $args); } @@ -62,7 +62,7 @@ public function __call($method, $args) { * @return mixed */ public function __get($name) { - return $this->wrapped_object->$name; + return $this->wrappedobject->$name; } /** @@ -73,13 +73,13 @@ public function __get($name) { * @return mixed */ public function __set($name, $value) { - return $this->wrapped_object->$name = $value; + return $this->wrappedobject->$name = $value; } /** * @return mixed */ public function wrapped_object() { - return $this->wrapped_object; + return $this->wrappedobject; } }