We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 68dbbe3 commit 167d9d0Copy full SHA for 167d9d0
1 file changed
src/Entity/Advisory.php
@@ -195,18 +195,16 @@ public function removePackageVersion(PackageVersion $packageVersion): self
195
*/
196
public function getSites(): Collection
197
{
198
- $sites = new ArrayCollection();
+ $sites = [];
199
foreach ($this->packageVersions as $packageVersion) {
200
foreach ($packageVersion->getInstallations() as $installation) {
201
foreach ($installation->getSites() as $site) {
202
- if (!$sites->contains($site)) {
203
- $sites->add($site);
204
- }
+ $sites[$site->getId()->toRfc4122()] = $site;
205
}
206
207
208
209
- return $sites;
+ return new ArrayCollection(array_values($sites));
210
211
212
public function getPackage(): ?Package
0 commit comments