Passed
Push — master ( 6498f8...9717d5 )
by Darko
09:46
created

SetUserTimezone::handle()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 1
c 1
b 0
f 0
dl 0
loc 5
rs 10
cc 1
nc 1
nop 2
1
<?php
2
3
namespace App\Http\Middleware;
4
5
use Closure;
6
use Illuminate\Http\Request;
7
use Symfony\Component\HttpFoundation\Response;
8
9
class SetUserTimezone
10
{
11
    /**
12
     * Handle an incoming request.
13
     *
14
     * Note: We do NOT set the global timezone here because it would interfere
15
     * with database operations and helper functions. Instead, the timezone
16
     * conversion happens in the userDate() and userDateDiffForHumans() helpers.
17
     *
18
     * @param  \Closure(\Illuminate\Http\Request): (\Symfony\Component\HttpFoundation\Response)  $next
19
     */
20
    public function handle(Request $request, Closure $next): Response
21
    {
22
        // Timezone conversion is handled by helper functions, not middleware
23
        // This middleware is kept for future enhancements if needed
24
        return $next($request);
25
    }
26
}
27