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

Cli info di #9103

Merged
merged 28 commits into from
Apr 13, 2017
Merged

Cli info di #9103

merged 28 commits into from
Apr 13, 2017

Conversation

springerin
Copy link

@springerin springerin commented Apr 2, 2017

Added cli command to retrieve DI configured for the certain class or interface: which preference is defined, which virtual types exist, how parameters are configured, what plugins exist.

Description

Fixed Issues (if relevant)

1.magento-hackathon/Imagine2017#11: Create new CLI command: Collect Dependency Injection Info for the Interfaces and Classes

Manual testing scenarios

  1. Run bin/magento dev:di:info "Magento\Catalog\Api\Data\ProductInterface"
  2. Expected Result:
DI configuration for the class Magento\Catalog\Api\Data\ProductInterface in the GLOBAL area

Preference: Magento\Catalog\Model\Product

Constructor Parameters:
+--------------------------------+--------------------------------------------------------------------------+------------------+
| Name                           | Requested Type                                                           | Configured Value |
+--------------------------------+--------------------------------------------------------------------------+------------------+
| context                        | Magento\Framework\Model\Context                                          |                  |
| registry                       | Magento\Framework\Registry                                               |                  |
| extensionFactory               | Magento\Framework\Api\ExtensionAttributesFactory                         |                  |
| customAttributeFactory         | Magento\Framework\Api\AttributeValueFactory                              |                  |
| storeManager                   | Magento\Store\Model\StoreManagerInterface                                |                  |
| metadataService                | Magento\Catalog\Api\ProductAttributeRepositoryInterface                  |                  |
| url                            | Magento\Catalog\Model\Product\Url                                        |                  |
| productLink                    | Magento\Catalog\Model\Product\Link                                       |                  |
| itemOptionFactory              | Magento\Catalog\Model\Product\Configuration\Item\OptionFactory           |                  |
| stockItemFactory               | Magento\CatalogInventory\Api\Data\StockItemInterfaceFactory              |                  |
| catalogProductOptionFactory    | Magento\Catalog\Model\Product\OptionFactory                              |                  |
| catalogProductVisibility       | Magento\Catalog\Model\Product\Visibility                                 |                  |
| catalogProductStatus           | Magento\Catalog\Model\Product\Attribute\Source\Status                    |                  |
| catalogProductMediaConfig      | Magento\Catalog\Model\Product\Media\Config                               |                  |
| catalogProductType             | Magento\Catalog\Model\Product\Type                                       |                  |
| moduleManager                  | Magento\Framework\Module\Manager                                         |                  |
| catalogProduct                 | Magento\Catalog\Helper\Product                                           |                  |
| resource                       | Magento\Catalog\Model\ResourceModel\Product                              |                  |
| resourceCollection             | Magento\Catalog\Model\ResourceModel\Product\Collection                   |                  |
| collectionFactory              | Magento\Framework\Data\CollectionFactory                                 |                  |
| filesystem                     | Magento\Framework\Filesystem                                             |                  |
| indexerRegistry                | Magento\Framework\Indexer\IndexerRegistry                                |                  |
| productFlatIndexerProcessor    | Magento\Catalog\Model\Indexer\Product\Flat\Processor                     |                  |
| productPriceIndexerProcessor   | Magento\Catalog\Model\Indexer\Product\Price\Processor                    |                  |
| productEavIndexerProcessor     | Magento\Catalog\Model\Indexer\Product\Eav\Processor                      |                  |
| categoryRepository             | Magento\Catalog\Api\CategoryRepositoryInterface                          |                  |
| imageCacheFactory              | Magento\Catalog\Model\Product\Image\CacheFactory                         |                  |
| entityCollectionProvider       | Magento\Catalog\Model\ProductLink\CollectionProvider                     |                  |
| linkTypeProvider               | Magento\Catalog\Model\Product\LinkTypeProvider                           |                  |
| productLinkFactory             | Magento\Catalog\Api\Data\ProductLinkInterfaceFactory                     |                  |
| productLinkExtensionFactory    | Magento\Catalog\Api\Data\ProductLinkExtensionFactory                     |                  |
| mediaGalleryEntryConverterPool | Magento\Catalog\Model\Product\Attribute\Backend\Media\EntryConverterPool |                  |
| dataObjectHelper               | Magento\Framework\Api\DataObjectHelper                                   |                  |
| joinProcessor                  | Magento\Framework\Api\ExtensionAttribute\JoinProcessorInterface          |                  |
| data                           |                                                                          | <empty array>    |
+--------------------------------+--------------------------------------------------------------------------+------------------+

