This repository was archived by the owner on Apr 29, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 28
Added $_regionCollection property to class #140
Merged
magento-engcom-team
merged 3 commits into
magento-engcom:2.3-develop
from
maxalmonte14:improvement/supress_undefined_property_error
Nov 8, 2018
Merged
Added $_regionCollection property to class #140
magento-engcom-team
merged 3 commits into
magento-engcom:2.3-develop
from
maxalmonte14:improvement/supress_undefined_property_error
Nov 8, 2018
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Contributor
dmanners
suggested changes
Oct 29, 2018
| /** | ||
| * Region collection instance | ||
| * | ||
| * @var string |
Contributor
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.
In this case I think the type should be \Magento\Directory\Model\ResourceModel\Region\Collection as the code will use the $regionColFactory->create() method if it is not set in the data array.
$this->_regionCollection = isset(
$data['region_collection']
) ? $data['region_collection'] : $regionColFactory->create();
| * | ||
| * @var string | ||
| */ | ||
| protected $_regionCollection; |
Contributor
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.
I think we can also make this private here. Since this is technically a new variable.
Contributor
Author
|
@dmanners thanks for the feedback, I'll apply the changes as soon as possible. ✌️ |
Contributor
Author
|
Updated, rookie mistake in the docblock 😅 |
dmanners
approved these changes
Oct 30, 2018
dmanners
previously approved these changes
Oct 30, 2018
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description (*)
This PR fixes an error detected by PHPStan
Fixed Issues (if relevant)
Manual testing scenarios (*)
./vendor/bin/phpstan analyse app/code/Magento/CustomerImportExport/Model/Import/Address.phpas described in Clean up Model/Import/Address.php #136, after this implementation the following errors shouldn't be presentContribution checklist (*)