From 733a610bf7425215a869e205096ae2864ccdb844 Mon Sep 17 00:00:00 2001 From: Nick Beeuwsaert Date: Fri, 27 Jun 2014 18:03:29 +0000 Subject: [PATCH] More coding standard fixes --- lib/Cake/Test/Case/View/ViewTest.php | 37 +++++++++++++++++++++++++--- lib/Cake/View/View.php | 4 +-- 2 files changed, 35 insertions(+), 6 deletions(-) diff --git a/lib/Cake/Test/Case/View/ViewTest.php b/lib/Cake/Test/Case/View/ViewTest.php index 541e36b0e..3867068ea 100644 --- a/lib/Cake/Test/Case/View/ViewTest.php +++ b/lib/Cake/Test/Case/View/ViewTest.php @@ -239,6 +239,7 @@ class TestObjectWithToString { */ class TestObjectWithoutToString { } + /** * Class TestViewEventListener * @@ -246,26 +247,54 @@ class TestObjectWithoutToString { */ class TestViewEventListener implements CakeEventListener { +/** + * type of view before rendering has occurred + * + * @var string + */ public $beforeRenderViewType; +/** + * type of view after rendering has occurred + * + * @var string + */ public $afterRenderViewType; +/** + * implementedEvents method + * + * @return array + */ public function implementedEvents() { return array( 'View.beforeRender' => 'beforeRender', - 'View.afterRender' => 'afterRender', - ); + 'View.afterRender' => 'afterRender' + ); } +/** + * beforeRender method + * + * @param CakeEvent $event the event being sent + * @return void + */ public function beforeRender($event) { - $this->beforeRenderViewType = $event->subject()->getCurrentType(); + $this->beforeRenderViewType = $event->subject()->getCurrentType(); } +/** + * afterRender method + * + * @param CakeEvent $event the event being sent + * @return void + */ public function afterRender($event) { $this->afterRenderViewType = $event->subject()->getCurrentType(); } } + /** * ViewTest class * @@ -853,7 +882,7 @@ class ViewTest extends CakeTestCase { $this->assertEquals(View::TYPE_VIEW, $listener->afterRenderViewType); $this->assertEquals($View->getCurrentType(), View::TYPE_VIEW); - $View->element('test_element', array(), array("callbacks"=>true)); + $View->element('test_element', array(), array('callbacks' => true)); $this->assertEquals($View->getCurrentType(), View::TYPE_VIEW); $this->assertEquals(View::TYPE_ELEMENT, $listener->beforeRenderViewType); diff --git a/lib/Cake/View/View.php b/lib/Cake/View/View.php index d0fcd933e..39a432397 100644 --- a/lib/Cake/View/View.php +++ b/lib/Cake/View/View.php @@ -814,11 +814,11 @@ class View extends Object { $this->viewVars = $data + $this->viewVars; } /** - * Retreived the current view type + * Retrieve the current view type * * @return string */ - public function getCurrentType(){ + public function getCurrentType() { return $this->_currentType; } /**