fix: Add explicit Request properties and AllowDynamicProperties attribute to eliminate PHP 8.2 deprecation output

This commit is contained in:
Hamza-Ayed
2026-08-28 04:01:32 +03:00
parent 01d905f4da
commit d82d5a9ab9
2 changed files with 6 additions and 1 deletions
+5
View File
@@ -5,6 +5,7 @@ namespace App\Core;
/**
* Handles HTTP requests, extracting query params, body data, and headers.
*/
#[\AllowDynamicProperties]
class Request
{
private string $method;
@@ -15,9 +16,13 @@ class Request
// Explicit properties to store authentication details to avoid deprecation warnings in PHP 8.2+
public ?int $user_id = null;
public ?string $uuid = null;
public ?int $company_id = null;
public ?string $role = null;
public bool $is_super_admin = false;
public ?string $phone_number = null;
public ?string $full_name = null;
public ?string $grade_level = null;
public function __construct()
{
+1 -1
View File
@@ -63,7 +63,7 @@ $isDebug = filter_var(getenv('APP_DEBUG'), FILTER_VALIDATE_BOOLEAN);
if ($isDebug) {
ini_set('display_errors', '1');
ini_set('display_startup_errors', '1');
error_reporting(E_ALL);
error_reporting(E_ALL & ~E_DEPRECATED & ~E_USER_DEPRECATED);
} else {
ini_set('display_errors', '0');
error_reporting(0);