derafu / backbone
Derafu: Backbone - The Architectural Spine for PHP Libraries
dev-main
2025-03-11 04:21 UTC
Requires
- php: ^8.3
- derafu/config: dev-main
- derafu/translation: dev-main
Requires (Dev)
- ext-xdebug: *
- derafu/foundation: dev-main
- friendsofphp/php-cs-fixer: ^3.63
- phpstan/phpstan: ^1.12
- phpunit/phpunit: ^11.4
This package is auto-updated.
Last update: 2025-03-11 04:22:55 UTC
README
Derafu Backbone is a lightweight architectural framework that provides a consistent structure for building modular, maintainable PHP libraries.
Features
- Hierarchical Organization: Clear structure with Packages, Components, and Workers.
- Separation of Concerns: Jobs for atomic operations, Handlers for orchestration, Strategies for implementation variants.
- Attribute-Based Discovery: Use PHP 8 attributes instead of rigid namespace conventions.
- Extensible Architecture: Designed to grow with your application.
Key Benefits
- Consistent Structure: Standardized approach to organizing domain logic.
- Reduced Complexity: Clear responsibilities for each architectural element.
- Improved Testability: Isolated components are easier to test.
- Enhanced Collaboration: Common vocabulary and patterns for development teams.
- Flexible Implementation: Adapt to different domains without changing the core architecture.
Installation
composer require derafu/backbone
Quick Example
#[Package(name: 'billing')] class BillingPackage extends AbstractPackage implements PackageInterface { // Package implementation. } #[Component(name: 'document', package: 'billing')] class DocumentComponent extends AbstractComponent implements ComponentInterface { // Component implementation. } #[Worker(name: 'renderer', component: 'document', package: 'billing')] class RendererWorker extends AbstractWorker implements WorkerInterface { // Worker implementation. }
Contributing
Contributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.
License
This package is open-sourced software licensed under the MIT license.