Skip to content

Commit 28953db

Browse files
author
Stanislav Idolov
authored
ENGCOM-2776: Fix proxy generation return type #17552
2 parents 391a69e + b2c4372 commit 28953db

File tree

3 files changed

+38
-0
lines changed

3 files changed

+38
-0
lines changed

lib/internal/Magento/Framework/ObjectManager/Code/Generator/Proxy.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,7 @@ protected function _getMethodInfo(\ReflectionMethod $method)
165165
'parameters' => $parameters,
166166
'body' => $this->_getMethodBody($method->getName(), $parameterNames),
167167
'docblock' => ['shortDescription' => '{@inheritdoc}'],
168+
'returnType' => $method->getReturnType(),
168169
];
169170

170171
return $methodInfo;

lib/internal/Magento/Framework/ObjectManager/Test/Unit/Code/Generator/_files/Sample.php

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,11 @@ class Sample
1616
*/
1717
protected $messages = [];
1818

19+
/**
20+
* @var array
21+
*/
22+
private $config = [];
23+
1924
/**
2025
* @param array $messages
2126
*/
@@ -31,4 +36,20 @@ public function getMessages()
3136
{
3237
return $this->messages;
3338
}
39+
40+
/**
41+
* @param array $config
42+
*/
43+
public function setConfig(array $config)
44+
{
45+
$this->config = $config;
46+
}
47+
48+
/**
49+
* @return array
50+
*/
51+
public function getConfig(): array
52+
{
53+
return $this->config;
54+
}
3455
}

lib/internal/Magento/Framework/ObjectManager/Test/Unit/Code/Generator/_files/SampleProxy.txt

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,4 +101,20 @@ class Sample_Proxy extends Sample implements \Magento\Framework\ObjectManager\No
101101
{
102102
return $this->_getSubject()->getMessages();
103103
}
104+
105+
/**
106+
* {@inheritdoc}
107+
*/
108+
public function setConfig(array $config)
109+
{
110+
return $this->_getSubject()->setConfig($config);
111+
}
112+
113+
/**
114+
* {@inheritdoc}
115+
*/
116+
public function getConfig() : array
117+
{
118+
return $this->_getSubject()->getConfig();
119+
}
104120
}

0 commit comments

Comments
 (0)