Skip to content

Commit f61a6d3

Browse files
authored
Merge pull request #5 from zonneplan/release/1.3.0
Drop support for old Laravel versions
2 parents 1dcbf57 + 769b4f4 commit f61a6d3

File tree

3 files changed

+20
-39
lines changed

3 files changed

+20
-39
lines changed

composer.json

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,16 @@
1212
"license": "MIT",
1313
"authors": [],
1414
"require": {
15-
"php": "^7.2.5",
16-
"illuminate/console": "^6.0|^7.0|^8.0",
17-
"illuminate/database": "^6.0|^7.0|^8.0",
18-
"illuminate/support": "^6.0|^7.0|^8.0",
19-
"illuminate/routing": "^6.0|^7.0|^8.0"
15+
"php": "^7.4|^8.0",
16+
"illuminate/console": "^8.0",
17+
"illuminate/database": "^8.0",
18+
"illuminate/support": "^8.0",
19+
"illuminate/routing": "^8.0"
2020
},
2121
"require-dev": {
22-
"phpunit/phpunit" : "^8.0",
23-
"mockery/mockery": "^1.0",
24-
"orchestra/testbench": "^4.0"
22+
"phpunit/phpunit": "^9.5",
23+
"mockery/mockery": "^1.4",
24+
"orchestra/testbench": "^6.0"
2525
},
2626
"autoload": {
2727
"psr-4": {

src/Module.php

Lines changed: 11 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
namespace Zonneplan\ModuleLoader;
44

55
use Illuminate\Console\Scheduling\Schedule;
6-
use Illuminate\Database\Eloquent\Factory;
76
use Illuminate\Routing\Router;
87
use Illuminate\Support\Facades\Event;
98
use Illuminate\Support\Facades\Gate;
@@ -22,29 +21,24 @@
2221
abstract class Module extends ServiceProvider implements ModuleContract
2322
{
2423
protected const ROUTE_FILE_TYPES = [
25-
'routes', 'web', 'api',
24+
'routes',
25+
'web',
26+
'api',
2627
];
2728

28-
/** @var array */
29-
protected $policies = [];
29+
protected array $policies = [];
3030

31-
/** @var array */
32-
protected $middleware = [];
31+
protected array $middleware = [];
3332

34-
/** @var array */
35-
protected $listen = [];
33+
protected array $listen = [];
3634

37-
/** @var array */
38-
protected $subscribe = [];
35+
protected array $subscribe = [];
3936

40-
/** @var string */
41-
protected $modulePath;
37+
protected string $modulePath;
4238

4339
/**
4440
* Register the module.
4541
*
46-
* @throws ReflectionException
47-
*
4842
* @return void
4943
*/
5044
public function register(): void
@@ -56,9 +50,8 @@ public function register(): void
5650
/**
5751
* Boot the module.
5852
*
59-
* @throws ReflectionException
60-
*
6153
* @return void
54+
* @throws ReflectionException
6255
*/
6356
public function boot(): void
6457
{
@@ -91,8 +84,6 @@ protected function loadCommandSchedule(): void
9184
}
9285

9386
/**
94-
* @throws ReflectionException
95-
*
9687
* @return void
9788
*/
9889
protected function loadMigrations(): void
@@ -105,8 +96,6 @@ protected function loadMigrations(): void
10596
}
10697

10798
/**
108-
* @throws ReflectionException
109-
*
11099
* @return void
111100
*/
112101
protected function loadViews(): void
@@ -119,8 +108,6 @@ protected function loadViews(): void
119108
}
120109

121110
/**
122-
* @throws ReflectionException
123-
*
124111
* @return void
125112
*/
126113
protected function loadTranslations(): void
@@ -133,8 +120,6 @@ protected function loadTranslations(): void
133120
}
134121

135122
/**
136-
* @throws ReflectionException
137-
*
138123
* @return void
139124
*/
140125
protected function loadConfigs(): void
@@ -180,8 +165,6 @@ protected function registerListeners(): void
180165
}
181166

182167
/**
183-
* @throws ReflectionException
184-
*
185168
* @return string
186169
*/
187170
protected function getModulePath(): string
@@ -246,9 +229,8 @@ private function registerMiddleware(): void
246229
*/
247230
private function registerFactories(): void
248231
{
249-
$this->app->afterResolving(Factory::class, function (Factory $faker) {
250-
$faker->load($this->getModulePath().'/Database/Factories');
251-
});
232+
// Unfortunately Laravel 8 no longer supports loading factories like this
233+
// because they want you to use ModelFactories.
252234
}
253235

254236
private function registerRoutes(): void

src/Support/ModuleRepository.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,7 @@
1212
*/
1313
class ModuleRepository implements ModuleRepositoryContract
1414
{
15-
/** @var array */
16-
protected $modules = [];
15+
protected array $modules = [];
1716

1817
/**
1918
* Registers a new module with a path.

0 commit comments

Comments
 (0)