@@ -61,6 +61,9 @@ |
||
61 | 61 | }); |
62 | 62 | } |
63 | 63 | |
64 | + /** |
|
65 | + * @param string $componentClassPath |
|
66 | + */ |
|
64 | 67 | protected function getComponentName($componentClassPath, $module = null) |
65 | 68 | { |
66 | 69 | $dirs = explode('\\', $componentClassPath); |
@@ -71,6 +71,6 @@ |
||
71 | 71 | |
72 | 72 | $moduleNamePrefix = ($module) ? $module->getLowerName().'::' : null; |
73 | 73 | |
74 | - return $moduleNamePrefix . $componentName; |
|
74 | + return $moduleNamePrefix . $componentName; |
|
75 | 75 | } |
76 | 76 | } |
77 | 77 | \ No newline at end of file |
@@ -30,7 +30,7 @@ discard block |
||
30 | 30 | |
31 | 31 | protected function loadComponents() |
32 | 32 | { |
33 | - if (! class_exists('Livewire')) return false; |
|
33 | + if (!class_exists('Livewire')) return false; |
|
34 | 34 | |
35 | 35 | $modules = \Module::toCollection(); |
36 | 36 | |
@@ -38,21 +38,21 @@ discard block |
||
38 | 38 | |
39 | 39 | $filesystem = new Filesystem(); |
40 | 40 | |
41 | - $modules->map(function ($module) use ($filesystem, $defaultNamespace) { |
|
41 | + $modules->map(function($module) use ($filesystem, $defaultNamespace) { |
|
42 | 42 | $modulePath = $module->getPath(); |
43 | 43 | |
44 | - $path = $modulePath. '/'. strtr($defaultNamespace, ['\\' => '/']); |
|
44 | + $path = $modulePath.'/'.strtr($defaultNamespace, ['\\' => '/']); |
|
45 | 45 | |
46 | - $files = collect( $filesystem->isDirectory($path) ? $filesystem->allFiles($path) : [] ); |
|
46 | + $files = collect($filesystem->isDirectory($path) ? $filesystem->allFiles($path) : []); |
|
47 | 47 | |
48 | - $files->map(function ($file) use ($module, $path, $defaultNamespace) { |
|
48 | + $files->map(function($file) use ($module, $path, $defaultNamespace) { |
|
49 | 49 | $componentPath = \Str::after($file->getPathname(), $path.'/'); |
50 | 50 | |
51 | - $componentClassPath = strtr( $componentPath , ['/' => '\\', '.php' => '']); |
|
51 | + $componentClassPath = strtr($componentPath, ['/' => '\\', '.php' => '']); |
|
52 | 52 | |
53 | 53 | $componentName = $this->getComponentName($componentClassPath, $module); |
54 | 54 | |
55 | - $componentClassStr = '\\' . config('modules.namespace') . '\\' . $module->getName() . '\\' . $defaultNamespace . '\\' . $componentClassPath; |
|
55 | + $componentClassStr = '\\'.config('modules.namespace').'\\'.$module->getName().'\\'.$defaultNamespace.'\\'.$componentClassPath; |
|
56 | 56 | |
57 | 57 | $componentClass = get_class(new $componentClassStr); |
58 | 58 | |
@@ -71,6 +71,6 @@ discard block |
||
71 | 71 | |
72 | 72 | $moduleNamePrefix = ($module) ? $module->getLowerName().'::' : null; |
73 | 73 | |
74 | - return $moduleNamePrefix . $componentName; |
|
74 | + return $moduleNamePrefix.$componentName; |
|
75 | 75 | } |
76 | 76 | } |
77 | 77 | \ No newline at end of file |
@@ -30,7 +30,9 @@ |
||
30 | 30 | |
31 | 31 | protected function loadComponents() |
32 | 32 | { |
33 | - if (! class_exists('Livewire')) return false; |
|
33 | + if (! class_exists('Livewire')) { |
|
34 | + return false; |
|
35 | + } |
|
34 | 36 | |
35 | 37 | $modules = \Module::toCollection(); |
36 | 38 |
@@ -36,7 +36,7 @@ |
||
36 | 36 | */ |
37 | 37 | public function handle() |
38 | 38 | { |
39 | - if (! class_exists('Livewire')) { |
|
39 | + if (!class_exists('Livewire')) { |
|
40 | 40 | $this->line("\n<options=bold,reverse;fg=red> WHOOPS! </> |
@@ -124,7 +124,9 @@ discard block |
||
124 | 124 | ->map([\Str::class, 'kebab']) |
125 | 125 | ->implode('/'); |
126 | 126 | |
127 | - if ($this->option('view')) $path = strtr($this->option('view'), ['.' => '/']); |
|
127 | + if ($this->option('view')) { |
|
128 | + $path = strtr($this->option('view'), ['.' => '/']); |
|
129 | + } |
|
128 | 130 | |
129 | 131 | $name = strtr($path, ['/' => '.']); |
130 | 132 | |
@@ -168,7 +170,9 @@ discard block |
||
168 | 170 | |
169 | 171 | protected function createView($force = false, $inline = false) |
170 | 172 | { |
171 | - if ($inline) return false; |
|
173 | + if ($inline) { |
|
174 | + return false; |
|
175 | + } |
|
172 | 176 | |
173 | 177 | $viewPath = $this->component->view->file; |
174 | 178 |