Skip to content

Commit f1e56b5

Browse files
rdgoutStyleCIBot
authored andcommitted
Apply fixes from StyleCI
1 parent f34c6c2 commit f1e56b5

5 files changed

+36
-24
lines changed

src/Module.php

+19-14
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,10 @@
1414
use Zonneplan\ModuleLoader\Support\Contracts\ModuleRepositoryContract;
1515

1616
/**
17-
* Class ModuleLoader
17+
* Class ModuleLoader.
1818
*
1919
* The module loader acts as an opinionated ServiceProvider and will automatically try to load migrations,
2020
* views, etc. from a predefined folder structure.
21-
*
22-
* @package Zonneplan\LaravelModuleLoader
2321
*/
2422
abstract class Module extends ServiceProvider implements ModuleContract
2523
{
@@ -41,8 +39,9 @@ abstract class Module extends ServiceProvider implements ModuleContract
4139
/**
4240
* Register the module.
4341
*
44-
* @return void
4542
* @throws ReflectionException
43+
*
44+
* @return void
4645
*/
4746
public function register(): void
4847
{
@@ -55,8 +54,9 @@ public function register(): void
5554
/**
5655
* Boot the module.
5756
*
58-
* @return void
5957
* @throws ReflectionException
58+
*
59+
* @return void
6060
*/
6161
public function boot(): void
6262
{
@@ -84,8 +84,9 @@ protected function loadCommandSchedule(): void
8484
}
8585

8686
/**
87-
* @return void
8887
* @throws ReflectionException
88+
*
89+
* @return void
8990
*/
9091
protected function loadMigrations(): void
9192
{
@@ -97,8 +98,9 @@ protected function loadMigrations(): void
9798
}
9899

99100
/**
100-
* @return void
101101
* @throws ReflectionException
102+
*
103+
* @return void
102104
*/
103105
protected function loadViews(): void
104106
{
@@ -110,8 +112,9 @@ protected function loadViews(): void
110112
}
111113

112114
/**
113-
* @return void
114115
* @throws ReflectionException
116+
*
117+
* @return void
115118
*/
116119
protected function loadTranslations(): void
117120
{
@@ -123,8 +126,9 @@ protected function loadTranslations(): void
123126
}
124127

125128
/**
126-
* @return void
127129
* @throws ReflectionException
130+
*
131+
* @return void
128132
*/
129133
protected function loadConfigs(): void
130134
{
@@ -169,8 +173,9 @@ protected function registerListeners(): void
169173
}
170174

171175
/**
172-
* @return string
173176
* @throws ReflectionException
177+
*
178+
* @return string
174179
*/
175180
protected function getModulePath(): string
176181
{
@@ -203,7 +208,7 @@ protected function scheduleCommands(Schedule $schedule): void
203208
}
204209

205210
/**
206-
* Registers the commands of the schedule
211+
* Registers the commands of the schedule.
207212
*
208213
* @return void
209214
*/
@@ -213,7 +218,7 @@ private function registerCommands(): void
213218
}
214219

215220
/**
216-
* Registers middleware
221+
* Registers middleware.
217222
*
218223
* @return void
219224
*/
@@ -228,14 +233,14 @@ private function registerMiddleware(): void
228233
}
229234

230235
/**
231-
* Registers factories
236+
* Registers factories.
232237
*
233238
* @return void
234239
*/
235240
private function registerFactories(): void
236241
{
237242
$this->app->afterResolving(Factory::class, function (Factory $faker) {
238-
$faker->load($this->getModulePath() . '/Database/Factories');
243+
$faker->load($this->getModulePath().'/Database/Factories');
239244
});
240245
}
241246

src/ModulesServiceProvider.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
class ModulesServiceProvider extends ServiceProvider
1212
{
1313
/**
14-
* Register services
14+
* Register services.
1515
*
1616
* @return void
1717
*/
@@ -29,7 +29,7 @@ public function register(): void
2929
*/
3030
public function boot(): void
3131
{
32-
$loader = new ModuleRouteLoader;
32+
$loader = new ModuleRouteLoader();
3333

3434
Router::macro('module', function (string $name, ?string $type = 'routes') use ($loader) {
3535
$loader->load($name, $type);

src/Support/ModuleRepository.php

+7-5
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ class ModuleRepository implements ModuleRepositoryContract
1616
protected $modules = [];
1717

1818
/**
19-
* Registers a new module with a path
19+
* Registers a new module with a path.
2020
*
2121
* @param string $module
2222
* @param string $path
@@ -31,7 +31,7 @@ public function register(string $module, string $path): self
3131
}
3232

3333
/**
34-
* Returns a list of all loaded modules
34+
* Returns a list of all loaded modules.
3535
*
3636
* @return array
3737
*/
@@ -41,7 +41,7 @@ public function getAll(): array
4141
}
4242

4343
/**
44-
* Check if the module is loaded
44+
* Check if the module is loaded.
4545
*
4646
* @param string $module
4747
*
@@ -53,11 +53,13 @@ public function isLoaded(string $module): bool
5353
}
5454

5555
/**
56-
* Retrieves the path from the module
56+
* Retrieves the path from the module.
5757
*
5858
* @param string $module
59-
* @return string
59+
*
6060
* @throws ModuleNotFoundException
61+
*
62+
* @return string
6163
*/
6264
public function get(string $module): string
6365
{

src/Support/ModuleRouteLoader.php

+7-3
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,12 @@ class ModuleRouteLoader
1010
private const FALLBACK_ROUTE_TYPE = 'routes';
1111

1212
private const ROUTE_TYPES = [
13-
self::FALLBACK_ROUTE_TYPE, 'api', 'channels', 'console', 'web'
13+
self::FALLBACK_ROUTE_TYPE, 'api', 'channels', 'console', 'web',
1414
];
1515

1616
/**
1717
* @param string $type
18+
*
1819
* @return void
1920
*/
2021
public function loadAll(string $type): void
@@ -27,8 +28,10 @@ public function loadAll(string $type): void
2728
/**
2829
* @param string $moduleName
2930
* @param string $type
30-
* @return void
31+
*
3132
* @throws ModuleNotFoundException
33+
*
34+
* @return void
3235
*/
3336
public function load(string $moduleName, string $type): void
3437
{
@@ -40,6 +43,7 @@ public function load(string $moduleName, string $type): void
4043
*
4144
* @param string $path
4245
* @param string $type
46+
*
4347
* @return void
4448
*/
4549
protected function loadRoutes(string $path, string $type): void
@@ -48,7 +52,7 @@ protected function loadRoutes(string $path, string $type): void
4852
return;
4953
}
5054

51-
$file = $type === self::FALLBACK_ROUTE_TYPE
55+
$file = $type === self::FALLBACK_ROUTE_TYPE
5256
? "{$path}/{$type}.php"
5357
: "{$path}/Routes/{$type}.php";
5458

tests/TestCase.php

+1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ protected function getPackageProviders($app)
1919
ModulesServiceProvider::class,
2020
];
2121
}
22+
2223
protected function getPackageAliases($app)
2324
{
2425
return [

0 commit comments

Comments
 (0)