zorachka/uuid

Uuid Provider for Zorachka

Maintainers

Details

github.com/zorachka/uuid

Source

Issues

Installs: 607

Dependents: 1

Suggesters: 0

Security: 0

Stars: 0

Watchers: 1

Forks: 0

Open Issues: 0

Type:project

dev-main 2023-07-31 09:17 UTC

This package is auto-updated.

Last update: 2024-04-30 00:39:57 UTC


README

86768962

Zorachka Uuid


The main purpose of this package is to provide a provider to generate uuid.

Latest Version on Packagist Tests Analysis Total Downloads

Installation

You can install the package via composer:

composer require zorachka/uuid

Usage

Usually you need to generate a uuid in the repository implementation:

<?php

declare(strict_types=1);

namespace Project\Reviews\Infrastructure\Persistence;

use Zorachka\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.