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

Github #26532: di:setup:compile fails with anonymous classes #26533

Merged
merged 4 commits into from
Feb 9, 2020

Conversation

joni-jones
Copy link
Contributor

Description (*)

  • Fixed parsing for anonymous classes during di:compile run
  • Small code optimizations
  • Extended and refactored related unit tests

Fixed Issues (if relevant)

  1. di:setup:compile fails with anonymous classes #26532: di:setup:compile fails with anonymous classes
  2. Anonyomus classes in 2.3 (test data provider) #21555: Anonymous classes in 2.3 (test data provider)

Manual testing scenarios (*)

  1. Create a dummy class which contains an anonymous class, like Magento\DummyModule\Dummy (see a sample below)
  2. Run bin/magento setup:di:compile CLI command

Sample class:

namespace Magento\DummyModule;

class Dummy
{
    public function execute($arg)
    {
        return new class($arg) {
            private $arg;

            public function __construct($arg)
            {
                $this->arg = $arg;
            }

            public function serialize()
            {
                return (string) $this->arg;
            }
        };
    }
}

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)

 - Fixed parsing for anonymous classes during di:compile run
 - Small code optimizations
 - Extended and refactored related unit tests
@m2-assistant
Copy link

m2-assistant bot commented Jan 24, 2020

Hi @joni-jones. 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
Copy link
Contributor

Hi @Stepa4man, thank you for the review.
ENGCOM-6686 has been created to process this Pull Request
✳️ @Stepa4man, could you please add one of the following labels to the Pull Request?

Label Description
Auto-Tests: Covered All changes in Pull Request is covered by auto-tests
Auto-Tests: Not Covered Changes in Pull Request requires coverage by auto-tests
Auto-Tests: Not Required Changes in Pull Request does not require coverage by auto-tests

@Stepa4man
Copy link
Contributor

@magento run all tests

@engcom-Alfa engcom-Alfa self-assigned this Jan 27, 2020
@engcom-Alfa engcom-Alfa added the Auto-Tests: Covered All changes in Pull Request is covered by auto-tests label Jan 27, 2020
@engcom-Alfa
Copy link
Contributor

✔️ QA Passed

Before:
before

After:
after

 - Small refactoring for code simplification
@joni-jones
Copy link
Contributor Author

joni-jones commented Jan 29, 2020

Based on the internal discussion with @buskamuza, I made small refactoring and code simplification.

@m2-assistant
Copy link

m2-assistant bot commented Feb 9, 2020

Hi @joni-jones, 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.

@sdzhepa sdzhepa mentioned this pull request May 9, 2022
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.

None yet

8 participants