23 lines
1.3 KiB
Markdown
23 lines
1.3 KiB
Markdown
# AGENT CODING STANDARDS
|
|
|
|
This project is a PHP MVC application using Composer, Twig, and FastRoute, running in an LXC container.
|
|
|
|
## 🛠️ Development Commands
|
|
|
|
| Type | Command | Notes |
|
|
| :--- | :--- | :--- |
|
|
| **Dependencies** | `composer install` | Run inside the container's web root. |
|
|
| **Linting** | N/A | No dedicated tool. Adhere to PSR-12 standards. |
|
|
| **Testing** | N/A | No testing framework configured. Avoid adding tests until one is introduced. |
|
|
|
|
## 📐 Code Style & Conventions
|
|
|
|
1. **Architecture:** Strict MVC pattern. Logic in `src/Controllers`, data access in `src/Models`, views in `templates/`.
|
|
2. **Namespacing:** Use `App\` as the base namespace (PSR-4).
|
|
3. **Naming:** Classes are `PascalCase`. Functions, methods, and variables are `camelCase`.
|
|
4. **Templating:** Use **Twig** (`.twig`). All HTML rendering must be done via Twig.
|
|
5. **I18n:** All user-facing strings must use `App\Services\TranslationService` (PHP) or `{{ trans('ID') }}` (Twig).
|
|
6. **Error Handling:** Use PHP's native exception handling (`try/catch`). Log critical errors with `error_log()`.
|
|
7. **Database:** Access SQLite via `App\Database\Database::getInstance()`. **Do not** use direct `new PDO()`.
|
|
8. **Imports:** Use fully qualified class names or `use` statements at the top of the file.
|