Plugins:
+--------+--------+------+
| Plugin | Method | Type |
+--------+--------+------+

Plugins for the Preference:
+--------------------------------------------------------+--------------------+-------+
| Plugin                                                 | Method             | Type  |
+--------------------------------------------------------+--------------------+-------+
| Magento\Swatches\Model\Plugin\Product                  | getMediaAttributes | after |
| Magento\CatalogInventory\Model\Plugin\AfterProductLoad | load               | after |
| Magento\Bundle\Model\Plugin\Product                    | getIdentities      | after |
+--------------------------------------------------------+--------------------+-------+

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 on Travis CI are green)

vrann and others added 23 commits April 1, 2017 14:04
…endency Injection Info for the Interfaces and Classes

- Create class to collect DI configuration information
…endency Injection Info for the Interfaces and Classes

- Create method to retrieve constructor parameters info
…endency Injection Info for the Interfaces and Classes

- Create Class for Di info command
…endency Injection Info for the Interfaces and Classes

- Create method to retrieve virtual types of the class and its preference
…endency Injection Info for the Interfaces and Classes

- added in di.xml the dev_di_info command
…endency Injection Info for the Interfaces and Classes

- added the execute method
…endency Injection Info for the Interfaces and Classes

- format the output of the command
…endency Injection Info for the Interfaces and Classes

- added pluginlist model to recover the information about the plugin for the specified class
…into cli-info-di

# Conflicts:
#	app/code/Magento/Developer/Model/Di/Information.php
…into cli-info-di

# Conflicts:
#	app/code/Magento/Developer/Model/Di/Information.php
…endency Injection Info for the Interfaces and Classes

- added type name to plugin method instead of id
…into cli-info-di

# Conflicts:
#	app/code/Magento/Developer/Console/Command/DiInfoCommand.php
…endency Injection Info for the Interfaces and Classes

- added check existence of className in the inherited array
…endency Injection Info for the Interfaces and Classes

- added plugins info about preference
…into cli-info-di

- Added support for the virtual types
…into cli-info-di

# Conflicts:
#	app/code/Magento/Developer/Console/Command/DiInfoCommand.php
…endency Injection Info for the Interfaces and Classes

- added support for array type parameters
…endency Injection Info for the Interfaces and Classes

- added support for array type parameters
@magento-cicd2
Copy link
Contributor

magento-cicd2 commented Apr 2, 2017

CLA assistant check
All committers have signed the CLA.

…endency Injection Info for the Interfaces and Classes

- added unit test for Information class
@ishakhsuvarov
Copy link
Contributor

Hi @springerin

  • Please sign the CLA before we can proceed with the processing of this PR. (Make sure, that the email address you have used in the commit is present in your GitHub profile).
  • Please look into the test fails on Travis CI.

Thanks!

…endency Injection Info for the Interfaces and Classes

- fixed the virtual types message
- added information about the area
@vrann vrann self-assigned this Apr 12, 2017
…endency Injection Info for the Interfaces and Classes

- fixed issue with the empty constructor parameters list
- fixed static test
@vrann
Copy link
Contributor

vrann commented Apr 12, 2017

@ishakhsuvarov fixed tests, please pay attention to acceptance test
CLA was signed, @springerin is trying to re-sign it again

@vrann
Copy link
Contributor

vrann commented Apr 12, 2017

@springerin CLA was signed but the system cannot record it due to error. We can assume that it is signed.

@magento-team magento-team merged commit fd9321c into magento:develop Apr 13, 2017
magento-team pushed a commit that referenced this pull request Apr 13, 2017
@magento-team
Copy link
Contributor

@springerin thank you for your contribution to Magento 2 project

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.

5 participants