This document provides context for AI assistants working with the Neuron framework codebase.
- Project Summary - Architecture overview and component descriptions
- Coding Conventions - Code style, patterns, and testing practices
composer install# Run all tests (excluding database-dependent tests)
vendor/bin/phpunit --exclude-group=database
# Run specific test file
vendor/bin/phpunit tests/ToolsTest.php
# Run with coverage
vendor/bin/phpunit --exclude-group=database --coverage-textThe primary input validation layer. All user input should be validated through Tools::checkInput() before use. The Tools::getInput() method combines validation with data retrieval and type-specific processing.
Important: Date validation uses ctype_digit() and checkdate() to ensure all date parts are valid integers representing a real date. The getInput() method casts date parts to (int) before passing to mktime() as a defence-in-depth measure.
Always use parameterized queries via the Query class to prevent SQL injection. Never concatenate user input directly into SQL strings.
Tests are located in tests/ and use PHPUnit. Database-dependent tests are grouped with #[Group('database')] and require a MySQL connection. CI runs tests excluding this group.
GitHub Actions workflow runs tests on PHP 8.1, 8.2, and 8.3. See .github/workflows/tests.yml.