Code Duplication    Length = 13-18 lines in 3 locations

src/DbalDataProvider.php 1 location

@@ 118-130 (lines=13) @@
115
        return $this->src;
116
    }
117
118
    public function getRow()
119
    {
120
        if ($this->index < $this->getCurrentPageRowsCount()) {
121
            $this->index++;
122
            $item = $this->iterator->current();
123
            $this->iterator->next();
124
            $row = new ObjectDataRow($item, $this->getRowId());
125
            Event::fire(self::EVENT_FETCH_ROW, [$row, $this]);
126
            return $row;
127
        } else {
128
            return null;
129
        }
130
    }
131
132
    protected $_count;
133

src/EloquentDataProvider.php 1 location

@@ 87-99 (lines=13) @@
84
        return $this->src;
85
    }
86
87
    public function getRow()
88
    {
89
        if ($this->index < $this->count()) {
90
            $this->index++;
91
            $item = $this->iterator->current();
92
            $this->iterator->next();
93
            $row = new EloquentDataRow($item, $this->getRowId());
94
            Event::fire(self::EVENT_FETCH_ROW, [$row, $this]);
95
            return $row;
96
        } else {
97
            return null;
98
        }
99
    }
100
101
    /**
102
     * {@inheritdoc}

src/CollectionDataProvider.php 1 location

@@ 77-94 (lines=18) @@
74
        return $this->src;
75
    }
76
77
    public function getRow()
78
    {
79
        if (!$this->iterator) {
80
            $this->getIterator();
81
        }
82
83
        if ($this->index < $this->count()) {
84
            $this->index++;
85
            $item = $this->iterator->current();
86
            $this->iterator->next();
87
            $row = new EloquentDataRow($item, $this->getRowId());
88
            Event::fire(self::EVENT_FETCH_ROW, [$row, $this]);
89
            return $row;
90
        } else {
91
            return null;
92
        }
93
    }
94
95
    /**
96
     * {@inheritdoc}
97
     */