jardispsr / classversion
This package provides classversion interfaces for a domain driven design approach
Installs: 57
Dependents: 2
Suggesters: 0
Security: 0
Stars: 0
Watchers: 0
Forks: 0
Language:Makefile
pkg:composer/jardispsr/classversion
Requires
- php: >=8.2
Requires (Dev)
- phpstan/phpstan: ^2.0.4
- squizlabs/php_codesniffer: ^3.11.2
README
This package provides classversion interfaces for a domain driven design approach.
Installation
composer require jrs/class-version
Interfaces
ClassVersionInterface
The main interface for resolving versioned class instances.
interface ClassVersionInterface { /** * @template T * @param class-string<T> $className * @param ?string $version * @return mixed|T */ public function __invoke(string $className, ?string $version = null): mixed; }
ClassVersionConfigInterface
Interface for managing version configuration.
interface ClassVersionConfigInterface { /** * @param string|null $version * @return string|null */ public function version(?string $version = null): ?string; }
Usage
Implement these interfaces to create a versioning system for your domain classes, allowing you to manage different versions of class implementations in your DDD architecture.
License
MIT