Browse Source

Default value for View::$template (#15697)

Default value for 'View::$template = ''' is needed to because `View::getTemplate(): string` does not expect to return null
After this PR template will behave the same way as templatePath
andrii-pukhalevych 4 years ago
parent
commit
ff7b2e3a1b
2 changed files with 2 additions and 2 deletions
  1. 1 1
      src/View/View.php
  2. 1 1
      tests/TestCase/Error/DebuggerTest.php

+ 1 - 1
src/View/View.php

@@ -129,7 +129,7 @@ class View implements EventDispatcherInterface
      *
      * @var string
      */
-    protected $template;
+    protected $template = '';
 
     /**
      * The name of the layout file to render the template inside of. The name specified

+ 1 - 1
tests/TestCase/Error/DebuggerTest.php

@@ -313,7 +313,7 @@ object(Cake\View\View) id:0 {
     (int) 1 => 'Form'
   ]
   [protected] templatePath => ''
-  [protected] template => null
+  [protected] template => ''
   [protected] layout => 'default'
   [protected] layoutPath => ''
   [protected] autoLayout => true