Code Duplication    Length = 10-10 lines in 3 locations

src/Grid/Displayers/DropdownActions.php 3 locations

@@ 76-85 (lines=10) @@
73
     *
74
     * @return $this
75
     */
76
    public function disableView(bool $disable = true)
77
    {
78
        if ($disable) {
79
            array_delete($this->defaultClass, Show::class);
80
        } elseif (!in_array(Show::class, $this->defaultClass)) {
81
            array_push($this->defaultClass, Show::class);
82
        }
83
84
        return $this;
85
    }
86
87
    /**
88
     * Disable delete.
@@ 94-103 (lines=10) @@
91
     *
92
     * @return $this.
93
     */
94
    public function disableDelete(bool $disable = true)
95
    {
96
        if ($disable) {
97
            array_delete($this->defaultClass, Delete::class);
98
        } elseif (!in_array(Delete::class, $this->defaultClass)) {
99
            array_push($this->defaultClass, Delete::class);
100
        }
101
102
        return $this;
103
    }
104
105
    /**
106
     * Disable edit.
@@ 112-121 (lines=10) @@
109
     *
110
     * @return $this
111
     */
112
    public function disableEdit(bool $disable = true)
113
    {
114
        if ($disable) {
115
            array_delete($this->defaultClass, Edit::class);
116
        } elseif (!in_array(Edit::class, $this->defaultClass)) {
117
            array_push($this->defaultClass, Edit::class);
118
        }
119
120
        return $this;
121
    }
122
123
    /**
124
     * @param null|\Closure $callback