Code Duplication    Length = 14-15 lines in 2 locations

module/Solr/src/Solr/Event/Listener/JobEventSubscriber.php 2 locations

@@ 44-58 (lines=15) @@
41
        ];
42
    }
43
44
    public function postPersist(LifecycleEventArgs $eventArgs)
45
    {
46
        $document = $eventArgs->getDocument();
47
48
        if (!$document instanceof Job) {
49
            return;
50
        }
51
52
        $solrDoc = $this->generateInputDocument($document, new \SolrInputDocument());
53
        try{
54
            $this->solrManager->addDocument($solrDoc,'/solr/YawikJobs');
55
        }catch (\Exception $e){
56
            // @TODO: What to do when the process failed?
57
        }
58
    }
59
60
    public function postUpdate(LifecycleEventArgs $eventArgs)
61
    {
@@ 60-73 (lines=14) @@
57
        }
58
    }
59
60
    public function postUpdate(LifecycleEventArgs $eventArgs)
61
    {
62
        $document = $eventArgs->getDocument();
63
        if (!$document instanceof Job) {
64
            return;
65
        }
66
67
        $solrDoc = $this->generateInputDocument($document,new \SolrInputDocument());
68
        try{
69
            $this->solrManager->addDocument($solrDoc,'/solr/YawikJobs');
70
        }catch (\Exception $e){
71
            // @TODO: What to do when the process failed?
72
        }
73
    }
74
75
    /**
76
     * @param ServiceLocatorInterface $serviceLocator