mirror of
https://github.com/opensourcepos/opensourcepos.git
synced 2026-07-26 14:47:06 -04:00
- Updated PHP version to reflect the project parameters - Updated minimum PHPUnit version - Added instructions regarding Plugins Signed-off-by: objec <objecttothis@gmail.com>
1.5 KiB
1.5 KiB
Agent Instructions
This document provides guidance for AI agents working on the Open Source Point of Sale (OSPOS) codebase.
Code Style
- Follow PHP CodeIgniter 4 coding standards
- Run PHP-CS-Fixer before committing:
vendor/bin/php-cs-fixer fix --config=.php-cs-fixer.no-header.php - Write PHP 8.2+ compatible code with proper type declarations
- Use PSR-12 naming conventions:
camelCasefor variables and functions,PascalCasefor classes,UPPER_CASEfor constants
Development
- Create a new git worktree for each issue, based on the latest state of
origin/master - Commit fixes to the worktree and push to the remote
Testing
- Run PHPUnit tests:
composer test - Tests must pass before submitting changes
- Minimum PHPUnit version: 10.5.16+. Default config:
phpunit.xml.distin project root
Build
- Install dependencies:
composer install && npm install - Build assets:
npm run buildorgulp
Conventions
- Controllers go in
app/Controllers/ - Models go in
app/Models/ - Views go in
app/Views/ - Database migrations in
app/Database/Migrations/ - Plugins go in
app/Plugins/(seeapp/Plugins/README.mdfor plugin structure, event hooks, and LICENSE requirements) - Use CodeIgniter 4 framework patterns and helpers
- Sanitize user input; escape output using
esc()helper
Security
- Never commit secrets, credentials, or
.envfiles - Use parameterized queries to prevent SQL injection
- Validate and sanitize all user input