From 3f8ce5f83244c0d99ce0b9d2b56672fbbc22a290 Mon Sep 17 00:00:00 2001 From: Eric Lippmann Date: Wed, 30 Oct 2019 17:15:27 +0100 Subject: [PATCH] Pass the widget to `addContent()` directly --- application/controllers/CommentsController.php | 4 +--- application/controllers/NotificationsController.php | 4 +--- application/controllers/UsergroupsController.php | 4 +--- application/controllers/UsersController.php | 4 +--- 4 files changed, 4 insertions(+), 12 deletions(-) diff --git a/application/controllers/CommentsController.php b/application/controllers/CommentsController.php index 3d8723bf..5db7fea3 100644 --- a/application/controllers/CommentsController.php +++ b/application/controllers/CommentsController.php @@ -31,12 +31,10 @@ class CommentsController extends Controller yield $this->export($comments); - $commentList = (new CommentList($comments)); - $this->addControl($paginationControl); $this->addControl($limitControl); $this->addControl($filterControl); - $this->addContent($commentList); + $this->addContent(new CommentList($comments)); } } diff --git a/application/controllers/NotificationsController.php b/application/controllers/NotificationsController.php index 54d14371..65a38f85 100644 --- a/application/controllers/NotificationsController.php +++ b/application/controllers/NotificationsController.php @@ -27,8 +27,6 @@ class NotificationsController extends Controller $paginationControl = $this->createPaginationControl($notifications); $filterControl = $this->createFilterControl($notifications); - $notificationList = new NotificationList($notifications); - $this->filter($notifications); yield $this->export($notifications); @@ -37,6 +35,6 @@ class NotificationsController extends Controller $this->addControl($limitControl); $this->addControl($filterControl); - $this->addContent($notificationList); + $this->addContent(new NotificationList($notifications)); } } diff --git a/application/controllers/UsergroupsController.php b/application/controllers/UsergroupsController.php index c9e246cf..0a6d3b4f 100644 --- a/application/controllers/UsergroupsController.php +++ b/application/controllers/UsergroupsController.php @@ -24,12 +24,10 @@ class UsergroupsController extends Controller yield $this->export($usergroups); - $usergroupList = new UsergroupList($usergroups); - $this->addControl($paginationControl); $this->addControl($limitControl); $this->addControl($filterControl); - $this->addContent($usergroupList); + $this->addContent(new UsergroupList($usergroups)); } } diff --git a/application/controllers/UsersController.php b/application/controllers/UsersController.php index 58844871..2c0c2b4b 100644 --- a/application/controllers/UsersController.php +++ b/application/controllers/UsersController.php @@ -24,12 +24,10 @@ class UsersController extends Controller yield $this->export($users); - $userList = new UserList($users); - $this->addControl($paginationControl); $this->addControl($limitControl); $this->addControl($filterControl); - $this->addContent($userList); + $this->addContent(new UserList($users)); } }