Code Duplication    Length = 14-14 lines in 2 locations

src/OpenSkill/Datatable/Views/DatatableView.php 2 locations

@@ 151-164 (lines=14) @@
148
     *
149
     * @return string the rendered view that represents the table
150
     */
151
    public function table()
152
    {
153
        if (empty($this->columns)) {
154
            throw new \InvalidArgumentException("There are no columns defined");
155
        }
156
157
        return $this->viewFactory
158
            ->make($this->tableView, [
159
                'columns' => $this->columns,
160
                'showHeaders' => $this->printHeaders,
161
                'id' => $this->tableId
162
            ])
163
            ->render();
164
    }
165
166
    /**
167
     * Will render the javascript for the table
@@ 171-184 (lines=14) @@
168
     *
169
     * @return string the rendered view that represents the script
170
     */
171
    public function script()
172
    {
173
        if (empty($this->columns)) {
174
            throw new \InvalidArgumentException("There are no columns defined");
175
        }
176
        return $this->viewFactory
177
            ->make($this->scriptView, [
178
                'id' => $this->tableId,
179
                'columns' => $this->columns,
180
                'options' => $this->scriptOptions,
181
                'callbacks' => $this->scriptCallbacks,
182
            ])
183
            ->render();
184
    }
185
186
    /**
187
     * Will render the table and directly the script after it. This is a shortcut for