mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
More coding standard fixes
This commit is contained in:
parent
6623a8a7f4
commit
733a610bf7
2 changed files with 35 additions and 6 deletions
|
@ -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();
|
||||
}
|
||||
|
||||
/**
|
||||
* 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);
|
||||
|
|
|
@ -814,7 +814,7 @@ class View extends Object {
|
|||
$this->viewVars = $data + $this->viewVars;
|
||||
}
|
||||
/**
|
||||
* Retreived the current view type
|
||||
* Retrieve the current view type
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
|
|
Loading…
Reference in a new issue