Skip to content

Commit c378a9f

Browse files
author
Yu Tang
committed
MAGETWO-36625: Extended attributes should be optional
1 parent cc6ec2b commit c378a9f

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

lib/internal/Magento/Framework/Api/Code/Generator/ExtensionAttributesGenerator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ protected function _getClassMethods()
8686
$methods[] = [
8787
'name' => $getterName,
8888
'body' => "return \$this->_get('{$attributeName}');",
89-
'docblock' => ['tags' => [['name' => 'return', 'description' => $attributeType]]],
89+
'docblock' => ['tags' => [['name' => 'return', 'description' => $attributeType . '|null']]],
9090
];
9191
$methods[] = [
9292
'name' => $setterName,

lib/internal/Magento/Framework/Api/Test/Unit/Code/Generator/_files/SampleExtension.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ namespace Magento\Catalog\Api\Data;
66
class ProductExtension extends \Magento\Framework\Api\AbstractSimpleObject implements \Magento\Catalog\Api\Data\ProductExtensionInterface
77
{
88
/**
9-
* @return string
9+
* @return string|null
1010
*/
1111
public function getStringAttribute()
1212
{
@@ -24,7 +24,7 @@ class ProductExtension extends \Magento\Framework\Api\AbstractSimpleObject imple
2424
}
2525

2626
/**
27-
* @return \Magento\Bundle\Api\Data\OptionInterface[]
27+
* @return \Magento\Bundle\Api\Data\OptionInterface[]|null
2828
*/
2929
public function getComplexObjectAttribute()
3030
{

0 commit comments

Comments
 (0)