@@ -47,8 +47,8 @@ class MakeCommand extends Command
47
47
*
48
48
* @var string
49
49
*/
50
- protected $ description = 'Generate a Laravel Livewire datatable class and view ' ;
51
-
50
+ protected $ description = 'Generate a Laravel Livewire datatable class and view. ' ;
51
+
52
52
public function handle (): void
53
53
{
54
54
$ this ->parser = new ComponentParser (
@@ -74,7 +74,7 @@ public function handle(): void
74
74
}
75
75
76
76
/**
77
- * @param false $force
77
+ * @param bool $force
78
78
*
79
79
* @return false
80
80
*/
@@ -96,11 +96,11 @@ protected function createClass(bool $force = false)
96
96
}
97
97
98
98
/**
99
- * @param false $force
99
+ * @param bool $force
100
100
*
101
101
* @return false|string|null
102
102
*/
103
- protected function createView ($ force = false )
103
+ protected function createView (bool $ force = false )
104
104
{
105
105
if (! $ this ->option ('view ' )) {
106
106
return null ;
@@ -139,16 +139,16 @@ public function classContents(): string
139
139
if ($ this ->model ) {
140
140
$ template = file_get_contents (__DIR__ .DIRECTORY_SEPARATOR .'table-with-model.stub ' );
141
141
142
- $ contents = preg_replace_array (
143
- ['/\ [namespace\]/ ' , '/\ [class\]/ ' , '/\ [model\]/ ' , '/\ [model_import\]/ ' ],
142
+ $ contents = str_replace (
143
+ ['[namespace] ' , '[class] ' , '[model] ' , '[model_import] ' ],
144
144
[$ this ->parser ->classNamespace (), $ this ->parser ->className (), $ this ->model , $ this ->getModelImport ()],
145
145
$ template
146
146
);
147
147
} else {
148
148
$ template = file_get_contents (__DIR__ .DIRECTORY_SEPARATOR .'table.stub ' );
149
149
150
- $ contents = preg_replace_array (
151
- ['/\ [namespace\]/ ' , '/\ [class\]/ ' ],
150
+ $ contents = str_replace (
151
+ ['[namespace] ' , '[class] ' ],
152
152
[$ this ->parser ->classNamespace (), $ this ->parser ->className ()],
153
153
$ template
154
154
);
0 commit comments