Code Duplication    Length = 10-10 lines in 2 locations

src/Show/Field.php 1 location

@@ 180-189 (lines=10) @@
177
     *
178
     * @return $this
179
     */
180
    public function using(array $values, $default = null)
181
    {
182
        return $this->as(function ($value) use ($values, $default) {
183
            if (is_null($value)) {
184
                return $default;
185
            }
186
187
            return array_get($values, $value, $default);
188
        });
189
    }
190
191
    /**
192
     * Show field as a image.

src/Grid/Column.php 1 location

@@ 334-343 (lines=10) @@
331
     *
332
     * @return $this
333
     */
334
    public function using(array $values, $default = null)
335
    {
336
        return $this->display(function ($value) use ($values, $default) {
337
            if (is_null($value)) {
338
                return $default;
339
            }
340
341
            return array_get($values, $value, $default);
342
        });
343
    }
344
345
    /**
346
     * Render this column with the given view.