I have Magento 2 with sample data and I came across this file
generation\Magento\Framework\View\Result\Layout\interceptor.php.
The Interceptor file is generated only if any module wants to plugin (before/after/around) any method in given class . for example, this method renderResult()
does not have any plugin like beforeRenderResult/aroundRenderResult
. then Why interceptor file was generated ? Are there any other scenarios where interception file can be generated ?
public function renderResult(\Magento\Framework\App\ResponseInterface $response)
{
$pluginInfo = $this->pluginList->getNext($this->subjectType, 'renderResult');
if (!$pluginInfo) {
return parent::renderResult($response);
} else {
return $this->___callPlugins('renderResult', func_get_args(), $pluginInfo);
}
}