-
Notifications
You must be signed in to change notification settings - Fork 28
Added $_customerCollection property to Storage class #144
Added $_customerCollection property to Storage class #144
Conversation
Hello, thank you for your pull request. I will start to process this PR and get back to you if I need any more information. |
* | ||
* @var \Magento\Customer\Model\ResourceModel\Customer\Collection | ||
*/ | ||
private $_customerCollection; |
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.
Interestingly I cannot see this being used in this class and in fact during the method prepareCollection
uses the $this->customerCollectionFactory->create()
method to create it's collection. I would suggest that we can remove this variable and the assignment in the __constuct
Done, I removed the unused properties and made sure that |
Nice @maxalmonte14 I will update our tools and progress this. |
* @param CollectionByPagesIteratorFactory $colIteratorFactory | ||
* @param array $data | ||
*/ | ||
public function __construct( | ||
CustomerCollectionFactory $collectionFactory, |
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.
So we still need this variable passed in as it get's used on $this->customerCollectionFactory = $collectionFactory;
so we should keep that as well as private $customerCollectionFactory;
but we can keep the removal of:
$this->_customerCollection = isset(
$data['customer_collection']
) ? $data['customer_collection'] : $collectionFactory->create();
I added back the |
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.
Thanks for the speedy update.
@@ -58,9 +58,6 @@ public function __construct( | |||
CollectionByPagesIteratorFactory $colIteratorFactory, | |||
array $data = [] | |||
) { | |||
$this->_customerCollection = isset( |
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.
We are not allowed to remove public properties, because according to PHP Property Visibility: Methods declared without any explicit visibility keyword are defined as public.
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.
Sorry @maxalmonte14 would you be able to add the $_customerCollection
as public then in future versions we can deprecate it. But it would be better at least to have it shown and public now. Thanks
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.
Done, now the $_customerCollection property is public.
Description (*)
This PR solves the problem addressed in #135
Fixed Issues (if relevant)
Manual testing scenarios (*)
./vendor/bin/phpstan analyse app/code/Magento/CustomerImportExport/Model/ResourceModel/Import/Customer/Storage.php
as described in Clean up Model/ResourceModel/Import/Customer/Storage.php #135, after this implementation the following error shouldn't be presentContribution checklist (*)