Code Duplication    Length = 17-17 lines in 2 locations

src/Config/ModelFactory.php 1 location

@@ 117-133 (lines=17) @@
114
        $this->getRepository()->restore($id);
115
    }
116
117
    protected function parseRows(Collection $rows)
118
    {
119
        if ($rows) {
120
            return $rows->map(function ($row) {
121
                $newRow = $this->configManager->getColumns()->mapWithKeys(function ($column) use ($row) {
122
                    return [$column->getName() => $column->setModel($row)->render()];
123
                });
124
125
                // whether this row has been soft deleted
126
                if ($this->getRepository()->isRestorable()) {
127
                    $newRow->put('_deleted', $row->trashed() ? 1 : 0);
128
                }
129
                return $newRow;
130
            });
131
        }
132
        return collect();
133
    }
134
135
    protected function usePagination()
136
    {

src/View/Table.php 1 location

@@ 98-114 (lines=17) @@
95
        ];
96
    }
97
98
    protected function parseRows(Collection $rows)
99
    {
100
        if ($rows) {
101
            return $rows->map(function ($row) {
102
                    $newRow = $this->getColumns()->mapWithKeys(function (ColumnInterface $column) use ($row) {
103
                        return [$column->getName() => $column->setModel($row)->getModelValue()];
104
                    });
105
106
                // whether this row has been soft deleted
107
                if ($this->getRepository()->isRestorable()) {
108
                    $newRow->put('_deleted', $row->trashed() ? 1 : 0);
109
                }
110
                return $newRow;
111
            });
112
        }
113
        return collect();
114
    }
115
}
116