Fix PHP-ALIAS-01 rule and resolve all fetch() aliasing violations
🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -103,9 +103,9 @@ class FieldAliasing_CodeQualityRule extends CodeQualityRule_Abstract
|
||||
}
|
||||
|
||||
// Only check models - controllers are an escape hatch for custom responses
|
||||
$extends = $metadata['extends'] ?? null;
|
||||
$class_name = $metadata['class'] ?? null;
|
||||
|
||||
if ($extends !== 'Rsx_Model_Abstract') {
|
||||
if (!$class_name || !\App\RSpade\Core\Manifest\Manifest::php_is_subclass_of($class_name, 'Rsx_Model_Abstract')) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -176,20 +176,30 @@ class FieldAliasing_CodeQualityRule extends CodeQualityRule_Abstract
|
||||
continue;
|
||||
}
|
||||
|
||||
// Pattern: 'key' => ...
|
||||
// Pattern: 'key' => ... (array construction) OR $data['key'] = ... (element assignment)
|
||||
// We need to analyze what's on the right side
|
||||
if (!preg_match("/['\"]([a-zA-Z_][a-zA-Z0-9_]*)['\"]\\s*=>/", $line, $key_match)) {
|
||||
continue;
|
||||
}
|
||||
$key = null;
|
||||
$value_part = null;
|
||||
|
||||
// Array construction: 'key' => value
|
||||
if (preg_match("/['\"]([a-zA-Z_][a-zA-Z0-9_]*)['\"]\\s*=>/", $line, $key_match)) {
|
||||
$key = $key_match[1];
|
||||
|
||||
// Get the value part (everything after =>)
|
||||
$arrow_pos = strpos($line, '=>');
|
||||
if ($arrow_pos === false) {
|
||||
$value_part = trim(substr($line, $arrow_pos + 2));
|
||||
}
|
||||
// Element assignment: $data['key'] = value
|
||||
elseif (preg_match("/\\$[a-zA-Z_][a-zA-Z0-9_]*\\[['\"]([a-zA-Z_][a-zA-Z0-9_]*)['\"]\\]\\s*=/", $line, $key_match)) {
|
||||
$key = $key_match[1];
|
||||
// Find the = that's NOT part of => or ==
|
||||
if (preg_match("/\\]\\s*=(?![>=])/", $line, $eq_match, PREG_OFFSET_CAPTURE)) {
|
||||
$eq_pos = $eq_match[0][1] + strlen($eq_match[0][0]) - 1;
|
||||
$value_part = trim(substr($line, $eq_pos + 1));
|
||||
}
|
||||
}
|
||||
|
||||
if ($key === null || $value_part === null) {
|
||||
continue;
|
||||
}
|
||||
$value_part = trim(substr($line, $arrow_pos + 2));
|
||||
|
||||
// Check for ternary operator
|
||||
if ($this->is_ternary_expression($value_part)) {
|
||||
|
||||
@@ -87,7 +87,6 @@ class Migrate_Begin_Command extends Command
|
||||
// Step 4: Start MySQL again using supervisorctl
|
||||
$this->info('[4] Starting MySQL server...');
|
||||
$this->shell_exec_privileged('mkdir -p /var/run/mysqld');
|
||||
$this->shell_exec_privileged('chmod 777 /var/run/mysqld');
|
||||
$this->shell_exec_privileged('supervisorctl start mysql 2>&1');
|
||||
|
||||
// Step 5: Wait for MySQL to be ready
|
||||
|
||||
@@ -66,7 +66,6 @@ class Migrate_Rollback_Command extends Command
|
||||
// Step 5: Start MySQL using supervisorctl
|
||||
$this->info('[5] Starting MySQL server...');
|
||||
$this->shell_exec_privileged('mkdir -p /var/run/mysqld');
|
||||
$this->shell_exec_privileged('chmod 777 /var/run/mysqld');
|
||||
$this->shell_exec_privileged('supervisorctl start mysql 2>&1');
|
||||
|
||||
// Step 6: Wait for MySQL to be ready
|
||||
|
||||
@@ -33,7 +33,7 @@ use App\RSpade\Core\Models\User_Model;
|
||||
*/
|
||||
/**
|
||||
* _AUTO_GENERATED_ Database type hints - do not edit manually
|
||||
* Generated on: 2025-12-26 01:29:30
|
||||
* Generated on: 2025-12-26 02:43:29
|
||||
* Table: _api_keys
|
||||
*
|
||||
* @property int $id
|
||||
|
||||
@@ -32,7 +32,7 @@ use App\RSpade\Core\Files\File_Storage_Model;
|
||||
|
||||
/**
|
||||
* _AUTO_GENERATED_ Database type hints - do not edit manually
|
||||
* Generated on: 2025-12-26 01:29:30
|
||||
* Generated on: 2025-12-26 02:43:29
|
||||
* Table: _file_attachments
|
||||
*
|
||||
* @property int $id
|
||||
@@ -82,7 +82,6 @@ class File_Attachment_Model extends Rsx_Site_Model_Abstract
|
||||
const FILE_TYPE_DOCUMENT = 6;
|
||||
const FILE_TYPE_OTHER = 7;
|
||||
|
||||
|
||||
/** __AUTO_GENERATED: */
|
||||
|
||||
/** __/AUTO_GENERATED */
|
||||
|
||||
@@ -16,7 +16,7 @@ use App\RSpade\Core\Database\Models\Rsx_Model_Abstract;
|
||||
|
||||
/**
|
||||
* _AUTO_GENERATED_ Database type hints - do not edit manually
|
||||
* Generated on: 2025-12-26 01:29:30
|
||||
* Generated on: 2025-12-26 02:43:29
|
||||
* Table: _file_storage
|
||||
*
|
||||
* @property int $id
|
||||
|
||||
@@ -14,7 +14,7 @@ use App\RSpade\Core\Models\Region_Model;
|
||||
*/
|
||||
/**
|
||||
* _AUTO_GENERATED_ Database type hints - do not edit manually
|
||||
* Generated on: 2025-12-26 01:29:30
|
||||
* Generated on: 2025-12-26 02:43:29
|
||||
* Table: countries
|
||||
*
|
||||
* @property int $id
|
||||
|
||||
@@ -12,7 +12,7 @@ use App\RSpade\Core\Database\Models\Rsx_System_Model_Abstract;
|
||||
*/
|
||||
/**
|
||||
* _AUTO_GENERATED_ Database type hints - do not edit manually
|
||||
* Generated on: 2025-12-26 01:29:30
|
||||
* Generated on: 2025-12-26 02:43:29
|
||||
* Table: ip_addresses
|
||||
*
|
||||
* @property int $id
|
||||
|
||||
@@ -24,7 +24,7 @@ use App\RSpade\Core\Session\Session;
|
||||
*/
|
||||
/**
|
||||
* _AUTO_GENERATED_ Database type hints - do not edit manually
|
||||
* Generated on: 2025-12-26 01:29:30
|
||||
* Generated on: 2025-12-26 02:43:29
|
||||
* Table: login_users
|
||||
*
|
||||
* @property int $id
|
||||
@@ -33,6 +33,7 @@ use App\RSpade\Core\Session\Session;
|
||||
* @property bool $is_activated
|
||||
* @property bool $is_verified
|
||||
* @property int $status_id
|
||||
* @property mixed $timezone
|
||||
* @property mixed $remember_token
|
||||
* @property string $last_login
|
||||
* @property string $created_at
|
||||
|
||||
@@ -14,7 +14,7 @@ use App\RSpade\Core\Models\Country_Model;
|
||||
*/
|
||||
/**
|
||||
* _AUTO_GENERATED_ Database type hints - do not edit manually
|
||||
* Generated on: 2025-12-26 01:29:30
|
||||
* Generated on: 2025-12-26 02:43:29
|
||||
* Table: regions
|
||||
*
|
||||
* @property int $id
|
||||
|
||||
@@ -14,7 +14,7 @@ use App\RSpade\Core\Models\User_Model;
|
||||
*/
|
||||
/**
|
||||
* _AUTO_GENERATED_ Database type hints - do not edit manually
|
||||
* Generated on: 2025-12-26 01:29:30
|
||||
* Generated on: 2025-12-26 02:43:29
|
||||
* Table: sites
|
||||
*
|
||||
* @property int $id
|
||||
|
||||
@@ -12,7 +12,7 @@ use App\RSpade\Core\Database\Models\Rsx_Site_Model_Abstract;
|
||||
*/
|
||||
/**
|
||||
* _AUTO_GENERATED_ Database type hints - do not edit manually
|
||||
* Generated on: 2025-12-26 01:29:30
|
||||
* Generated on: 2025-12-26 02:43:29
|
||||
* Table: user_invites
|
||||
*
|
||||
* @property int $id
|
||||
|
||||
@@ -25,7 +25,7 @@ use App\RSpade\Core\Models\User_Profile_Model;
|
||||
|
||||
/**
|
||||
* _AUTO_GENERATED_ Database type hints - do not edit manually
|
||||
* Generated on: 2025-12-26 01:29:30
|
||||
* Generated on: 2025-12-26 02:43:29
|
||||
* Table: users
|
||||
*
|
||||
* @property int $id
|
||||
@@ -72,7 +72,6 @@ class User_Model extends Rsx_Site_Model_Abstract
|
||||
const ROLE_VIEWER = 700;
|
||||
const ROLE_DISABLED = 800;
|
||||
|
||||
|
||||
/** __AUTO_GENERATED: */
|
||||
|
||||
/** __/AUTO_GENERATED */
|
||||
|
||||
@@ -7,7 +7,7 @@ use App\RSpade\Core\Models\User_Model;
|
||||
|
||||
/**
|
||||
* _AUTO_GENERATED_ Database type hints - do not edit manually
|
||||
* Generated on: 2025-12-26 01:29:30
|
||||
* Generated on: 2025-12-26 02:43:29
|
||||
* Table: user_permissions
|
||||
*
|
||||
* @property int $id
|
||||
|
||||
@@ -35,7 +35,7 @@ use App\RSpade\Core\Models\User_Model;
|
||||
*/
|
||||
/**
|
||||
* _AUTO_GENERATED_ Database type hints - do not edit manually
|
||||
* Generated on: 2025-12-26 01:29:30
|
||||
* Generated on: 2025-12-26 02:43:29
|
||||
* Table: user_profiles
|
||||
*
|
||||
* @property int $id
|
||||
|
||||
@@ -13,7 +13,7 @@ use App\RSpade\Core\Database\Models\Rsx_Model_Abstract;
|
||||
|
||||
/**
|
||||
* _AUTO_GENERATED_ Database type hints - do not edit manually
|
||||
* Generated on: 2025-12-26 01:29:30
|
||||
* Generated on: 2025-12-26 02:43:29
|
||||
* Table: user_verifications
|
||||
*
|
||||
* @property int $id
|
||||
@@ -47,7 +47,6 @@ class User_Verification_Model extends Rsx_Model_Abstract
|
||||
const VERIFICATION_TYPE_EMAIL_RECOVERY = 3;
|
||||
const VERIFICATION_TYPE_SMS_RECOVERY = 4;
|
||||
|
||||
|
||||
/** __AUTO_GENERATED: */
|
||||
|
||||
/** __/AUTO_GENERATED */
|
||||
|
||||
@@ -17,7 +17,7 @@ use App\RSpade\Core\Database\Models\Rsx_Site_Model_Abstract;
|
||||
|
||||
/**
|
||||
* _AUTO_GENERATED_ Database type hints - do not edit manually
|
||||
* Generated on: 2025-12-26 01:29:30
|
||||
* Generated on: 2025-12-26 02:43:29
|
||||
* Table: _search_indexes
|
||||
*
|
||||
* @property int $id
|
||||
|
||||
@@ -41,7 +41,7 @@ use App\RSpade\Core\Session\User_Agent;
|
||||
*/
|
||||
/**
|
||||
* _AUTO_GENERATED_ Database type hints - do not edit manually
|
||||
* Generated on: 2025-12-26 01:29:30
|
||||
* Generated on: 2025-12-26 02:43:29
|
||||
* Table: _sessions
|
||||
*
|
||||
* @property int $id
|
||||
|
||||
@@ -6,7 +6,7 @@ use App\RSpade\Core\Database\Models\Rsx_Model_Abstract;
|
||||
|
||||
/**
|
||||
* _AUTO_GENERATED_ Database type hints - do not edit manually
|
||||
* Generated on: 2025-12-26 01:29:30
|
||||
* Generated on: 2025-12-26 02:43:30
|
||||
* Table: _flash_alerts
|
||||
*
|
||||
* @property int $id
|
||||
@@ -38,7 +38,6 @@ class Flash_Alert_Model extends Rsx_Model_Abstract
|
||||
const TYPE_INFO = 3;
|
||||
const TYPE_WARNING = 4;
|
||||
|
||||
|
||||
/** __AUTO_GENERATED: */
|
||||
|
||||
/** __/AUTO_GENERATED */
|
||||
|
||||
@@ -351,6 +351,16 @@
|
||||
"created_at": "2025-12-24T21:02:13+00:00",
|
||||
"created_by": "root",
|
||||
"command": "php artisan make:migration:safe add_timezone_to_login_users_table"
|
||||
},
|
||||
"2025_12_26_023403_convert_client_status_to_enum.php": {
|
||||
"created_at": "2025-12-26T02:34:03+00:00",
|
||||
"created_by": "root",
|
||||
"command": "php artisan make:migration:safe convert_client_status_to_enum"
|
||||
},
|
||||
"2025_12_26_023543_convert_client_status_to_enum.php": {
|
||||
"created_at": "2025-12-26T02:35:44+00:00",
|
||||
"created_by": "root",
|
||||
"command": "php artisan make:migration:safe convert_client_status_to_enum"
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user