Scrutinizer GitHub App not installed

We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.

Install GitHub App

Passed
Pull Request — master (#3145)
by
unknown
17:18
created

Views::setListHeaderClass()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 1
dl 0
loc 3
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace Backpack\CRUD\app\Library\CrudPanel\Traits;
4
5
trait Views
6
{
7
    // -------
8
    // CREATE
9
    // -------
10
11
    /**
12
     * Sets the create template.
13
     *
14
     * @param string $view name of the template file
15
     *
16
     * @return string $view name of the template file
17
     */
18
    public function setCreateView($view)
19
    {
20
        return $this->set('create.view', $view);
0 ignored issues
show
Bug introduced by
It seems like set() must be provided by classes using this trait. How about adding it as abstract method to this trait? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

20
        return $this->/** @scrutinizer ignore-call */ set('create.view', $view);
Loading history...
21
    }
22
23
    /**
24
     * Gets the create template.
25
     *
26
     * @return string name of the template file
27
     */
28
    public function getCreateView()
29
    {
30
        return $this->get('create.view') ?? 'crud::create';
0 ignored issues
show
Bug introduced by
It seems like get() must be provided by classes using this trait. How about adding it as abstract method to this trait? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

30
        return $this->/** @scrutinizer ignore-call */ get('create.view') ?? 'crud::create';
Loading history...
31
    }
32
33
    /**
34
     * Sets the create content class.
35
     *
36
     * @param string $class content class
37
     */
38
    public function setCreateContentClass(string $class)
39
    {
40
        return $this->set('create.contentClass', $class);
41
    }
42
43
    /**
44
     * Gets the create content class.
45
     *
46
     * @return string content class for create view
47
     */
48
    public function getCreateContentClass()
49
    {
50
        return $this->get('create.contentClass') ?? config('backpack.crud.operations.create.contentClass', 'col-md-8 bold-labels');
51
    }
52
53
    /**
54
     * Sets the create header class.
55
     *
56
     * @param string $class header class
57
     */
58
    public function setCreateHeaderClass(string $class)
59
    {
60
        return $this->set('create.headerClass', $class);
61
    }
62
63
    /**
64
     * Gets the create header class.
65
     *
66
     * @return string header class for create view
67
     */
68
    public function getCreateHeaderClass()
69
    {
70
        return $this->get('create.headerClass') ?? config('backpack.crud.operations.create.headerClass', 'col-md-8');
71
    }
72
73
    // -------
74
    // READ
75
    // -------
76
77
    /**
78
     * Sets the list template.
79
     *
80
     * @param string $view name of the template file
81
     *
82
     * @return string $view name of the template file
83
     */
84
    public function setListView($view)
85
    {
86
        return $this->set('list.view', $view);
87
    }
88
89
    /**
90
     * Gets the list template.
91
     *
92
     * @return string name of the template file
93
     */
94
    public function getListView()
95
    {
96
        return $this->get('list.view') ?? 'crud::list';
97
    }
98
99
    /**
100
     * Sets the list content class.
101
     *
102
     * @param string $class content class
103
     */
104
    public function setListContentClass(string $class)
105
    {
106
        return $this->set('list.contentClass', $class);
107
    }
108
109
    /**
110
     * Gets the list content class.
111
     *
112
     * @return string content class for list view
113
     */
114
    public function getListContentClass()
115
    {
116
        return $this->get('list.contentClass') ?? config('backpack.crud.operations.list.contentClass', 'col-md-12');
117
    }
118
119
    /**
120
     * Sets the list header class.
121
     *
122
     * @param string $class header class
123
     */
124
    public function setListHeaderClass(string $class)
125
    {
126
        return $this->set('list.headerClass', $class);
127
    }
128
129
    /**
130
     * Gets the list header class.
131
     *
132
     * @return string header class for list view
133
     */
134
    public function getListHeaderClass()
135
    {
136
        return $this->get('list.headerClass') ?? config('backpack.crud.operations.list.headerClass', 'col-md-12');
137
    }
138
139
    /**
140
     * Sets the details row template.
141
     *
142
     * @param string $view name of the template file
143
     *
144
     * @return string $view name of the template file
145
     */
146
    public function setDetailsRowView($view)
147
    {
148
        return $this->set('list.detailsRow.view', $view);
149
    }
150
151
    /**
152
     * Gets the details row template.
153
     *
154
     * @return string name of the template file
155
     */
156
    public function getDetailsRowView()
157
    {
158
        return $this->get('list.detailsRow.view') ?? 'crud::details_row';
159
    }
160
161
    /**
162
     * Sets the show template.
163
     *
164
     * @param string $view name of the template file
165
     *
166
     * @return string $view name of the template file
167
     */
168
    public function setShowView($view)
169
    {
170
        return $this->set('show.view', $view);
171
    }
172
173
    /**
174
     * Gets the show template.
175
     *
176
     * @return string name of the template file
177
     */
178
    public function getShowView()
179
    {
180
        return $this->get('show.view') ?? 'crud::show';
181
    }
182
183
    /**
184
     * Sets the edit content class.
185
     *
186
     * @param string $class content class
187
     */
188
    public function setShowContentClass(string $class)
189
    {
190
        return $this->set('show.contentClass', $class);
191
    }
192
193
    /**
194
     * Gets the edit content class.
195
     *
196
     * @return string content class for edit view
197
     */
198
    public function getShowContentClass()
199
    {
200
        return $this->get('show.contentClass') ?? config('backpack.crud.operations.show.contentClass', 'col-md-8 col-md-offset-2');
201
    }
202
203
    /**
204
     * Sets the edit header class.
205
     *
206
     * @param string $class header class
207
     */
208
    public function setShowHeaderClass(string $class)
209
    {
210
        return $this->set('show.headerClass', $class);
211
    }
212
213
    /**
214
     * Gets the edit header class.
215
     *
216
     * @return string header class for edit view
217
     */
218
    public function getShowHeaderClass()
219
    {
220
        return $this->get('show.headerClass') ?? config('backpack.crud.operations.show.headerClass', 'col-md-8 col-md-offset-2');
221
    }
222
223
    // -------
224
    // UPDATE
225
    // -------
226
227
    /**
228
     * Sets the edit template.
229
     *
230
     * @param string $view name of the template file
231
     *
232
     * @return string $view name of the template file
233
     */
234
    public function setEditView($view)
235
    {
236
        return $this->set('update.view', $view);
237
    }
238
239
    /**
240
     * Gets the edit template.
241
     *
242
     * @return string name of the template file
243
     */
244
    public function getEditView()
245
    {
246
        return $this->get('update.view') ?? 'crud::edit';
247
    }
248
249
    /**
250
     * Sets the edit content class.
251
     *
252
     * @param string $class content class
253
     */
254
    public function setEditContentClass(string $class)
255
    {
256
        return $this->set('update.contentClass', $class);
257
    }
258
259
    /**
260
     * Gets the edit content class.
261
     *
262
     * @return string content class for edit view
263
     */
264
    public function getEditContentClass()
265
    {
266
        return $this->get('update.contentClass') ?? config('backpack.crud.operations.update.contentClass', 'col-md-8 bold-labels');
267
    }
268
269
    /**
270
     * Sets the edit header class.
271
     *
272
     * @param string $class header class
273
     */
274
    public function setEditHeaderClass(string $class)
275
    {
276
        return $this->set('update.headerClass', $class);
277
    }
278
279
    /**
280
     * Gets the edit header class.
281
     *
282
     * @return string header class for edit view
283
     */
284
    public function getEditHeaderClass()
285
    {
286
        return $this->get('update.headerClass') ?? config('backpack.crud.operations.update.headerClass', 'col-md-8');
287
    }
288
289
    /**
290
     * Sets the reorder template.
291
     *
292
     * @param string $view name of the template file
293
     *
294
     * @return string $view name of the template file
295
     */
296
    public function setReorderView($view)
297
    {
298
        return $this->set('reorder.view', $view);
299
    }
300
301
    /**
302
     * Gets the reorder template.
303
     *
304
     * @return string name of the template file
305
     */
306
    public function getReorderView()
307
    {
308
        return $this->get('reorder.view') ?? 'crud::reorder';
309
    }
310
311
    /**
312
     * Sets the reorder content class.
313
     *
314
     * @param string $class content class
315
     */
316
    public function setReorderContentClass(string $class)
317
    {
318
        return $this->set('reorder.contentClass', $class);
319
    }
320
321
    /**
322
     * Gets the reorder&nest content class.
323
     *
324
     * @return string content class for reorder and nest view
325
     */
326
    public function getReorderContentClass()
327
    {
328
        return $this->get('reorder.contentClass') ?? config('backpack.crud.operations.reorder.contentClass', 'col-md-8 col-md-offset-2');
329
    }
330
331
    /**
332
     * Sets the reorder header class.
333
     *
334
     * @param string $class header class
335
     */
336
    public function setReorderHeaderClass(string $class)
337
    {
338
        return $this->set('reorder.headerClass', $class);
339
    }
340
341
    /**
342
     * Gets the reorder&nest header class.
343
     *
344
     * @return string header class for reorder and nest view
345
     */
346
    public function getReorderHeaderClass()
347
    {
348
        return $this->get('reorder.headerClass') ?? config('backpack.crud.operations.reorder.headerClass', 'col-md-8 col-md-offset-2');
349
    }
350
351
    // -------
352
    // ALIASES
353
    // -------
354
355
    public function getPreviewView()
356
    {
357
        return $this->getShowView();
358
    }
359
360
    public function setPreviewView($view)
361
    {
362
        return $this->setShowView($view);
363
    }
364
365
    public function getUpdateView()
366
    {
367
        return $this->getEditView();
368
    }
369
370
    public function setUpdateView($view)
371
    {
372
        return $this->setEditView($view);
373
    }
374
375
    public function setUpdateContentClass(string $editContentClass)
376
    {
377
        return $this->setEditContentClass($editContentClass);
378
    }
379
380
    public function setUpdateHeaderClass(string $editHeaderClass)
381
    {
382
        return $this->setEditHeaderClass($editHeaderClass);
383
    }
384
385
    public function getUpdateContentClass()
386
    {
387
        return $this->getEditContentClass();
388
    }
389
}
390