From 834bad0337cf723824ebcd21980b9ad873ccf78b Mon Sep 17 00:00:00 2001 From: Franz Liedke Date: Tue, 14 Feb 2017 22:56:17 +0100 Subject: [PATCH] Turn a few setters/getters into public attributes There were no type hints etc. going on, and we would have needed the getters anyway. See https://github.com/flarum/core/pull/1105#issuecomment-279310998. --- .../Forum/Controller/DiscussionController.php | 6 +- .../src/Forum/Controller/IndexController.php | 4 +- framework/core/src/Http/WebApp/WebAppView.php | 87 ++----------------- 3 files changed, 14 insertions(+), 83 deletions(-) diff --git a/framework/core/src/Forum/Controller/DiscussionController.php b/framework/core/src/Forum/Controller/DiscussionController.php index 8ecabe4f0..ebc7ab0de 100644 --- a/framework/core/src/Forum/Controller/DiscussionController.php +++ b/framework/core/src/Forum/Controller/DiscussionController.php @@ -85,9 +85,9 @@ class DiscussionController extends WebAppController } } - $view->setTitle($document->data->attributes->title); - $view->setDocument($document); - $view->setContent(app('view')->make('flarum.forum::discussion', compact('document', 'page', 'getResource', 'posts', 'url'))); + $view->title = $document->data->attributes->title; + $view->document = $document; + $view->content = app('view')->make('flarum.forum::discussion', compact('document', 'page', 'getResource', 'posts', 'url')); return $view; } diff --git a/framework/core/src/Forum/Controller/IndexController.php b/framework/core/src/Forum/Controller/IndexController.php index c2a908bd5..a4c059f34 100644 --- a/framework/core/src/Forum/Controller/IndexController.php +++ b/framework/core/src/Forum/Controller/IndexController.php @@ -67,8 +67,8 @@ class IndexController extends WebAppController $document = $this->getDocument($request->getAttribute('actor'), $params); - $view->setDocument($document); - $view->setContent(app('view')->make('flarum.forum::index', compact('document', 'page', 'forum'))); + $view->document = $document; + $view->content = app('view')->make('flarum.forum::index', compact('document', 'page', 'forum')); return $view; } diff --git a/framework/core/src/Http/WebApp/WebAppView.php b/framework/core/src/Http/WebApp/WebAppView.php index 30d40f426..5035e41ca 100644 --- a/framework/core/src/Http/WebApp/WebAppView.php +++ b/framework/core/src/Http/WebApp/WebAppView.php @@ -32,35 +32,35 @@ class WebAppView * * @var null|string */ - protected $title; + public $title; /** * The description of the document, displayed in a tag. * * @var null|string */ - protected $description; + public $description; /** * The language of the document, displayed as the value of the attribute `dir` in the tag. * * @var null|string */ - protected $language; + public $language; /** * The text direction of the document, displayed as the value of the attribute `dir` in the tag. * * @var null|string */ - protected $direction; + public $direction; /** * The path to the client layout view to display. * * @var string */ - protected $layout; + public $layout; /** * The SEO content of the page, displayed within the layout in