Skip to content

Commit

Permalink
Make View::$Blocks protected.
Browse files Browse the repository at this point in the history
  • Loading branch information
ADmad committed Jun 6, 2018
1 parent b3cd9a6 commit 1462dde
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/View/View.php
Expand Up @@ -94,7 +94,7 @@ class View implements EventDispatcherInterface
*
* @var \Cake\View\ViewBlock
*/
public $Blocks;
protected $Blocks;

/**
* The name of the plugin.
Expand Down Expand Up @@ -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};
Expand Down

0 comments on commit 1462dde

Please sign in to comment.