Skip to content

Commit f31a82a

Browse files
coolsam726github-actions[bot]
authored andcommitted
Fix styling
1 parent eabc1e6 commit f31a82a

File tree

2 files changed

+11
-8
lines changed

2 files changed

+11
-8
lines changed

src/Concerns/GeneratesModularFiles.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,15 +47,17 @@ protected function getPath($name): string
4747
$appFolder = trim(config('modules.paths.app_folder', 'app/'), '/\\');
4848
$rootNamespace = str($this->rootNamespace())->trim('\\')->toString();
4949
$name = Str::replaceFirst($rootNamespace, $appFolder, $name);
50+
5051
return $this->getModule()->getExtraPath(str_replace('\\', DIRECTORY_SEPARATOR, $name) . '.php');
5152
}
5253

5354
protected function possibleModels()
5455
{
55-
$appFolder =trim(config('modules.paths.app_folder', 'app/'), '/\\');
56+
$appFolder = trim(config('modules.paths.app_folder', 'app/'), '/\\');
5657
$modelPath = str(config('modules.paths.model_folder', 'app/Models'))
57-
->replaceFirst($appFolder, '')->replace(DIRECTORY_SEPARATOR.DIRECTORY_SEPARATOR, DIRECTORY_SEPARATOR)->trim(DIRECTORY_SEPARATOR)->toString();
58+
->replaceFirst($appFolder, '')->replace(DIRECTORY_SEPARATOR . DIRECTORY_SEPARATOR, DIRECTORY_SEPARATOR)->trim(DIRECTORY_SEPARATOR)->toString();
5859
$modelPath = $this->getModule()->appPath($modelPath);
60+
5961
return collect(Finder::create()->files()->depth(0)->in($modelPath))
6062
->map(fn ($file) => $file->getBasename('.php'))
6163
->sort()

src/ModulesServiceProvider.php

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,7 @@ protected function registerModuleMacros(): void
211211
$base = trim($this->app['config']->get('modules.namespace', 'Modules'), '\\');
212212
$relativeNamespace = trim($relativeNamespace, '\\');
213213
$studlyName = $this->getStudlyName();
214+
214215
return str($base)->append('\\')->append($studlyName)->append('\\')->append($relativeNamespace)->replace('\\\\', '\\')->toString();
215216
});
216217

@@ -231,39 +232,39 @@ protected function registerModuleMacros(): void
231232
Module::macro('appPath', function (string $relativePath = '') {
232233
$appPath = $this->getExtraPath(config('modules.paths.app_folder', 'app'));
233234

234-
return str($appPath . ($relativePath ? DIRECTORY_SEPARATOR . $relativePath : ''))->replace(DIRECTORY_SEPARATOR.DIRECTORY_SEPARATOR, DIRECTORY_SEPARATOR)->toString();
235+
return str($appPath . ($relativePath ? DIRECTORY_SEPARATOR . $relativePath : ''))->replace(DIRECTORY_SEPARATOR . DIRECTORY_SEPARATOR, DIRECTORY_SEPARATOR)->toString();
235236
});
236237

237238
Module::macro('databasePath', function (string $relativePath = '') {
238239
$appPath = $this->getExtraPath('database');
239240

240-
return str($appPath . ($relativePath ? DIRECTORY_SEPARATOR . $relativePath : ''))->replace(DIRECTORY_SEPARATOR.DIRECTORY_SEPARATOR, DIRECTORY_SEPARATOR)->toString();
241+
return str($appPath . ($relativePath ? DIRECTORY_SEPARATOR . $relativePath : ''))->replace(DIRECTORY_SEPARATOR . DIRECTORY_SEPARATOR, DIRECTORY_SEPARATOR)->toString();
241242
});
242243

243244
Module::macro('resourcesPath', function (string $relativePath = '') {
244245
$appPath = $this->getExtraPath('resources');
245246

246247
return str($appPath . ($relativePath ? DIRECTORY_SEPARATOR . $relativePath : ''))
247-
->replace(DIRECTORY_SEPARATOR.DIRECTORY_SEPARATOR, DIRECTORY_SEPARATOR)->toString();
248+
->replace(DIRECTORY_SEPARATOR . DIRECTORY_SEPARATOR, DIRECTORY_SEPARATOR)->toString();
248249
});
249250

250251
Module::macro('migrationsPath', function (string $relativePath = '') {
251252
$appPath = $this->databasePath('migrations');
252253

253254
return str($appPath . ($relativePath ? DIRECTORY_SEPARATOR . $relativePath : ''))
254-
->replace(DIRECTORY_SEPARATOR.DIRECTORY_SEPARATOR, DIRECTORY_SEPARATOR)->toString();
255+
->replace(DIRECTORY_SEPARATOR . DIRECTORY_SEPARATOR, DIRECTORY_SEPARATOR)->toString();
255256
});
256257

257258
Module::macro('seedersPath', function (string $relativePath = '') {
258259
$appPath = $this->databasePath('seeders');
259260

260-
return str($appPath . ($relativePath ? DIRECTORY_SEPARATOR . $relativePath : ''))->replace(DIRECTORY_SEPARATOR.DIRECTORY_SEPARATOR, DIRECTORY_SEPARATOR)->toString();
261+
return str($appPath . ($relativePath ? DIRECTORY_SEPARATOR . $relativePath : ''))->replace(DIRECTORY_SEPARATOR . DIRECTORY_SEPARATOR, DIRECTORY_SEPARATOR)->toString();
261262
});
262263

263264
Module::macro('factoriesPath', function (string $relativePath = '') {
264265
$appPath = $this->databasePath('factories');
265266

266-
return str($appPath . ($relativePath ? DIRECTORY_SEPARATOR . $relativePath : ''))->replace(DIRECTORY_SEPARATOR.DIRECTORY_SEPARATOR, DIRECTORY_SEPARATOR)->toString();
267+
return str($appPath . ($relativePath ? DIRECTORY_SEPARATOR . $relativePath : ''))->replace(DIRECTORY_SEPARATOR . DIRECTORY_SEPARATOR, DIRECTORY_SEPARATOR)->toString();
267268
});
268269
}
269270
}

0 commit comments

Comments
 (0)