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

Laminas di and servicemanager updated to PHP 8 compatible version #31854

Merged

Conversation

ProkopovVitaliy
Copy link
Contributor

@ProkopovVitaliy ProkopovVitaliy commented Jan 27, 2021

Description (*)

Updated laminas/laminas-di to ^3.2.0
Updated laminas/laminas-servicemanager to ^3.6.0
Updated laminas/laminas-mvc to ^3.2.0

Related Pull Requests

https://github.com/magento/partners-magento2ee/pull/515

Fixed Issues

  1. Resolves Update laminas/laminas-di dependency to PHP 8 compatible version #31173
  2. Resolves Update laminas/laminas-servicemanager dependency version to "^3.5.1" #31346
  3. Resolves Update laminas/laminas-mvc dependency to PHP 8 compatible version #31783

@m2-assistant
Copy link

m2-assistant bot commented Jan 27, 2021

Hi @ProkopovVitaliy. 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

❗ Automated tests can be triggered manually with an appropriate comment:

  • @magento run all tests - run or re-run all required tests against the PR changes
  • @magento run <test-build(s)> - run or re-run specific test build(s)
    For example: @magento run Unit Tests

<test-build(s)> is a comma-separated list of build names. Allowed build names are:

  1. Database Compare
  2. Functional Tests CE
  3. Functional Tests EE,
  4. Functional Tests B2B
  5. Integration Tests
  6. Magento Health Index
  7. Sample Data Tests CE
  8. Sample Data Tests EE
  9. Sample Data Tests B2B
  10. Static Tests
  11. Unit Tests
  12. WebAPI Tests
  13. Semantic Version Checker

You can find more information about the builds here

ℹ️ Please run only needed test builds instead of all when developing. Please run all test builds before sending your PR for review.

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

⚠️ According to the Magento Contribution requirements, all Pull Requests must go through the Community Contributions Triage process. Community Contributions Triage is a public meeting.

🕙 You can find the schedule on the Magento Community Calendar page.

📞 The triage of Pull Requests happens in the queue order. If you want to speed up the delivery of your contribution, please join the Community Contributions Triage session to discuss the appropriate ticket.

🎥 You can find the recording of the previous Community Contributions Triage on the Magento Youtube Channel

✏️ Feel free to post questions/proposals/feedback related to the Community Contributions Triage process to the corresponding Slack Channel

@coderimus
Copy link
Contributor

@magento run all tests

Copy link
Contributor

@coderimus coderimus left a comment

Choose a reason for hiding this comment

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

@ProkopovVitaliy thank you for the provided changes. Please, take a look at the composer.lock file conflicts. Think that we will have more tests passed after resolving it because we have some updates :)

@ProkopovVitaliy
Copy link
Contributor Author

@coderimus resolved conflict in composer.lock.

@coderimus
Copy link
Contributor

@magento run all tests

@ProkopovVitaliy
Copy link
Contributor Author

@magento run all tests

@coderimus
Copy link
Contributor

@ProkopovVitaliy I found an issue with the BIC:

Class 'Laminas\Di\Di' not found
#0 /var/www/html/vendor/phpunit/phpunit/src/Framework/TestCase.php(772): PHPUnit\Framework\TestResult->run()
#1 /var/www/html/vendor/phpunit/phpunit/src/Framework/TestSuite.php(639): PHPUnit\Framework\TestCase->run()
#2 /var/www/html/vendor/phpunit/phpunit/src/Framework/TestSuite.php(639): PHPUnit\Framework\TestSuite->run()
#3 /var/www/html/vendor/phpunit/phpunit/src/Framework/TestSuite.php(639): PHPUnit\Framework\TestSuite->run()
#4 /var/www/html/vendor/phpunit/phpunit/src/TextUI/TestRunner.php(653): PHPUnit\Framework\TestSuite->run()
#5 /var/www/html/vendor/phpunit/phpunit/src/TextUI/Command.php(108): PHPUnit\TextUI\TestRunner->run()
#6 /var/www/html/vendor/phpunit/phpunit/src/TextUI/Command.php(68): PHPUnit\TextUI\Command->run()
#7 /var/www/html/vendor/phpunit/phpunit/phpunit(61): PHPUnit\TextUI\Command::main()
#8 {main}

This relates to the https://github.com/laminas/laminas-di/blob/3.3.x/CHANGELOG.md#300---2017-11-30 where Laminas\Di\Di is removed in favour of Laminas\Di\DefaultContainer. Please, use new approach

@sivaschenko
Copy link
Member

@magento run all tests

@sivaschenko sivaschenko changed the title 31173 laminas di dependency Laminas di and servicemanager updated to PHP 8 compatible version Mar 3, 2021
@sivaschenko
Copy link
Member

@coderimus @ProkopovVitaliy @konarshankar07 @Den4ik looks like servicemanager update depend on di and vice versa, so we have to update them together. Added servicemanager update to this PR.

Comment on lines 105 to +108
public function createService(ServiceLocatorInterface $serviceLocator)
{
return $this->extractInitParameters($serviceLocator->get('Application'));
return $this($serviceLocator, 'Application');
}
Copy link
Contributor

Choose a reason for hiding this comment

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

I believe that we may just replace this method with __invoke instead of extend the class by the new method.
@sivaschenko please, correct me if I'm not right

Copy link
Member

Choose a reason for hiding this comment

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

I'd prefer to keep the existing method for backward compatibility purposes

Copy link
Contributor

Choose a reason for hiding this comment

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

I agree, but it's setup sources. I'm not sure that someone extends or customizes the setup process.

Copy link
Member

Choose a reason for hiding this comment

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

Yes, you are probably right

@sivaschenko
Copy link
Member

Updated laminas-mvc in this PR as well. Still trying to resolve the issue: Laminas DI attempts to instantiate even optional constructor parameters (and fails to do so)

@sivaschenko sivaschenko changed the title Laminas di and servicemanager updated to PHP 8 compatible version [WIP] Laminas di and servicemanager updated to PHP 8 compatible version Mar 4, 2021
@sivaschenko
Copy link
Member

@magento run all tests

@sivaschenko
Copy link
Member

@magento run all tests

@sivaschenko
Copy link
Member

@magento run all tests

@sivaschenko
Copy link
Member

Remaining issue to resolve:
Setup integration tests are failing with the error Connection "default" is not defined. This issue looks to be caused by missing env.php in dev/tests/setup-integration/tmp/etc during tests execution.

@sivaschenko
Copy link
Member

@magento run all tests

@sivaschenko sivaschenko changed the title [WIP] Laminas di and servicemanager updated to PHP 8 compatible version Laminas di and servicemanager updated to PHP 8 compatible version Mar 9, 2021
@magento-cicd2 magento-cicd2 merged commit 21c3055 into magento:php8-develop Mar 9, 2021
@m2-assistant
Copy link

m2-assistant bot commented Mar 9, 2021

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

hws47a added a commit to hws47a/magento2 that referenced this pull request Mar 11, 2021
hws47a added a commit to hws47a/magento2 that referenced this pull request Mar 11, 2021
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.

Update laminas/laminas-di dependency to PHP 8 compatible version
7 participants