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
        {
81
          $this->getIterator();
82
        }
83
84
        if ($this->index < $this->count()) {
85
            $this->index++;
86
            $item = $this->iterator->current();
87
            $this->iterator->next();
88
            $row = new EloquentDataRow($item, $this->getRowId());
89
            Event::fire(self::EVENT_FETCH_ROW, [$row, $this]);
90
            return $row;
91
        } else {
92
            return null;
93
        }
94
    }
95
96
    /**
97
     * {@inheritdoc}