Code Duplication    Length = 12-12 lines in 2 locations

src/Components/CsvExport.php 1 location

@@ 48-59 (lines=12) @@
45
     * @param Grid $grid
46
     * @return null|void
47
     */
48
    public function initialize(Grid $grid)
49
    {
50
        parent::initialize($grid);
51
        Event::listen(Grid::EVENT_PREPARE, function (Grid $grid) {
52
            if ($this->grid !== $grid) {
53
                return;
54
            }
55
            if ($grid->getInputProcessor()->getValue(static::INPUT_PARAM, false)) {
56
                $this->renderCsv();
57
            }
58
        });
59
    }
60
61
    /**
62
     * @param string $name

src/Components/ExcelExport.php 1 location

@@ 59-70 (lines=12) @@
56
     * @param Grid $grid
57
     * @return null|void
58
     */
59
    public function initialize(Grid $grid)
60
    {
61
        parent::initialize($grid);
62
        Event::listen(Grid::EVENT_PREPARE, function (Grid $grid) {
63
            if ($this->grid !== $grid) {
64
                return;
65
            }
66
            if ($grid->getInputProcessor()->getValue(static::INPUT_PARAM, false)) {
67
                $this->renderExcel();
68
            }
69
        });
70
    }
71
72
    /**
73
     * @param string $name