/** * @param string $title * @param array $tagLabels * @return void */ protected function removePreviousProfilePictureBasedOnTags($title, array $tagLabels) { $images = $this->imageRepository->findBySearchTermOrTags($title, $tagLabels); foreach ($images as $image) { $this->imageRepository->remove($image); } }