source = $source; $this->updateAdvisory($advisory); } public function updateAdvisory(RemoteSecurityAdvisory $advisory): void { if ( $this->remoteId !== $advisory->getId() || $this->packageName !== $advisory->getPackageName() || $this->title !== $advisory->getTitle() || $this->link !== $advisory->getLink() || $this->cve !== $advisory->getCve() || $this->affectedVersions !== $advisory->getAffectedVersions() || $this->reportedAt != $advisory->getDate() || $this->composerRepository !== $advisory->getComposerRepository() ) { $this->updatedAt = new \DateTime(); $this->reportedAt = $advisory->getDate(); } $this->remoteId = $advisory->getId(); $this->packageName = $advisory->getPackageName(); $this->title = $advisory->getTitle(); $this->link = $advisory->getLink(); $this->cve = $advisory->getCve(); $this->affectedVersions = $advisory->getAffectedVersions(); $this->composerRepository = $advisory->getComposerRepository(); } public function getRemoteId(): string { return $this->remoteId; } public function getPackageName(): string { return $this->packageName; } public function getTitle(): string { return $this->title; } public function getLink(): ?string { return $this->link; } public function getCve(): ?string { return $this->cve; } public function getAffectedVersions(): string { return $this->affectedVersions; } public function getSource(): string { return $this->source; } }