Skip to content

[Uid] Use CPP #53279

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 3 additions & 6 deletions src/Symfony/Component/Uid/Command/GenerateUlidCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,9 @@
#[AsCommand(name: 'ulid:generate', description: 'Generate a ULID')]
class GenerateUlidCommand extends Command
{
private UlidFactory $factory;

public function __construct(UlidFactory $factory = null)
{
$this->factory = $factory ?? new UlidFactory();

public function __construct(
private UlidFactory $factory = new UlidFactory(),
) {
parent::__construct();
}

Expand Down
9 changes: 3 additions & 6 deletions src/Symfony/Component/Uid/Command/GenerateUuidCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,9 @@
#[AsCommand(name: 'uuid:generate', description: 'Generate a UUID')]
class GenerateUuidCommand extends Command
{
private UuidFactory $factory;

public function __construct(UuidFactory $factory = null)
{
$this->factory = $factory ?? new UuidFactory();

public function __construct(
private UuidFactory $factory = new UuidFactory(),
) {
parent::__construct();
}

Expand Down
11 changes: 4 additions & 7 deletions src/Symfony/Component/Uid/Factory/NameBasedUuidFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,10 @@

class NameBasedUuidFactory
{
private string $class;
private Uuid $namespace;

public function __construct(string $class, Uuid $namespace)
{
$this->class = $class;
$this->namespace = $namespace;
public function __construct(
private string $class,
private Uuid $namespace,
) {
}

public function create(string $name): UuidV5|UuidV3
Expand Down
11 changes: 6 additions & 5 deletions src/Symfony/Component/Uid/Factory/RandomBasedUuidFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,12 @@

class RandomBasedUuidFactory
{
private string $class;

public function __construct(string $class)
{
$this->class = $class;
/**
* @param class-string $class
*/
public function __construct(
private string $class,
) {
}

public function create(): UuidV4
Expand Down
14 changes: 4 additions & 10 deletions src/Symfony/Component/Uid/Factory/TimeBasedUuidFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,13 @@

class TimeBasedUuidFactory
{
/**
* @var class-string<Uuid&TimeBasedUidInterface>
*/
private string $class;
private ?Uuid $node;

/**
* @param class-string<Uuid&TimeBasedUidInterface> $class
*/
public function __construct(string $class, Uuid $node = null)
{
$this->class = $class;
$this->node = $node;
public function __construct(
private string $class,
private ?Uuid $node = null
) {
}

public function create(\DateTimeInterface $time = null): Uuid&TimeBasedUidInterface
Expand Down
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy