Skip to content
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

Move additional dependencies from private getters to constructor - Magento_Catalog #26411

Conversation

Bartlomiejsz
Copy link
Contributor

@Bartlomiejsz Bartlomiejsz commented Jan 15, 2020

Description (*)

This PR moves additionally introduced dependencies from private getter methods into constructor in Magento_Catalog module.

Manual testing scenarios (*)

Questions or comments

Contribution checklist (*)

  • Pull request has a meaningful description of its purpose
  • All commits are accompanied by meaningful commit messages
  • All new or changed code is covered with unit/integration tests (if applicable)
  • All automated tests passed successfully (all builds are green)

@m2-assistant
Copy link

m2-assistant bot commented Jan 15, 2020

Hi @Bartlomiejsz. Thank you for your contribution
Here is some useful tips how you can test your changes using Magento test environment.
Add the comment under your pull request to deploy test or vanilla Magento instance:

  • @magento give me test instance - deploy test instance based on PR changes
  • @magento give me 2.4-develop instance - deploy vanilla Magento instance

For more details, please, review the Magento Contributor Guide documentation.

@magento-engcom-team magento-engcom-team added Partner: Fast White Cat partners-contribution Pull Request is created by Magento Partner labels Jan 15, 2020
@@ -141,6 +143,7 @@ public function __construct(
ProductLinks $productLinks,
Js $jsHelper,
Date $dateFilter,
LinkResolver $linkResolver,
CustomOptionFactory $customOptionFactory = null,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add all new dependencies in a backward-compatible manner - similar to other added in this class:

  1. new dependency is last
  2. null default value
  3. initialized in constructor when it was not passed

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was sure that it should be done this way but in few of my previous PRs it was mentioned that for 2.4 release proper way is without ObjectManager, and I had to change it for such like here. So which is correct version?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@orlangur check #26269 as an example

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @orlangur, also check this one please 4e6f6ae this was commited by Magento core and this is pretty much the same I did here

@ghost ghost assigned orlangur Jan 16, 2020
@Bartlomiejsz Bartlomiejsz force-pushed the feature/dependencies_into_constructor_catalog branch 2 times, most recently from 9018ad9 to 00ffc92 Compare February 26, 2020 10:33
@Bartlomiejsz Bartlomiejsz force-pushed the feature/dependencies_into_constructor_catalog branch from 00ffc92 to 5c72fba Compare February 26, 2020 11:10
@Bartlomiejsz Bartlomiejsz added the WIP Work In Progress label Feb 28, 2020
@Bartlomiejsz
Copy link
Contributor Author

Closing this one to open new PR as draft, since Catalog requires serious amount of modifications

@m2-assistant
Copy link

m2-assistant bot commented Mar 3, 2020

Hi @Bartlomiejsz, thank you for your contribution!
Please, complete Contribution Survey, it will take less than a minute.
Your feedback will help us to improve contribution process.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants