Code Duplication    Length = 12-12 lines in 2 locations

src/Components/CsvExport.php 1 location

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

src/Components/ExcelExport.php 1 location

@@ 65-76 (lines=12) @@
62
     * @param Grid $grid
63
     * @return null|void
64
     */
65
    public function initialize(Grid $grid)
66
    {
67
        parent::initialize($grid);
68
        Event::listen(Grid::EVENT_PREPARE, function (Grid $grid) {
69
            if ($this->grid !== $grid) {
70
                return;
71
            }
72
            if ($grid->getInputProcessor()->getValue(static::INPUT_PARAM, false)) {
73
                $this->renderExcel();
74
            }
75
        });
76
    }
77
78
    /**
79
     * Sets name of exported file.