1 | <?php |
||||
2 | |||||
3 | namespace Ikechukwukalu\Dynamicdatabaseconfig\Middleware; |
||||
4 | |||||
5 | use Closure; |
||||
6 | use Illuminate\Http\Request; |
||||
7 | use Ikechukwukalu\Dynamicdatabaseconfig\Trait\DatabaseConfig; |
||||
8 | |||||
9 | class EnvDatabaseConfig |
||||
10 | { |
||||
11 | use DatabaseConfig; |
||||
0 ignored issues
–
show
introduced
by
![]() |
|||||
12 | |||||
13 | public function handle(Request $request, Closure $next, string $database, string $name, null|string $postFix = null) |
||||
14 | { |
||||
15 | $request->merge([config('dynamicdatabaseconfig.connection_name', '_db_connection') => $name]); |
||||
16 | |||||
17 | if (!$postFix) { |
||||
18 | $postFix = session(config('dynamicdatabaseconfig.session_postfix')); |
||||
19 | } |
||||
20 | |||||
21 | $newConfig = $this->setNewEnvConfig($database, $postFix); |
||||
0 ignored issues
–
show
It seems like
$postFix can also be of type Illuminate\Session\SessionManager and Illuminate\Session\Store ; however, parameter $postFix of Ikechukwukalu\Dynamicdat...nfig::setNewEnvConfig() does only seem to accept string , maybe add an additional type check?
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
![]() |
|||||
22 | $this->addNewConfig($database, $name, $newConfig); |
||||
23 | $this->createDatabase($database, $newConfig['database']); |
||||
24 | |||||
25 | return $next($request); |
||||
26 | } |
||||
27 | |||||
28 | } |
||||
29 |