APETYPE/practice
php·passage intermediate
Desktop Required to Type
Desktop Recommended for Code Typing
ApeType code transcription is engineered for physical mechanical and laptop keyboards with syntax navigation. Mobile on-screen keyboards cannot provide authentic typing cadence.
You can see the leaderboard hereTop Typists
view all1/ 17
1
<?php↵
2
↵
3
namespace App\Middleware;↵
4
↵
5
class AuthTokenMiddleware {↵
6
public function handle(array $request, callable $next): array {↵
7
$header = $request['headers']['Authorization'] ?? '';↵
8
if (!str_starts_with($header, 'Bearer ')) {↵
9
return ['status' => 401, 'error' => 'Unauthorized'];↵
10
}↵
11
$token = substr($header, 7);↵
12
if (strlen($token) < 16) {↵
13
return ['status' => 403, 'error' => 'Invalid Token'];↵
14
}↵
15
return $next($request);↵
16
}↵
17
}
tab+enter- restart
esc- restart