Browse Source

Rename MissingCellViewException to CellTemplate

This makes it use more consistent language with the rest of the
framework.
Mark Story 7 years ago
parent
commit
38abe4e02a

+ 4 - 3
src/View/Cell.php

@@ -25,7 +25,7 @@ use Cake\Http\Response;
 use Cake\Http\ServerRequest;
 use Cake\ORM\Locator\LocatorAwareTrait;
 use Cake\Utility\Inflector;
-use Cake\View\Exception\MissingCellViewException;
+use Cake\View\Exception\MissingCellTemplateException;
 use Cake\View\Exception\MissingTemplateException;
 use Error;
 use Exception;
@@ -155,7 +155,8 @@ abstract class Cell implements EventDispatcherInterface
      * @param string|null $template Custom template name to render. If not provided (null), the last
      * value will be used. This value is automatically set by `CellTrait::cell()`.
      * @return string The rendered cell.
-     * @throws \Cake\View\Exception\MissingCellViewException When a MissingTemplateException is raised during rendering.
+     * @throws \Cake\View\Exception\MissingCellTemplateException
+     *   When a MissingTemplateException is raised during rendering.
      */
     public function render(?string $template = null): string
     {
@@ -203,7 +204,7 @@ abstract class Cell implements EventDispatcherInterface
             try {
                 return $view->render($template);
             } catch (MissingTemplateException $e) {
-                throw new MissingCellViewException($name, $template, $e->getAttributes()['paths'], null, $e);
+                throw new MissingCellTemplateException($name, $template, $e->getAttributes()['paths'], null, $e);
             }
         };
 

+ 2 - 2
src/View/Exception/MissingCellViewException.php

@@ -14,9 +14,9 @@ declare(strict_types=1);
 namespace Cake\View\Exception;
 
 /**
- * Used when a view file for a cell cannot be found.
+ * Used when a template file for a cell cannot be found.
  */
-class MissingCellViewException extends MissingTemplateException
+class MissingCellTemplateException extends MissingTemplateException
 {
     /**
      * @var string

templates/Error/missing_cell_view.php → templates/Error/missing_cell_template.php


+ 2 - 2
tests/TestCase/View/CellTest.php

@@ -18,7 +18,7 @@ namespace Cake\Test\TestCase\View;
 use Cake\Cache\Cache;
 use Cake\TestSuite\TestCase;
 use Cake\View\Cell;
-use Cake\View\Exception\MissingCellViewException;
+use Cake\View\Exception\MissingCellTemplateException;
 use Cake\View\Exception\MissingTemplateException;
 use Cake\View\View;
 use TestApp\Controller\CellTraitTestController;
@@ -203,7 +203,7 @@ class CellTest extends TestCase
         $e = null;
         try {
             $cell->render('derp');
-        } catch (MissingCellViewException $e) {
+        } catch (MissingCellTemplateException $e) {
         }
 
         $this->assertNotNull($e);