Code Duplication    Length = 14-14 lines in 2 locations

src/Html/HasOptions.php 2 locations

@@ 151-164 (lines=14) @@
148
     * @return $this
149
     * @see https://datatables.net/reference/option/order
150
     */
151
    public function orderBy($index, $direction = 'desc')
152
    {
153
        if ($direction != 'desc') {
154
            $direction = 'asc';
155
        }
156
157
        if (is_array($index)) {
158
            $this->attributes['order'][] = $index;
159
        } else {
160
            $this->attributes['order'][] = [$index, $direction];
161
        }
162
163
        return $this;
164
    }
165
166
    /**
167
     * Order Fixed option builder.
@@ 174-187 (lines=14) @@
171
     * @return $this
172
     * @see https://datatables.net/reference/option/orderFixed
173
     */
174
    public function orderByFixed($index, $direction = 'desc')
175
    {
176
        if ($direction != 'desc') {
177
            $direction = 'asc';
178
        }
179
180
        if (is_array($index)) {
181
            $this->attributes['orderFixed'][] = $index;
182
        } else {
183
            $this->attributes['orderFixed'][] = [$index, $direction];
184
        }
185
186
        return $this;
187
    }
188
189
    /**
190
     * Set orderMulti option value.