From 1462dde3d0ddef4b158d3256b97fead7ccf22c2f Mon Sep 17 00:00:00 2001 From: ADmad Date: Wed, 6 Jun 2018 12:39:11 +0530 Subject: [PATCH] Make View::$Blocks protected. --- src/View/View.php | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/View/View.php b/src/View/View.php index d25ab738056..6a4464935b2 100644 --- a/src/View/View.php +++ b/src/View/View.php @@ -94,7 +94,7 @@ class View implements EventDispatcherInterface * * @var \Cake\View\ViewBlock */ - public $Blocks; + protected $Blocks; /** * The name of the plugin. @@ -1211,6 +1211,15 @@ public function __get($name) return $this->{$method}(); } + if ($name === 'Blocks') { + deprecationWarning( + 'View::$Blocks is protected now. ' . + 'Use one of the wrapper methods like View::fetch() etc. instead.' + ); + + return $this->Blocks; + } + $registry = $this->helpers(); if (isset($registry->{$name})) { $this->{$name} = $registry->{$name};