From d36a0d91616d048eedf3973752f9f1cd941b019f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adri=C3=A1n=20Mart=C3=ADnez?= Date: Sun, 12 Aug 2018 20:24:56 +0200 Subject: [PATCH] Fix proxy generation return type --- .../ObjectManager/Code/Generator/Proxy.php | 1 + .../Unit/Code/Generator/_files/Sample.php | 21 +++++++++++++++++++ .../Code/Generator/_files/SampleProxy.txt | 16 ++++++++++++++ 3 files changed, 38 insertions(+) diff --git a/lib/internal/Magento/Framework/ObjectManager/Code/Generator/Proxy.php b/lib/internal/Magento/Framework/ObjectManager/Code/Generator/Proxy.php index 550f1ce7590d8..a1d3773a2cf8d 100644 --- a/lib/internal/Magento/Framework/ObjectManager/Code/Generator/Proxy.php +++ b/lib/internal/Magento/Framework/ObjectManager/Code/Generator/Proxy.php @@ -165,6 +165,7 @@ protected function _getMethodInfo(\ReflectionMethod $method) 'parameters' => $parameters, 'body' => $this->_getMethodBody($method->getName(), $parameterNames), 'docblock' => ['shortDescription' => '{@inheritdoc}'], + 'returnType' => $method->getReturnType(), ]; return $methodInfo; diff --git a/lib/internal/Magento/Framework/ObjectManager/Test/Unit/Code/Generator/_files/Sample.php b/lib/internal/Magento/Framework/ObjectManager/Test/Unit/Code/Generator/_files/Sample.php index d63391b9a3335..5979bb748ba8d 100644 --- a/lib/internal/Magento/Framework/ObjectManager/Test/Unit/Code/Generator/_files/Sample.php +++ b/lib/internal/Magento/Framework/ObjectManager/Test/Unit/Code/Generator/_files/Sample.php @@ -16,6 +16,11 @@ class Sample */ protected $messages = []; + /** + * @var array + */ + private $config = []; + /** * @param array $messages */ @@ -31,4 +36,20 @@ public function getMessages() { return $this->messages; } + + /** + * @param array $config + */ + public function setConfig(array $config) + { + $this->config = $config; + } + + /** + * @return array + */ + public function getConfig(): array + { + return $this->config; + } } diff --git a/lib/internal/Magento/Framework/ObjectManager/Test/Unit/Code/Generator/_files/SampleProxy.txt b/lib/internal/Magento/Framework/ObjectManager/Test/Unit/Code/Generator/_files/SampleProxy.txt index 43c99aa5e6843..82af251d6188d 100644 --- a/lib/internal/Magento/Framework/ObjectManager/Test/Unit/Code/Generator/_files/SampleProxy.txt +++ b/lib/internal/Magento/Framework/ObjectManager/Test/Unit/Code/Generator/_files/SampleProxy.txt @@ -101,4 +101,20 @@ class Sample_Proxy extends \Magento\Framework\ObjectManager\Code\Generator\Sampl { return $this->_getSubject()->getMessages(); } + + /** + * {@inheritdoc} + */ + public function setConfig(array $config) + { + return $this->_getSubject()->setConfig($config); + } + + /** + * {@inheritdoc} + */ + public function getConfig() : array + { + return $this->_getSubject()->getConfig(); + } }