Code Duplication    Length = 14-15 lines in 3 locations

eZ/Publish/Core/SignalSlot/ContentService.php 3 locations

@@ 460-473 (lines=14) @@
457
     *
458
     * @param \eZ\Publish\API\Repository\Values\Content\VersionInfo $versionInfo
459
     */
460
    public function deleteVersion(VersionInfo $versionInfo)
461
    {
462
        $returnValue = $this->service->deleteVersion($versionInfo);
463
        $this->signalDispatcher->emit(
464
            new DeleteVersionSignal(
465
                array(
466
                    'contentId' => $versionInfo->contentInfo->id,
467
                    'versionNo' => $versionInfo->versionNo,
468
                )
469
            )
470
        );
471
472
        return $returnValue;
473
    }
474
475
    /**
476
     * Loads all versions for the given content.
@@ 563-577 (lines=15) @@
560
     *
561
     * @return \eZ\Publish\API\Repository\Values\Content\Relation the newly created relation
562
     */
563
    public function addRelation(VersionInfo $sourceVersion, ContentInfo $destinationContent)
564
    {
565
        $returnValue = $this->service->addRelation($sourceVersion, $destinationContent);
566
        $this->signalDispatcher->emit(
567
            new AddRelationSignal(
568
                array(
569
                    'srcContentId' => $sourceVersion->contentInfo->id,
570
                    'srcVersionNo' => $sourceVersion->versionNo,
571
                    'dstContentId' => $destinationContent->id,
572
                )
573
            )
574
        );
575
576
        return $returnValue;
577
    }
578
579
    /**
580
     * Removes a relation of type COMMON from a draft.
@@ 589-603 (lines=15) @@
586
     * @param \eZ\Publish\API\Repository\Values\Content\VersionInfo $sourceVersion
587
     * @param \eZ\Publish\API\Repository\Values\Content\ContentInfo $destinationContent
588
     */
589
    public function deleteRelation(VersionInfo $sourceVersion, ContentInfo $destinationContent)
590
    {
591
        $returnValue = $this->service->deleteRelation($sourceVersion, $destinationContent);
592
        $this->signalDispatcher->emit(
593
            new DeleteRelationSignal(
594
                array(
595
                    'srcContentId' => $sourceVersion->contentInfo->id,
596
                    'srcVersionNo' => $sourceVersion->versionNo,
597
                    'dstContentId' => $destinationContent->id,
598
                )
599
            )
600
        );
601
602
        return $returnValue;
603
    }
604
605
    /**
606
     * Adds translation information to the content object.