SoloDB Documentation version 0.1-DEV Help

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

# Check code style composer cs # Fix code style composer fix # Run static analysis composer phpstan

Project Structure

The project follows a modular structure:

  • Each module is in the module directory

  • Each module has:

    • src: Source code

    • test: Test code

    • view: View templates

    • config: 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

09 May 2025