@@ -171,7 +171,7 @@ private function generateFile(string $target, string $content): void
171
171
CLI ::prompt (
172
172
'Are you sure you want to continue? ' ,
173
173
['y ' , 'n ' ],
174
- 'required '
174
+ 'required ' ,
175
175
) === 'n '
176
176
) {
177
177
CLI ::newLine ();
@@ -193,7 +193,7 @@ private function generateFile(string $target, string $content): void
193
193
CLI ::error (
194
194
lang ('CLI.generator.fileExist ' , [clean_path ($ target )]),
195
195
'light_gray ' ,
196
- 'red '
196
+ 'red ' ,
197
197
);
198
198
CLI ::newLine ();
199
199
@@ -216,7 +216,7 @@ private function generateFile(string $target, string $content): void
216
216
CLI ::error (
217
217
lang ('CLI.generator.fileError ' , [clean_path ($ target )]),
218
218
'light_gray ' ,
219
- 'red '
219
+ 'red ' ,
220
220
);
221
221
CLI ::newLine ();
222
222
@@ -227,7 +227,7 @@ private function generateFile(string $target, string $content): void
227
227
if ($ this ->getOption ('force ' ) && $ isFile ) {
228
228
CLI ::write (
229
229
lang ('CLI.generator.fileOverwrite ' , [clean_path ($ target )]),
230
- 'yellow '
230
+ 'yellow ' ,
231
231
);
232
232
CLI ::newLine ();
233
233
@@ -236,7 +236,7 @@ private function generateFile(string $target, string $content): void
236
236
237
237
CLI ::write (
238
238
lang ('CLI.generator.fileCreate ' , [clean_path ($ target )]),
239
- 'green '
239
+ 'green ' ,
240
240
);
241
241
CLI ::newLine ();
242
242
}
@@ -326,10 +326,10 @@ private function normalizeInputClassName(): string
326
326
'\\' ,
327
327
array_map (
328
328
pascalize (...),
329
- explode ('\\' , str_replace ('/ ' , '\\' , trim ($ class )))
330
- )
329
+ explode ('\\' , str_replace ('/ ' , '\\' , trim ($ class ))),
330
+ ),
331
331
),
332
- '\\/ '
332
+ '\\/ ' ,
333
333
);
334
334
}
335
335
@@ -351,7 +351,7 @@ protected function renderTemplate(array $data = []): string
351
351
return view (
352
352
"CodeIgniter \\Commands \\Generators \\Views \\{$ this ->template }" ,
353
353
$ data ,
354
- ['debug ' => false ]
354
+ ['debug ' => false ],
355
355
);
356
356
}
357
357
}
@@ -370,15 +370,15 @@ protected function parseTemplate(
370
370
string $ class ,
371
371
array $ search = [],
372
372
array $ replace = [],
373
- array $ data = []
373
+ array $ data = [],
374
374
): string {
375
375
// Retrieves the namespace part from the fully qualified class name.
376
376
$ namespace = trim (
377
377
implode (
378
378
'\\' ,
379
- array_slice (explode ('\\' , $ class ), 0 , -1 )
379
+ array_slice (explode ('\\' , $ class ), 0 , -1 ),
380
380
),
381
- '\\'
381
+ '\\' ,
382
382
);
383
383
$ search [] = '<@php ' ;
384
384
$ search [] = '{namespace} ' ;
@@ -404,7 +404,7 @@ protected function buildContent(string $class): string
404
404
&& preg_match (
405
405
'/(?P<imports>(?:^use [^;]+;$\n?)+)/m ' ,
406
406
$ template ,
407
- $ match
407
+ $ match,
408
408
)
409
409
) {
410
410
$ imports = explode ("\n" , trim ($ match ['imports ' ]));
@@ -432,7 +432,7 @@ protected function buildPath(string $class): string
432
432
CLI ::error (
433
433
lang ('CLI.namespaceNotDefined ' , [$ namespace ]),
434
434
'light_gray ' ,
435
- 'red '
435
+ 'red ' ,
436
436
);
437
437
CLI ::newLine ();
438
438
@@ -446,16 +446,16 @@ protected function buildPath(string $class): string
446
446
. str_replace (
447
447
'\\' ,
448
448
DIRECTORY_SEPARATOR ,
449
- trim (str_replace ($ namespace . '\\' , '' , $ class ), '\\' )
449
+ trim (str_replace ($ namespace . '\\' , '' , $ class ), '\\' ),
450
450
) . '.php ' ;
451
451
452
452
return implode (
453
453
DIRECTORY_SEPARATOR ,
454
454
array_slice (
455
455
explode (DIRECTORY_SEPARATOR , $ file ),
456
456
0 ,
457
- -1
458
- )
457
+ -1 ,
458
+ ),
459
459
) . DIRECTORY_SEPARATOR . $ this ->basename ($ file );
460
460
}
461
461
@@ -470,9 +470,9 @@ protected function getNamespace(): string
470
470
str_replace (
471
471
'/ ' ,
472
472
'\\' ,
473
- $ this ->getOption ('namespace ' ) ?? APP_NAMESPACE
473
+ $ this ->getOption ('namespace ' ) ?? APP_NAMESPACE ,
474
474
),
475
- '\\'
475
+ '\\' ,
476
476
);
477
477
}
478
478
0 commit comments