a50 / uuid
Uuid Provider for A50
Installs: 4
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
Type:project
Requires
- php: ^8.1
- a50/container: dev-main
- ramsey/uuid: ^4.7
This package is auto-updated.
Last update: 2024-11-07 06:07:23 UTC
README
Uuid Provider
The main purpose of this package is to provide a provider to generate uuid.
Installation
You can install the package via composer:
composer require a50/uuid
Usage
Usually you need to generate a uuid in the repository implementation:
<?php declare(strict_types=1); namespace Project\Reviews\Infrastructure\Persistence; use A50\Uuid\UuidProvider; use Project\Reviews\Domain\ReviewId; use Project\Reviews\Domain\ReviewRepository; final class ReviewRepositoryUsingDbal implements ReviewRepository { private UuidProvider $uuidProvider; public function __construct(UuidProvider $uuidProvider) { $this->uuidProvider = $uuidProvider; } public function nextIdentity(): ReviewId { return ReviewId::fromString($this->uuidProvider::next()); } // ... }
You can use UuidServiceProvider
as definitions for container.
Testing
make test
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
Credits
License
The MIT License (MIT). Please see License File for more information.