File tree Expand file tree Collapse file tree 1 file changed +20
-10
lines changed
lib/internal/Magento/Framework/Interception/Code/Generator Expand file tree Collapse file tree 1 file changed +20
-10
lines changed Original file line number Diff line number Diff line change @@ -109,16 +109,26 @@ protected function _getMethodInfo(\ReflectionMethod $method)
109
109
$ methodInfo = [
110
110
'name ' => ($ method ->returnsReference () ? '& ' : '' ) . $ method ->getName (),
111
111
'parameters ' => $ parameters ,
112
- 'body ' => "\$pluginInfo = \$this->pluginList->getNext( \$this->subjectType, ' {$ method ->getName ()}'); \n" .
113
- "if (! \$pluginInfo) { \n" .
114
- " " .($ returnTypeValue === 'void ' ? '' : 'return ' )
115
- ." parent:: {$ method ->getName ()}( {$ this ->_getParameterList (
116
- $ parameters
117
- )}); \n" .
118
- "} else { \n" .
119
- " " .($ returnTypeValue === 'void ' ? '' : 'return ' )
120
- ." \$this->___callPlugins(' {$ method ->getName ()}', func_get_args(), \$pluginInfo); \n" .
121
- "} " ,
112
+ 'body ' => str_replace (
113
+ [
114
+ '%methodName% ' ,
115
+ '%return% ' ,
116
+ '%parameters% '
117
+ ],
118
+ [
119
+ $ method ->getName (),
120
+ $ returnTypeValue === 'void ' ? '' : 'return ' ,
121
+ $ this ->_getParameterList ($ parameters )
122
+ ],
123
+ <<<'METHOD_BODY'
124
+ $pluginInfo = $this->pluginList->getNext($this->subjectType, '%methodName%');
125
+ if (!$pluginInfo) {
126
+ %return% parent::%methodName%(%parameters%);
127
+ } else {
128
+ %return% $this->___callPlugins('%methodName%', func_get_args(), $pluginInfo);
129
+ }
130
+ METHOD_BODY
131
+ ),
122
132
'returnType ' => $ returnTypeValue ,
123
133
'docblock ' => ['shortDescription ' => '{@inheritdoc} ' ],
124
134
];
You can’t perform that action at this time.
0 commit comments