Code Duplication    Length = 13-13 lines in 2 locations

src/Surfnet/StepupMiddleware/ApiBundle/Configuration/EventListener/IdentityEventListener.php 1 location

@@ 51-63 (lines=13) @@
48
    /**
49
     * @param DomainMessage $domainMessage
50
     */
51
    public function handle(DomainMessage $domainMessage)
52
    {
53
        $event  = $domainMessage->getPayload();
54
55
        $classParts = explode('\\', get_class($event));
56
        $method = 'apply' . end($classParts);
57
58
        if (!method_exists($this, $method)) {
59
            return;
60
        }
61
62
        $this->$method($event, $domainMessage);
63
    }
64
65
    public function applyIdentityCreatedEvent(IdentityCreatedEvent $event)
66
    {

src/Surfnet/StepupMiddleware/ApiBundle/Configuration/EventListener/WhitelistEventListener.php 1 location

@@ 53-65 (lines=13) @@
50
    /**
51
     * @param DomainMessage $domainMessage
52
     */
53
    public function handle(DomainMessage $domainMessage)
54
    {
55
        $event  = $domainMessage->getPayload();
56
57
        $classParts = explode('\\', get_class($event));
58
        $method = 'apply' . end($classParts);
59
60
        if (!method_exists($this, $method)) {
61
            return;
62
        }
63
64
        $this->$method($event, $domainMessage);
65
    }
66
67
    public function applyWhitelistCreatedEvent(WhitelistCreatedEvent $event)
68
    {