Browse Source

Started adding deprecation warnings to the view namespace

Florian Krämer 8 years ago
parent
commit
c7bbe62025

+ 12 - 0
src/View/Helper/FormHelper.php

@@ -949,6 +949,10 @@ class FormHelper extends Helper
      */
     public function allInputs(array $fields = [], array $options = [])
     {
+        deprecationWarning(
+            'FormHelper::allInputs() is deprecated. ' .
+            'Use FormHelper::allControlls() instead.'
+        );
         return $this->allControls($fields, $options);
     }
 
@@ -1007,6 +1011,10 @@ class FormHelper extends Helper
      */
     public function inputs(array $fields, array $options = [])
     {
+        deprecationWarning(
+            'FormHelper::inputs() is deprecated. ' .
+            'Use FormHelper::controls() instead.'
+        );
         return $this->controls($fields, $options);
     }
 
@@ -1185,6 +1193,10 @@ class FormHelper extends Helper
      */
     public function input($fieldName, array $options = [])
     {
+        deprecationWarning(
+            'FormHelper::input() is deprecated. ' .
+            'Use FormHelper::control() instead.'
+        );
         return $this->control($fieldName, $options);
     }
 

+ 20 - 0
src/View/Helper/HtmlHelper.php

@@ -158,6 +158,11 @@ class HtmlHelper extends Helper
      */
     public function addCrumb($name, $link = null, array $options = [])
     {
+        deprecationWarning(
+            'HtmlHelper::addCrumb() is deprecated. ' .
+            'Use the BreadcrumbsHelper instead.'
+        );
+
         $this->_crumbs[] = [$name, $link, $options];
 
         return $this;
@@ -692,6 +697,11 @@ class HtmlHelper extends Helper
      */
     public function getCrumbs($separator = '»', $startText = false)
     {
+        deprecationWarning(
+            'HtmlHelper::getCrumbs() is deprecated. ' .
+            'Use the BreadcrumbsHelper instead.'
+        );
+
         $crumbs = $this->_prepareCrumbs($startText);
         if (!empty($crumbs)) {
             $out = [];
@@ -731,6 +741,11 @@ class HtmlHelper extends Helper
      */
     public function getCrumbList(array $options = [], $startText = false)
     {
+        deprecationWarning(
+            'HtmlHelper::getCrumbList() is deprecated. ' .
+            'Use the BreadcrumbsHelper instead.'
+        );
+
         $defaults = ['firstClass' => 'first', 'lastClass' => 'last', 'separator' => '', 'escape' => true];
         $options += $defaults;
         $firstClass = $options['firstClass'];
@@ -784,6 +799,11 @@ class HtmlHelper extends Helper
      */
     protected function _prepareCrumbs($startText, $escape = true)
     {
+        deprecationWarning(
+            'HtmlHelper::_prepareCrumbs() is deprecated. ' .
+            'Use the BreadcrumbsHelper instead.'
+        );
+
         $crumbs = $this->_crumbs;
         if ($startText) {
             if (!is_array($startText)) {

+ 5 - 0
src/View/StringTemplateTrait.php

@@ -66,6 +66,11 @@ trait StringTemplateTrait
      */
     public function templates($templates = null)
     {
+        deprecationWarning(
+            'StringTemplateTrait::templates() is deprecated. ' .
+            'Use setTemplates()/getTemplates() instead.'
+        );
+
         if ($templates === null || is_string($templates)) {
             return $this->templater()->get($templates);
         }

+ 30 - 0
src/View/View.php

@@ -410,6 +410,11 @@ class View implements EventDispatcherInterface
      */
     public function templatePath($path = null)
     {
+        deprecationWarning(
+            'View::templatePath() is deprecated. ' .
+            'Use getTemplatePath()/setTemplatePath() instead.'
+        );
+
         if ($path === null) {
             return $this->templatePath;
         }
@@ -449,6 +454,11 @@ class View implements EventDispatcherInterface
      */
     public function layoutPath($path = null)
     {
+        deprecationWarning(
+            'View::layoutPath() is deprecated. ' .
+            'Use getLayoutPath()/setLayoutPath() instead.'
+        );
+
         if ($path === null) {
             return $this->layoutPath;
         }
@@ -493,6 +503,11 @@ class View implements EventDispatcherInterface
      */
     public function autoLayout($autoLayout = null)
     {
+        deprecationWarning(
+            'View::autoLayout() is deprecated. ' .
+            'Use isAutoLayoutEnabled()/enableAutoLayout() instead.'
+        );
+
         if ($autoLayout === null) {
             return $this->autoLayout;
         }
@@ -532,6 +547,11 @@ class View implements EventDispatcherInterface
      */
     public function theme($theme = null)
     {
+        deprecationWarning(
+            'View::theme() is deprecated. ' .
+            'Use getTheme()/setTheme() instead.'
+        );
+
         if ($theme === null) {
             return $this->theme;
         }
@@ -574,6 +594,11 @@ class View implements EventDispatcherInterface
      */
     public function template($name = null)
     {
+        deprecationWarning(
+            'View::template() is deprecated. ' .
+            'Use getTemplate()/setTemplate() instead.'
+        );
+
         if ($name === null) {
             return $this->template;
         }
@@ -619,6 +644,11 @@ class View implements EventDispatcherInterface
      */
     public function layout($name = null)
     {
+        deprecationWarning(
+            'View::layout() is deprecated. ' .
+            'Use getLayout()/setLayout() instead.'
+        );
+
         if ($name === null) {
             return $this->layout;
         }