Code Duplication    Length = 12-15 lines in 2 locations

src/Grid/Displayers/Expand.php 1 location

@@ 14-28 (lines=15) @@
11
12
    public function display($callback = null, $isExpand = false)
13
    {
14
        if (is_subclass_of($callback, Renderable::class)) {
15
            $html = <<<HTML
16
<div class="loading text-center" style="padding: 20px 0px;">
17
    <i class="fa fa-spinner fa-pulse fa-3x fa-fw"></i>
18
</div>
19
HTML;
20
            $this->renderable = $callback;
21
            $this->addRenderableModalScript();
22
        } else {
23
            $callback = $callback->bindTo($this->row);
24
25
            $html = call_user_func_array($callback, [$this->row]);
26
27
            $this->addScript($isExpand);
28
        }
29
30
        $key = $this->column->getName().'-'.$this->getKey();
31

src/Grid/Displayers/Modal.php 1 location

@@ 53-64 (lines=12) @@
50
            $title = $this->trans('title');
51
        }
52
53
        if (is_subclass_of($callback, Renderable::class)) {
54
            $html = <<<HTML
55
<div class="loading text-center">
56
    <i class="fa fa-spinner fa-pulse fa-3x fa-fw"></i>
57
</div>
58
HTML;
59
            $this->renderable = $callback;
60
            $this->addRenderableModalScript();
61
        } else {
62
            $callback = $callback->bindTo($this->row);
63
            $html = call_user_func_array($callback, [$this->row]);
64
        }
65
66
        $key = $this->getKey().'-'.str_replace('.', '_', $this->getColumn()->getName());
67