fix: Add explicit Request properties and AllowDynamicProperties attribute to eliminate PHP 8.2 deprecation output
This commit is contained in:
@@ -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()
|
||||
{
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user