PHP Classes

File: AGENTS.md

Recommend this page to a friend!
  Packages of Julio Vergara   GitHub API   AGENTS.md   Download  
File: AGENTS.md
Role: Auxiliary data
Content type: text/markdown
Description: Auxiliary data
Class: GitHub API
Present the most starred PHP projects in GitHub
Author: By
Last change:
Date: 6 days ago
Size: 3,034 bytes
 

Contents

Class file image Download

VUMC VICTR Symfony Application - Agent Guide

Architecture

  • Symfony 7.4 app, PHP 8.1+, Docker-first development
  • Web container: PHP 8.3 + Apache; Database: MariaDB 11.5
  • Autoload: `App\` ? `src/`, `App\Tests\` ? `tests/`
  • Routing: attribute-based in `src/Controller/`
  • ORM: Doctrine with migrations in `migrations/`

Key Commands (all run through Docker)

docker compose up -d                          # Start containers
docker compose exec web composer install      # Install deps
docker compose exec web bin/console <cmd>     # Run Symfony console
docker compose exec web vendor/bin/phpunit    # Run all tests
docker compose exec web vendor/bin/phpunit --filter TestClass  # Single test

Ports & Database

  • Web: `http://127.0.0.1:8080`
  • DB: `127.0.0.1:8306`, user `root`, no password, database `app`
  • Override ports in `compose.override.yaml` (copy from `.dist`)

Directory Structure

  • `src/Controller/` - routes via `#[Route]` attributes
  • `src/Entity/` - Doctrine entities with `#[ORM\...]` attributes
  • `src/Repository/` - entity repositories (auto-generated by MakerBundle)
  • `templates/` - Twig templates
  • `migrations/` - Doctrine migration files
  • `config/packages/` - bundle configuration
  • `var/` - runtime cache/logs (gitignored)

Conventions

  • Controllers extend `AbstractController`
  • Services auto-wired via `config/services.yaml`
  • Entity repositories referenced in entity `#[ORM\Entity(repositoryClass: ...)]`
  • Test env uses `.env.test`, sets `APP_ENV=test`
  • PHPUnit 12, tests in `tests/` matching `*Test.php`
  • No linting, static analysis, or CI configured

Setup Flow

  1. `cp compose.override.yaml.dist compose.override.yaml` (if ports conflict)
  2. `docker compose up -d`
  3. `docker compose exec web composer install`
  4. `docker compose exec web bin/console doctrine:migrations:migrate`

Programming Rules Configuration

General Rules

  • All the code and names must be in English language
  • Do not hallucinate files, classes, or functions
  • If something is missing, ask before proceeding
  • Prefer minimal, incremental changes
  • Follow existing project structure and conventions
  • Do not introduce unnecessary abstractions
  • Use descriptive variable names
  • Maintain consistent code style
  • Do NOT add comments inside the code
  • Follow best practices of programming

PHP / Symfony

  • Always follow PSR-12 for PHP code
  • After de PHP open tag there should be a blank line before the code
  • Use Symfony conventions (Controllers, Services, Jobs, Policies)
  • Keep controllers thin, move logic to services
  • Class names in StudlyCase
  • Method names in camelCase
  • Variable names in camelCase
  • Consistent spacing

Coding Behavior

  • Be precise and deterministic
  • Do not be verbose
  • Do not explain unless explicitly asked

When modifying code

  1. State assumptions briefly (1 line max)
  2. Show only the diff or final code
  3. Do not add extra commentary

When unsure

  • Ask a clarification question instead of guessing