-
-
Notifications
You must be signed in to change notification settings - Fork 90
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
Change SourceManager implementation #606
Conversation
52a8b64
to
020a0bc
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doc need to be updated too https://docs.sonata-project.org/projects/SonataSeoBundle/en/3.x/reference/sitemap/#service-definition
src/Sitemap/Source.php
Outdated
/** | ||
* @param mixed[] $types | ||
*/ | ||
public function addType(array $types): void |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
addTypes maybe ?
Or the addType should just add one type, and we should have the array_diff logic somewhere else.
Also the only usage of addSource
is here:
$source->addMethodCall('addSource', [$sitemap['group'], new Reference($sitemapIteratorId), $sitemap['types']]); |
Can't we know what is a type to give a more specific typehint than mixed ? (never used this bundle but I assume it's a string in https://docs.sonata-project.org/projects/SonataSeoBundle/en/3.x/reference/sitemap/#configuration-example)
Then having unique values are kinda easy with strings...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
addTypes maybe ?
Renamed the method.
Also the only usage of
addSource
is here:
$source->addMethodCall('addSource', [$sitemap['group'], new Reference($sitemapIteratorId), $sitemap['types']]);
That's not correct. The addSource
method here calls the method on SourceIteratorInterface
.
Can't we know what is a type to give a more specific typehint than mixed ? (never used this bundle but I assume it's a string in https://docs.sonata-project.org/projects/SonataSeoBundle/en/3.x/reference/sitemap/#configuration-example)
Never used this part either. For what I know, the type
is just an array with an unknown signature. I would keep it as it is.
This PR started to just fix the broken 3.x
build.
Why? Only the container for all The docs need to be updated when using the next exporter major version which will remove the |
My bad. I thought it wasnt needed to implement the interface and Iterator was only needed. Indeed it will only be changed in the next major. |
Please review @sonata-project/contributors so we can fix the broken |
Subject
Fixes the build by changing the
SourceManager
implementation. The class has nothing to do with the exporter, so there is no need to implement the interface.I am targeting this branch, because this is a breaking change.
Changelog