Code Duplication    Length = 10-10 lines in 14 locations

src/Form/Footer.php 5 locations

@@ 53-62 (lines=10) @@
50
     *
51
     * @return $this
52
     */
53
    public function disableReset(bool $disable = true)
54
    {
55
        if ($disable) {
56
            array_delete($this->buttons, 'reset');
57
        } elseif (!in_array('reset', $this->buttons)) {
58
            array_push($this->buttons, 'reset');
59
        }
60
61
        return $this;
62
    }
63
64
    /**
65
     * Disable submit button.
@@ 69-78 (lines=10) @@
66
     *
67
     * @return $this
68
     */
69
    public function disableSubmit(bool $disable = true)
70
    {
71
        if ($disable) {
72
            array_delete($this->buttons, 'submit');
73
        } elseif (!in_array('submit', $this->buttons)) {
74
            array_push($this->buttons, 'submit');
75
        }
76
77
        return $this;
78
    }
79
80
    /**
81
     * Disable View Checkbox.
@@ 85-94 (lines=10) @@
82
     *
83
     * @return $this
84
     */
85
    public function disableViewCheck(bool $disable = true)
86
    {
87
        if ($disable) {
88
            array_delete($this->checkboxes, 'view');
89
        } elseif (!in_array('view', $this->checkboxes)) {
90
            array_push($this->checkboxes, 'view');
91
        }
92
93
        return $this;
94
    }
95
96
    /**
97
     * Disable Editing Checkbox.
@@ 101-110 (lines=10) @@
98
     *
99
     * @return $this
100
     */
101
    public function disableEditingCheck(bool $disable = true)
102
    {
103
        if ($disable) {
104
            array_delete($this->checkboxes, 'continue_editing');
105
        } elseif (!in_array('continue_editing', $this->checkboxes)) {
106
            array_push($this->checkboxes, 'continue_editing');
107
        }
108
109
        return $this;
110
    }
111
112
    /**
113
     * Disable Creating Checkbox.
@@ 117-126 (lines=10) @@
114
     *
115
     * @return $this
116
     */
117
    public function disableCreatingCheck(bool $disable = true)
118
    {
119
        if ($disable) {
120
            array_delete($this->checkboxes, 'continue_creating');
121
        } elseif (!in_array('continue_creating', $this->checkboxes)) {
122
            array_push($this->checkboxes, 'continue_creating');
123
        }
124
125
        return $this;
126
    }
127
128
    /**
129
     * Setup scripts.

src/Form/Tools.php 3 locations

@@ 83-92 (lines=10) @@
80
     *
81
     * @return $this
82
     */
83
    public function disableList(bool $disable = true)
84
    {
85
        if ($disable) {
86
            array_delete($this->tools, 'list');
87
        } elseif (!in_array('list', $this->tools)) {
88
            array_push($this->tools, 'list');
89
        }
90
91
        return $this;
92
    }
93
94
    /**
95
     * Disable `delete` tool.
@@ 99-108 (lines=10) @@
96
     *
97
     * @return $this
98
     */
99
    public function disableDelete(bool $disable = true)
100
    {
101
        if ($disable) {
102
            array_delete($this->tools, 'delete');
103
        } elseif (!in_array('delete', $this->tools)) {
104
            array_push($this->tools, 'delete');
105
        }
106
107
        return $this;
108
    }
109
110
    /**
111
     * Disable `edit` tool.
@@ 115-124 (lines=10) @@
112
     *
113
     * @return $this
114
     */
115
    public function disableView(bool $disable = true)
116
    {
117
        if ($disable) {
118
            array_delete($this->tools, 'view');
119
        } elseif (!in_array('view', $this->tools)) {
120
            array_push($this->tools, 'view');
121
        }
122
123
        return $this;
124
    }
125
126
    /**
127
     * Get request path for resource list.

src/Grid/Displayers/Actions.php 3 locations

@@ 64-73 (lines=10) @@
61
     *
62
     * @return $this
63
     */
64
    public function disableView(bool $disable = true)
65
    {
66
        if ($disable) {
67
            array_delete($this->actions, 'view');
68
        } elseif (!in_array('view', $this->actions)) {
69
            array_push($this->actions, 'view');
70
        }
71
72
        return $this;
73
    }
74
75
    /**
76
     * Disable delete.
@@ 80-89 (lines=10) @@
77
     *
78
     * @return $this.
79
     */
80
    public function disableDelete(bool $disable = true)
81
    {
82
        if ($disable) {
83
            array_delete($this->actions, 'delete');
84
        } elseif (!in_array('delete', $this->actions)) {
85
            array_push($this->actions, 'delete');
86
        }
87
88
        return $this;
89
    }
90
91
    /**
92
     * Disable edit.
@@ 96-105 (lines=10) @@
93
     *
94
     * @return $this.
95
     */
96
    public function disableEdit(bool $disable = true)
97
    {
98
        if ($disable) {
99
            array_delete($this->actions, 'edit');
100
        } elseif (!in_array('edit', $this->actions)) {
101
            array_push($this->actions, 'edit');
102
        }
103
104
        return $this;
105
    }
106
107
    /**
108
     * Set resource of current resource.

src/Show/Tools.php 3 locations

@@ 105-114 (lines=10) @@
102
     *
103
     * @return $this
104
     */
105
    public function disableList(bool $disable = true)
106
    {
107
        if ($disable) {
108
            array_delete($this->tools, 'list');
109
        } elseif (!in_array('list', $this->tools)) {
110
            array_push($this->tools, 'list');
111
        }
112
113
        return $this;
114
    }
115
116
    /**
117
     * Disable `delete` tool.
@@ 121-130 (lines=10) @@
118
     *
119
     * @return $this
120
     */
121
    public function disableDelete(bool $disable = true)
122
    {
123
        if ($disable) {
124
            array_delete($this->tools, 'delete');
125
        } elseif (!in_array('delete', $this->tools)) {
126
            array_push($this->tools, 'delete');
127
        }
128
129
        return $this;
130
    }
131
132
    /**
133
     * Disable `edit` tool.
@@ 137-146 (lines=10) @@
134
     *
135
     * @return $this
136
     */
137
    public function disableEdit(bool $disable = true)
138
    {
139
        if ($disable) {
140
            array_delete($this->tools, 'edit');
141
        } elseif (!in_array('edit', $this->tools)) {
142
            array_push($this->tools, 'edit');
143
        }
144
145
        return $this;
146
    }
147
148
    /**
149
     * Get request path for resource list.