Code Duplication    Length = 10-11 lines in 3 locations

lib/Collection/ChildrenCollection.php 1 location

@@ 72-81 (lines=10) @@
69
    /**
70
     * {@inheritdoc}
71
     */
72
    public function current()
73
    {
74
        $this->initialize();
75
        $childNode = $this->documents->current();
76
77
        $hydrateEvent = new HydrateEvent($childNode, $this->locale, $this->options);
78
        $this->dispatcher->dispatch(Events::HYDRATE, $hydrateEvent);
79
80
        return $hydrateEvent->getDocument();
81
    }
82
83
    /**
84
     * {@inheritdoc}

lib/Collection/QueryResultCollection.php 1 location

@@ 78-88 (lines=11) @@
75
    /**
76
     * {@inheritdoc}
77
     */
78
    public function current()
79
    {
80
        $this->initialize();
81
        $row = $this->documents->current();
82
        $node = $row->getNode($this->primarySelector);
83
84
        $hydrateEvent = new HydrateEvent($node, $this->locale, $this->options);
85
        $this->eventDispatcher->dispatch(Events::HYDRATE, $hydrateEvent);
86
87
        return $hydrateEvent->getDocument();
88
    }
89
90
    /**
91
     * {@inheritdoc}

lib/Collection/ReferrerCollection.php 1 location

@@ 56-65 (lines=10) @@
53
    /**
54
     * {@inheritdoc}
55
     */
56
    public function current()
57
    {
58
        $this->initialize();
59
        $referrerNode = $this->documents->current();
60
61
        $hydrateEvent = new HydrateEvent($referrerNode, $this->locale);
62
        $this->dispatcher->dispatch(Events::HYDRATE, $hydrateEvent);
63
64
        return $hydrateEvent->getDocument();
65
    }
66
67
    /**
68
     * {@inheritdoc}