Check code style
Development Guidelines
Code Style
SoloDB follows PSR coding standards with some custom rules. The project uses:
PHPStan for static analysis (level 2)
PHP_CodeSniffer for code style checking
PHP-CS-Fixer for code style fixing
Project Structure
The project follows a modular structure:
Each module is in the
module
directoryEach module has:
src
: Source codetest
: Test codeview
: View templatesconfig
: Module configuration
Naming Conventions
Classes should use PascalCase
Methods and variables should use camelCase
Constants should use UPPER_SNAKE_CASE
Files should match the class name they contain
Doctrine Entities
Entities should extend
Application\Entity\AbstractEntity
Use PHP 8+ attributes for ORM mapping
Implement getters and setters for all properties
Return
$this
from setters for method chaining
Services
Services should extend
Application\Service\AbstractService
Services should be responsible for business logic and data access
Use dependency injection for service dependencies