-
Notifications
You must be signed in to change notification settings - Fork 9.4k
Standardize the array structure for the getAttributes result #23818
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Standardize the array structure for the getAttributes result #23818
Conversation
Hi @thomas-kl1. Thank you for your contribution
For more details, please, review the Magento Contributor Assistant documentation |
* @throws \Exception | ||
*/ | ||
public function getAttributes($entityType) | ||
public function getAttributes($entityType): array |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unfortunately, we are not allowed to change public method signature according to our Backward Compatible Development Guide
@@ -48,14 +49,14 @@ public function __construct( | |||
* @param object $entity | |||
* @return void | |||
*/ | |||
public function registerSnapshot($entityType, $entity) | |||
public function registerSnapshot($entityType, $entity): void |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unfortunately, we are not allowed to change public method signature according to our Backward Compatible Development Guide
@@ -65,7 +66,7 @@ public function registerSnapshot($entityType, $entity) | |||
* @param object $entity | |||
* @return bool | |||
*/ | |||
public function isModified($entityType, $entity) | |||
public function isModified($entityType, $entity): bool |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unfortunately, we are not allowed to change public method signature according to our Backward Compatible Development Guide
* @throws \Exception | ||
*/ | ||
public function getAttributes($entityType) | ||
public function getAttributes($entityType): array |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unfortunately, we are not allowed to change public method signature according to our Backward Compatible Development Guide
*/ | ||
public function getAttributes($entityType); | ||
public function getAttributes($entityType): array; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unfortunately, we are not allowed to change public method signature according to our Backward Compatible Development Guide
Hi @sidolov, thank you for the review.
|
Hi @thomas-kl1, thank you for your contribution! |
The scope of this pull request is to fix two issues in the
\Magento\Framework\Model\EntitySnapshot
package. It makes more convenient the results ofgetAttributes
.Description (*)
The
getAttributes
method of the\Magento\Framework\Model\EntitySnapshot\AttributeProviderInterface
has no standardized structure in its available implementations.\Magento\Framework\Model\EntitySnapshot\AttributeProvider
deal with a dictionary where\Magento\Eav\Model\AttributeProvider
returns a simple list of attribute code.I have assumed that the results should be a list of field (as described in the methods description).
Contribution checklist (*)