Add JS-CATCH-FALLBACK-01 rule and update npm packages
Add PHP-ALIAS-01 rule: prohibit field aliasing in serialization 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -92,6 +92,20 @@ Core classes ALWAYS exist. Never check.
|
||||
|
||||
Classes are namespacing tools. Use static unless instances needed (models, resources). Avoid dependency injection.
|
||||
|
||||
### No Field Aliasing
|
||||
|
||||
**Field names must be identical across all layers.** Database → PHP → JSON → JavaScript: same names, always.
|
||||
|
||||
```php
|
||||
// ❌ WRONG - renaming during serialization
|
||||
return ['type_label' => $contact->type_id_label];
|
||||
|
||||
// ✅ CORRECT - names match source
|
||||
return ['type_id_label' => $contact->type_id_label];
|
||||
```
|
||||
|
||||
One string everywhere. Grep finds all usages. No mental mapping between layers.
|
||||
|
||||
### Git Workflow - Framework is READ-ONLY
|
||||
|
||||
**NEVER modify `/var/www/html/system/`** - It's like node_modules or the Linux kernel.
|
||||
|
||||
Reference in New Issue
Block a user