Passed
Push — master ( 26c354...92479f )
by Richard
05:49 queued 10s
created

VueGenerator::generate()   B

Complexity

Conditions 9
Paths 132

Size

Total Lines 46
Code Lines 27

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 27
c 1
b 0
f 0
dl 0
loc 46
rs 7.7888
cc 9
nc 132
nop 0
1
<?php
2
3
namespace PWWEB\Artomator\Generators\Scaffold;
4
5
use Illuminate\Support\Arr;
6
use Illuminate\Support\Str;
7
use InfyOm\Generator\Generators\BaseGenerator;
8
use InfyOm\Generator\Utils\FileUtil;
9
use PWWEB\Artomator\Common\CommandData;
10
use PWWEB\Artomator\Generators\ViewServiceProviderGenerator;
11
use PWWEB\Artomator\Utils\VueFieldGenerator;
12
13
class VueGenerator extends BaseGenerator
14
{
15
    /**
16
     * Command data.
17
     *
18
     * @var CommandData
19
     */
20
    private $commandData;
21
22
    /**
23
     * Path.
24
     *
25
     * @var string
26
     */
27
    private $path;
28
29
    /**
30
     * Template type.
31
     *
32
     * @var string
33
     */
34
    private $templateType;
35
36
    /**
37
     * Html Fields.
38
     *
39
     * @var array
40
     */
41
    private $htmlFields;
42
43
    /**
44
     * Construct function.
45
     *
46
     * @param CommandData $commandData Command Data.
47
     *
48
     * @return void
49
     */
50
    public function __construct(CommandData $commandData)
51
    {
52
        $this->commandData = $commandData;
53
        $this->path = $commandData->config->pathVues;
54
        $this->templateType = config('infyom.laravel_generator.templates', 'adminlte-templates');
55
    }
56
57
    /**
58
     * Generate Function.
59
     *
60
     * @return void
61
     */
62
    public function generate()
63
    {
64
        if (false === file_exists($this->path)) {
65
            mkdir($this->path, 0755, true);
66
        }
67
68
        $htmlInputs = Arr::pluck($this->commandData->fields, 'htmlInput');
69
        if (true === in_array('file', $htmlInputs)) {
70
            $this->commandData->addDynamicVariable('$FILES$', ' enctype="multipart/form-data"');
71
        }
72
73
        $this->commandData->commandComment("\nGenerating Vues...");
74
75
        if (true === $this->commandData->getOption('views')) {
76
            $vuesToBeGenerated = explode(',', $this->commandData->getOption('views'));
0 ignored issues
show
Bug introduced by
It seems like $this->commandData->getOption('views') can also be of type false; however, parameter $string of explode() does only seem to accept string, maybe add an additional type check? ( Ignorable by Annotation )

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

76
            $vuesToBeGenerated = explode(',', /** @scrutinizer ignore-type */ $this->commandData->getOption('views'));
Loading history...
77
78
            if (true === in_array('index', $vuesToBeGenerated)) {
79
                $this->generateIndex();
80
            }
81
82
            if (count(array_intersect(['create', 'update'], $vuesToBeGenerated)) > 0) {
83
                $this->generateFields();
84
            }
85
86
            if (true === in_array('create', $vuesToBeGenerated)) {
87
                $this->generateCreate();
88
            }
89
90
            if (true === in_array('edit', $vuesToBeGenerated)) {
91
                $this->generateUpdate();
92
            }
93
94
            if (true === in_array('show', $vuesToBeGenerated)) {
95
                $this->generateShowFields();
96
                $this->generateShow();
97
            }
98
        } else {
99
            $this->generateIndex();
100
            $this->generateFields();
101
            $this->generateCreate();
102
            $this->generateUpdate();
103
            $this->generateShowFields();
104
            $this->generateShow();
105
        }
106
107
        $this->commandData->commandComment('Vues created: ');
108
    }
109
110
    /**
111
     * Generate Table.
112
     *
113
     * @return void
114
     */
115
    private function generateTable()
116
    {
117
        if (true === $this->commandData->getAddOn('datatables')) {
118
            $templateData = $this->generateDataTableBody();
0 ignored issues
show
Bug introduced by
Are you sure the assignment to $templateData is correct as $this->generateDataTableBody() targeting PWWEB\Artomator\Generato...generateDataTableBody() seems to always return null.

This check looks for function or method calls that always return null and whose return value is assigned to a variable.

class A
{
    function getObject()
    {
        return null;
    }

}

$a = new A();
$object = $a->getObject();

The method getObject() can return nothing but null, so it makes no sense to assign that value to a variable.

The reason is most likely that a function or method is imcomplete or has been reduced for debug purposes.

Loading history...
119
            $this->generateDataTableActions();
120
        } else {
121
            $templateData = $this->generateBladeTableBody();
0 ignored issues
show
Bug introduced by
Are you sure the assignment to $templateData is correct as $this->generateBladeTableBody() targeting PWWEB\Artomator\Generato...enerateBladeTableBody() seems to always return null.

This check looks for function or method calls that always return null and whose return value is assigned to a variable.

class A
{
    function getObject()
    {
        return null;
    }

}

$a = new A();
$object = $a->getObject();

The method getObject() can return nothing but null, so it makes no sense to assign that value to a variable.

The reason is most likely that a function or method is imcomplete or has been reduced for debug purposes.

Loading history...
122
        }
123
124
        return $templateData;
125
    }
126
127
    /**
128
     * Generate Data Table Body.
129
     *
130
     * @return void
131
     */
132
    private function generateDataTableBody()
133
    {
134
        $templateData = get_artomator_template('scaffold.views.datatable_body');
135
136
        return fill_template($this->commandData->dynamicVars, $templateData);
0 ignored issues
show
Bug Best Practice introduced by
The expression return fill_template($th...micVars, $templateData) returns the type string which is incompatible with the documented return type void.
Loading history...
137
    }
138
139
    /**
140
     * Generate Data Table Actions.
141
     *
142
     * @return void
143
     */
144
    private function generateDataTableActions()
145
    {
146
        $templateName = 'datatables_actions';
147
148
        if (true === $this->commandData->isLocalizedTemplates()) {
149
            $templateName .= '_locale';
150
        }
151
152
        $templateData = get_artomator_template('scaffold.views.'.$templateName);
153
154
        $templateData = fill_template($this->commandData->dynamicVars, $templateData);
155
156
        FileUtil::createFile($this->path, 'datatables_actions.blade.php', $templateData);
157
158
        $this->commandData->commandInfo('datatables_actions.blade.php created');
159
    }
160
161
    /**
162
     * Generate Blade Table Body.
163
     *
164
     * @return void
165
     */
166
    private function generateBladeTableBody()
167
    {
168
        $templateName = 'blade_table_body';
169
170
        if (true === $this->commandData->isLocalizedTemplates()) {
171
            $templateName .= '_locale';
172
        }
173
174
        $templateData = get_artomator_template('scaffold.vues.'.$templateName);
175
176
        $templateData = fill_template($this->commandData->dynamicVars, $templateData);
177
178
        $templateData = str_replace('$FIELD_HEADERS$', $this->generateTableHeaderFields(), $templateData);
0 ignored issues
show
Bug introduced by
Are you sure the usage of $this->generateTableHeaderFields() targeting PWWEB\Artomator\Generato...rateTableHeaderFields() seems to always return null.

This check looks for function or method calls that always return null and whose return value is used.

class A
{
    function getObject()
    {
        return null;
    }

}

$a = new A();
if ($a->getObject()) {

The method getObject() can return nothing but null, so it makes no sense to use the return value.

The reason is most likely that a function or method is imcomplete or has been reduced for debug purposes.

Loading history...
Bug introduced by
$this->generateTableHeaderFields() of type void is incompatible with the type string|string[] expected by parameter $replace of str_replace(). ( Ignorable by Annotation )

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

178
        $templateData = str_replace('$FIELD_HEADERS$', /** @scrutinizer ignore-type */ $this->generateTableHeaderFields(), $templateData);
Loading history...
179
180
        $cellFieldTemplate = get_artomator_template('scaffold.vues.table_cell');
181
182
        $tableBodyFields = [];
183
184
        foreach ($this->commandData->fields as $field) {
185
            if (false === $field->inIndex) {
186
                continue;
187
            }
188
189
            $tableBodyFields[] = fill_template_with_field_data(
190
                $this->commandData->dynamicVars,
191
                $this->commandData->fieldNamesMapping,
192
                $cellFieldTemplate,
193
                $field
194
            );
195
        }
196
197
        $tableBodyFields = implode(infy_nl_tab(1, 3), $tableBodyFields);
198
199
        return str_replace('$FIELD_BODY$', $tableBodyFields, $templateData);
0 ignored issues
show
Bug Best Practice introduced by
The expression return str_replace('$FIE...yFields, $templateData) returns the type string which is incompatible with the documented return type void.
Loading history...
200
    }
201
202
    /**
203
     * Generate Table Header Fields.
204
     *
205
     * @return void
206
     */
207
    private function generateTableHeaderFields()
208
    {
209
        $templateName = 'table_header';
210
211
        $localized = false;
212
        if (true === $this->commandData->isLocalizedTemplates()) {
213
            $templateName .= '_locale';
214
            $localized = true;
215
        }
216
217
        $headerFieldTemplate = get_artomator_template('scaffold.vues.'.$templateName);
218
219
        $headerFields = [];
220
221
        foreach ($this->commandData->fields as $field) {
222
            if (false === $field->inIndex) {
223
                continue;
224
            }
225
226
            if (true === $localized) {
227
                $headerFields[] = $fieldTemplate = fill_template_with_field_data_locale(
0 ignored issues
show
Unused Code introduced by
The assignment to $fieldTemplate is dead and can be removed.
Loading history...
228
                    $this->commandData->dynamicVars,
229
                    $this->commandData->fieldNamesMapping,
230
                    $headerFieldTemplate,
231
                    $field
232
                );
233
            } else {
234
                $headerFields[] = $fieldTemplate = fill_template_with_field_data(
235
                    $this->commandData->dynamicVars,
236
                    $this->commandData->fieldNamesMapping,
237
                    $headerFieldTemplate,
238
                    $field
239
                );
240
            }
241
        }
242
243
        return implode(infy_nl_tab(1, 2), $headerFields);
0 ignored issues
show
Bug Best Practice introduced by
The expression return implode(infy_nl_tab(1, 2), $headerFields) returns the type string which is incompatible with the documented return type void.
Loading history...
244
    }
245
246
    /**
247
     * Generate Index.
248
     *
249
     * @return void
250
     */
251
    private function generateIndex()
252
    {
253
        $templateName = 'index';
254
255
        if (true === $this->commandData->isLocalizedTemplates()) {
256
            $templateName .= '_locale';
257
        }
258
259
        $templateData = get_artomator_template('scaffold.vues.'.$templateName);
260
261
        $templateData = fill_template($this->commandData->dynamicVars, $templateData);
262
263
        // if (true === $this->commandData->getAddOn('datatables')) {
264
        //     $templateData = str_replace('$PAGINATE$', '', $templateData);
265
        // } else {
266
        //     $paginate = $this->commandData->getOption('paginate');
267
268
        //     if (true === $paginate) {
269
        //         $paginateTemplate = get_artomator_template('scaffold.vues.paginate');
270
271
        //         $paginateTemplate = fill_template($this->commandData->dynamicVars, $paginateTemplate);
272
273
        //         $templateData = str_replace('$PAGINATE$', $paginateTemplate, $templateData);
274
        //     } else {
275
        //         $templateData = str_replace('$PAGINATE$', '', $templateData);
276
        //     }
277
        // }
278
279
        $templateData = str_replace('$TABLE$', $this->generateTable(), $templateData);
0 ignored issues
show
Bug introduced by
$this->generateTable() of type void is incompatible with the type string|string[] expected by parameter $replace of str_replace(). ( Ignorable by Annotation )

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

279
        $templateData = str_replace('$TABLE$', /** @scrutinizer ignore-type */ $this->generateTable(), $templateData);
Loading history...
Bug introduced by
Are you sure the usage of $this->generateTable() targeting PWWEB\Artomator\Generato...erator::generateTable() seems to always return null.

This check looks for function or method calls that always return null and whose return value is used.

class A
{
    function getObject()
    {
        return null;
    }

}

$a = new A();
if ($a->getObject()) {

The method getObject() can return nothing but null, so it makes no sense to use the return value.

The reason is most likely that a function or method is imcomplete or has been reduced for debug purposes.

Loading history...
280
281
        FileUtil::createFile($this->path, 'Index.vue', $templateData);
282
283
        $this->commandData->commandInfo('Index.vue created');
284
    }
285
286
    /**
287
     * Generate Fields.
288
     *
289
     * @return void
290
     */
291
    private function generateFields()
292
    {
293
        $templateName = 'fields';
294
295
        $localized = false;
296
        if (true === $this->commandData->isLocalizedTemplates()) {
297
            $templateName .= '_locale';
298
            $localized = true;
299
        }
300
301
        $this->htmlFields = [];
302
        $createForm = [];
303
        $editForm = [];
304
305
        foreach ($this->commandData->fields as $field) {
306
            if (false === $field->inForm) {
307
                continue;
308
            }
309
310
            $validations = explode('|', $field->validations);
311
            $minMaxRules = '';
312
            $required = '';
313
            foreach ($validations as $validation) {
314
                if (false === Str::contains($validation, ['max:', 'min:'])) {
315
                    continue;
316
                }
317
318
                $validationText = substr($validation, 0, 3);
319
                $sizeInNumber = substr($validation, 4);
320
321
                $sizeText = ('min' === $validationText) ? 'minlength' : 'maxlength';
322
                if ('number' === $field->htmlType) {
323
                    $sizeText = $validationText;
324
                }
325
326
                if (true === Str::contains($validation, 'required')) {
327
                    $required = ' required';
328
                }
329
330
                $size = " $sizeText=\"$sizeInNumber\"";
331
                $minMaxRules .= $size;
332
            }
333
334
            $this->commandData->addDynamicVariable('$SIZE$', $minMaxRules);
335
336
            $this->commandData->addDynamicVariable('$REQUIRED$', $required);
337
338
            $fieldTemplate = VueFieldGenerator::generateHTML($field, $this->templateType, $localized);
339
340
            if ('selectTable' === $field->htmlType) {
341
                $inputArr = explode(',', $field->htmlValues[1]);
342
                $columns = '';
343
                foreach ($inputArr as $item) {
344
                    $columns .= "'$item'".',';
345
                    //e.g 'email,id,'
346
                }
347
                $columns = substr_replace($columns, '', -1);
348
                // remove last ,
349
350
                $htmlValues = explode(',', $field->htmlValues[0]);
351
                $selectTable = $htmlValues[0];
352
                $modalName = null;
353
                if (2 === count($htmlValues)) {
354
                    $modalName = $htmlValues[1];
355
                }
356
357
                $tableName = $this->commandData->config->tableName;
358
                $vuePath = $this->commandData->config->prefixes['vue'];
359
                if (false === empty($vuePath)) {
360
                    $tableName = $vuePath.'.'.$tableName;
361
                }
362
363
                $variableName = Str::singular($selectTable).'Items';
364
                // e.g $userItems
365
366
                $fieldTemplate = $this->generateVueComposer($tableName, $variableName, $columns, $selectTable, $modalName);
0 ignored issues
show
Bug introduced by
Are you sure the assignment to $fieldTemplate is correct as $this->generateVueCompos...electTable, $modalName) targeting PWWEB\Artomator\Generato...::generateVueComposer() seems to always return null.

This check looks for function or method calls that always return null and whose return value is assigned to a variable.

class A
{
    function getObject()
    {
        return null;
    }

}

$a = new A();
$object = $a->getObject();

The method getObject() can return nothing but null, so it makes no sense to assign that value to a variable.

The reason is most likely that a function or method is imcomplete or has been reduced for debug purposes.

Loading history...
Bug introduced by
It seems like $columns can also be of type string; however, parameter $columns of PWWEB\Artomator\Generato...::generateVueComposer() does only seem to accept array, maybe add an additional type check? ( Ignorable by Annotation )

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

366
                $fieldTemplate = $this->generateVueComposer($tableName, $variableName, /** @scrutinizer ignore-type */ $columns, $selectTable, $modalName);
Loading history...
367
            }
368
369
            if (false === empty($fieldTemplate)) {
370
                $fieldTemplate = fill_template_with_field_data(
371
                    $this->commandData->dynamicVars,
372
                    $this->commandData->fieldNamesMapping,
373
                    $fieldTemplate,
374
                    $field
375
                );
376
                $this->htmlFields[] = $fieldTemplate;
377
                $createForm[] = $field->name.': null,';
378
                $editForm[] = $field->name.': props.$MODEL_NAME_CAMEL$.'.$field->name.',';
379
            }
380
        }
381
382
        $this->commandData->addDynamicVariable('$CREATE_DATA$', implode("\n", $createForm));
383
        $this->commandData->addDynamicVariable('$EDIT_DATA$', implode("\n", $editForm));
384
385
        $templateData = get_artomator_template('scaffold.vues.'.$templateName);
386
        $templateData = fill_template($this->commandData->dynamicVars, $templateData);
387
388
        $templateData = str_replace('$FIELDS$', implode("\n\n", $this->htmlFields), $templateData);
389
390
        FileUtil::createFile($this->path, 'Fields.vue', $templateData);
391
        $this->commandData->commandInfo('field.vue created');
392
    }
393
394
    /**
395
     * Generate Vue Composer.
396
     *
397
     * @param string      $tableName    Table Name.
398
     * @param string      $variableName Variable Name.
399
     * @param array       $columns      Columns.
400
     * @param string      $selectTable  Select Table.
401
     * @param string|null $modelName    Model Name.
402
     *
403
     * @return void
404
     */
405
    private function generateVueComposer($tableName, $variableName, $columns, $selectTable, $modelName = null)
0 ignored issues
show
Unused Code introduced by
The parameter $selectTable is not used and could be removed. ( Ignorable by Annotation )

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

405
    private function generateVueComposer($tableName, $variableName, $columns, /** @scrutinizer ignore-unused */ $selectTable, $modelName = null)

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
Unused Code introduced by
The parameter $columns is not used and could be removed. ( Ignorable by Annotation )

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

405
    private function generateVueComposer($tableName, $variableName, /** @scrutinizer ignore-unused */ $columns, $selectTable, $modelName = null)

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
Unused Code introduced by
The parameter $modelName is not used and could be removed. ( Ignorable by Annotation )

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

405
    private function generateVueComposer($tableName, $variableName, $columns, $selectTable, /** @scrutinizer ignore-unused */ $modelName = null)

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
Unused Code introduced by
The parameter $tableName is not used and could be removed. ( Ignorable by Annotation )

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

405
    private function generateVueComposer(/** @scrutinizer ignore-unused */ $tableName, $variableName, $columns, $selectTable, $modelName = null)

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
406
    {
407
        $templateName = 'scaffold.fields.select';
408
        if (true === $this->commandData->isLocalizedTemplates()) {
409
            $templateName .= '_locale';
410
        }
411
        $fieldTemplate = get_artomator_template($templateName);
412
413
        //TODO: Confirm if this is required still.
414
        // $vueServiceProvider = new ViewServiceProviderGenerator($this->commandData);
415
        // $vueServiceProvider->generate();
416
        // $vueServiceProvider->addViewVariables($tableName.'.fields', $variableName, $columns, $selectTable, $modelName);
417
418
        $fieldTemplate = str_replace(
419
            '$INPUT_ARR$',
420
            $variableName,
421
            $fieldTemplate
422
        );
423
424
        return $fieldTemplate;
0 ignored issues
show
Bug Best Practice introduced by
The expression return $fieldTemplate returns the type string which is incompatible with the documented return type void.
Loading history...
425
    }
426
427
    /**
428
     * Generate Create.
429
     *
430
     * @return void
431
     */
432
    private function generateCreate()
433
    {
434
        $templateName = 'create';
435
436
        if (true === $this->commandData->isLocalizedTemplates()) {
437
            $templateName .= '_locale';
438
        }
439
440
        $templateData = get_artomator_template('scaffold.vues.'.$templateName);
441
442
        $templateData = fill_template($this->commandData->dynamicVars, $templateData);
443
        $templateData = fill_template($this->commandData->dynamicVars, $templateData);
444
445
        FileUtil::createFile($this->path, 'Create.vue', $templateData);
446
        $this->commandData->commandInfo('Create.vue created');
447
    }
448
449
    /**
450
     * Generate Update.
451
     *
452
     * @return void
453
     */
454
    private function generateUpdate()
455
    {
456
        $templateName = 'edit';
457
458
        if (true === $this->commandData->isLocalizedTemplates()) {
459
            $templateName .= '_locale';
460
        }
461
462
        $templateData = get_artomator_template('scaffold.vues.'.$templateName);
463
464
        $templateData = fill_template($this->commandData->dynamicVars, $templateData);
465
        $templateData = fill_template($this->commandData->dynamicVars, $templateData);
466
467
        FileUtil::createFile($this->path, 'Edit.vue', $templateData);
468
        $this->commandData->commandInfo('Edit.vue created');
469
    }
470
471
    /**
472
     * Generate Show Fields.
473
     *
474
     * @return void
475
     */
476
    private function generateShowFields()
477
    {
478
        $templateName = 'show_field';
479
        if (true === $this->commandData->isLocalizedTemplates()) {
480
            $templateName .= '_locale';
481
        }
482
        $fieldTemplate = get_artomator_template('scaffold.vues.'.$templateName);
483
484
        $fieldsStr = '';
485
486
        foreach ($this->commandData->fields as $field) {
487
            if (false === $field->inView) {
488
                continue;
489
            }
490
            $singleFieldStr = str_replace(
491
                '$FIELD_NAME_TITLE$',
492
                Str::title(str_replace('_', ' ', $field->name)),
493
                $fieldTemplate
494
            );
495
            $singleFieldStr = str_replace('$FIELD_NAME$', $field->name, $singleFieldStr);
496
            $singleFieldStr = fill_template($this->commandData->dynamicVars, $singleFieldStr);
497
498
            $fieldsStr .= $singleFieldStr."\n\n";
499
        }
500
        $templateName = 'show_fields';
501
        $fieldTemplate = get_artomator_template('scaffold.vues.'.$templateName);
502
503
        $fieldTemplate = str_replace('$FIELDS$', $fieldsStr, $fieldTemplate);
504
        $fieldTemplate = fill_template($this->commandData->dynamicVars, $fieldTemplate);
505
506
        FileUtil::createFile($this->path, 'ShowFields.vue', $fieldTemplate);
507
        $this->commandData->commandInfo('ShowFields.vue created');
508
    }
509
510
    /**
511
     * Generate Show.
512
     *
513
     * @return void
514
     */
515
    private function generateShow()
516
    {
517
        $templateName = 'show';
518
519
        if (true === $this->commandData->isLocalizedTemplates()) {
520
            $templateName .= '_locale';
521
        }
522
523
        $templateData = get_artomator_template('scaffold.vues.'.$templateName);
524
525
        $templateData = fill_template($this->commandData->dynamicVars, $templateData);
526
527
        FileUtil::createFile($this->path, 'Show.vue', $templateData);
528
        $this->commandData->commandInfo('Show.vue created');
529
    }
530
531
    /**
532
     * Rollback Function.
533
     *
534
     * @param array $vues Vue views to rollback.
535
     *
536
     * @return void
537
     */
538
    public function rollback($vues = [])
539
    {
540
        $files = [
541
            'Table.vue',
542
            'Index.vue',
543
            'Fields.vue',
544
            'Create.vue',
545
            'Edit.vue',
546
            'Show.vue',
547
            'ShowFields.vue',
548
        ];
549
550
        if (false === empty($vues)) {
551
            $files = [];
552
            foreach ($vues as $vue) {
553
                $files[] = $vue.'.vue';
554
            }
555
        }
556
557
        if (true === $this->commandData->getAddOn('datatables')) {
558
            $files[] = 'datatables_actions.blade.php';
559
        }
560
561
        foreach ($files as $file) {
562
            if (true === $this->rollbackFile($this->path, $file)) {
563
                $this->commandData->commandComment($file.' file deleted');
564
            }
565
        }
566
    }
567
}
568