From e0294ea72465a4ca3a0f8b6e916847607d6fd7fe Mon Sep 17 00:00:00 2001 From: Paul Klimov Date: Thu, 24 Oct 2013 17:20:19 +0300 Subject: [PATCH] 'ViewContext' renamed to 'ViewContextInterface'. --- framework/yii/base/Controller.php | 2 +- framework/yii/base/View.php | 4 ++-- framework/yii/base/ViewContext.php | 30 ----------------------------- framework/yii/base/ViewContextInterface.php | 30 +++++++++++++++++++++++++++++ framework/yii/base/Widget.php | 2 +- 5 files changed, 34 insertions(+), 34 deletions(-) delete mode 100644 framework/yii/base/ViewContext.php create mode 100644 framework/yii/base/ViewContextInterface.php diff --git a/framework/yii/base/Controller.php b/framework/yii/base/Controller.php index 79c1f5e..d2f491c 100644 --- a/framework/yii/base/Controller.php +++ b/framework/yii/base/Controller.php @@ -25,7 +25,7 @@ use Yii; * @author Qiang Xue * @since 2.0 */ -class Controller extends Component implements ViewContext +class Controller extends Component implements ViewContextInterface { /** * @event ActionEvent an event raised right before executing a controller action. diff --git a/framework/yii/base/View.php b/framework/yii/base/View.php index 1cb9a59..bc5b972 100644 --- a/framework/yii/base/View.php +++ b/framework/yii/base/View.php @@ -89,7 +89,7 @@ class View extends Component /** - * @var ViewContext the context under which the [[renderFile()]] method is being invoked. + * @var ViewContextInterface the context under which the [[renderFile()]] method is being invoked. */ public $context; /** @@ -244,7 +244,7 @@ class View extends Component if ($context === null) { $context = $this->context; } - if ($context instanceof ViewContext) { + if ($context instanceof ViewContextInterface) { $file = $context->findViewFile($view); } else { throw new InvalidCallException('Current context is not supported.'); diff --git a/framework/yii/base/ViewContext.php b/framework/yii/base/ViewContext.php deleted file mode 100644 index 4072ffc..0000000 --- a/framework/yii/base/ViewContext.php +++ /dev/null @@ -1,30 +0,0 @@ - - * @since 2.0 - */ -interface ViewContext -{ - /** - * Finds the view file based on the given view name. - * @param string $view the view name. - * @return string the view file path. Note that the file may not exist. - */ - public function findViewFile($view); -} \ No newline at end of file diff --git a/framework/yii/base/ViewContextInterface.php b/framework/yii/base/ViewContextInterface.php new file mode 100644 index 0000000..4237eca --- /dev/null +++ b/framework/yii/base/ViewContextInterface.php @@ -0,0 +1,30 @@ + + * @since 2.0 + */ +interface ViewContextInterface +{ + /** + * Finds the view file based on the given view name. + * @param string $view the view name. + * @return string the view file path. Note that the file may not exist. + */ + public function findViewFile($view); +} \ No newline at end of file diff --git a/framework/yii/base/Widget.php b/framework/yii/base/Widget.php index 69da6a9..b6e0cd0 100644 --- a/framework/yii/base/Widget.php +++ b/framework/yii/base/Widget.php @@ -20,7 +20,7 @@ use Yii; * @author Qiang Xue * @since 2.0 */ -class Widget extends Component implements ViewContext +class Widget extends Component implements ViewContextInterface { /** * @var integer a counter used to generate [[id]] for widgets.