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

Added ExporterInterface usage instead of Exporter class #7994

Merged

Conversation

pkameisha
Copy link
Contributor

@pkameisha pkameisha commented Jan 2, 2023

Subject

I am targeting this branch, because {reason}.

Closes #{put_issue_number_here}.

Changelog

### Added
- Added usage of ExporterInterface instead of Exporter class.

### Changed
- Drop support sonata-project/exporter 2.x.

@@ -93,7 +93,7 @@ public static function getSubscribedServices(): array
'sonata.admin.audit.manager' => AuditManagerInterface::class,
'sonata.admin.object.manipulator.acl.admin' => AdminObjectAclManipulator::class,
'sonata.admin.request.fetcher' => AdminFetcherInterface::class,
'sonata.exporter.exporter' => '?'.Exporter::class,
'sonata.exporter.exporter' => '?'.ExporterInterface::class,
Copy link
Member

Choose a reason for hiding this comment

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

I think some change here:
https://github.com/sonata-project/exporter/blob/3.x/src/Bridge/Symfony/Resources/config/services.php#L64-L67
will be needed too.

See an example here:

->set('sonata.admin.request.fetcher', AdminFetcher::class)
->args([
new ReferenceConfigurator('sonata.admin.pool'),
])
->alias(AdminFetcherInterface::class, 'sonata.admin.request.fetcher')

So I think we'll need something like

$services->alias(ExporterInterface::class, 'sonata.exporter.exporter');

@VincentLanglet
Copy link
Member

explorer 3.1.1 is released, you can take a new try

@pkameisha pkameisha force-pushed the added-exporter-interface-usage branch from c91be47 to a7fed8f Compare January 2, 2023 20:27
@pkameisha
Copy link
Contributor Author

explorer 3.1.1 is released, you can take a new try

done. I think, it should work now

composer.json Outdated
@@ -35,7 +35,7 @@
"psr/log": "^1.1 || ^2.0 || ^3.0",
"sonata-project/block-bundle": "^4.11",
"sonata-project/doctrine-extensions": "^1.8 || ^2.0",
"sonata-project/exporter": "^2.11 || ^3.0",
"sonata-project/exporter": "^3.1",
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
"sonata-project/exporter": "^3.1",
"sonata-project/exporter": "^2.14 || ^3.1.1",

We need to keep the v2 support for the PHP 7.4 support.
I added the Interface on the v2 of exporter because it was simpler.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

agree, v2 is added

@pkameisha pkameisha force-pushed the added-exporter-interface-usage branch from a7fed8f to ffcdd75 Compare January 3, 2023 07:25
@pkameisha pkameisha marked this pull request as ready for review January 3, 2023 07:26
@VincentLanglet VincentLanglet merged commit b5aacbd into sonata-project:4.x Jan 3, 2023
@VincentLanglet
Copy link
Member

Thanks

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

Successfully merging this pull request may close these issues.

None yet

2 participants