Stand: SMTP-Test, Admin-Mail-Tab, Notifiable-Fix, Lazy-Quill
- Fix: Notifiable-Trait zum User-Model hinzugefuegt (behebt notify()-500er) - Installer: SMTP-Verbindungstest mit EsmtpTransport + Ueberspringen-Link - Admin: Neuer E-Mail-Tab mit SMTP-Konfiguration + Verbindungstest - Admin: Lazy Quill-Initialisierung (nur sichtbare Locale wird geladen) - Uebersetzungen: 17 neue Mail-Keys in allen 6 Sprachen Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
140
vendor/symfony/uid/Factory/MockUuidFactory.php
vendored
Executable file
140
vendor/symfony/uid/Factory/MockUuidFactory.php
vendored
Executable file
@@ -0,0 +1,140 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Symfony package.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien@symfony.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Symfony\Component\Uid\Factory;
|
||||
|
||||
use Symfony\Component\Uid\Exception\InvalidArgumentException;
|
||||
use Symfony\Component\Uid\Exception\LogicException;
|
||||
use Symfony\Component\Uid\TimeBasedUidInterface;
|
||||
use Symfony\Component\Uid\Uuid;
|
||||
use Symfony\Component\Uid\UuidV1;
|
||||
use Symfony\Component\Uid\UuidV3;
|
||||
use Symfony\Component\Uid\UuidV4;
|
||||
use Symfony\Component\Uid\UuidV5;
|
||||
use Symfony\Component\Uid\UuidV6;
|
||||
|
||||
class MockUuidFactory extends UuidFactory
|
||||
{
|
||||
private \Iterator $sequence;
|
||||
|
||||
/**
|
||||
* @param iterable<string|Uuid> $uuids
|
||||
*/
|
||||
public function __construct(
|
||||
iterable $uuids,
|
||||
private Uuid|string|null $timeBasedNode = null,
|
||||
private Uuid|string|null $nameBasedNamespace = null,
|
||||
) {
|
||||
$this->sequence = match (true) {
|
||||
\is_array($uuids) => new \ArrayIterator($uuids),
|
||||
$uuids instanceof \Iterator => $uuids,
|
||||
$uuids instanceof \Traversable => new \IteratorIterator($uuids),
|
||||
};
|
||||
}
|
||||
|
||||
public function create(): Uuid
|
||||
{
|
||||
if (!$this->sequence->valid()) {
|
||||
throw new LogicException('No more UUIDs in sequence.');
|
||||
}
|
||||
$uuid = $this->sequence->current();
|
||||
$this->sequence->next();
|
||||
|
||||
return match (true) {
|
||||
$uuid instanceof Uuid => $uuid,
|
||||
\is_string($uuid) => Uuid::fromString($uuid),
|
||||
default => throw new InvalidArgumentException(\sprintf('Next UUID in sequence is not a valid UUID string or object: "%s" given.', get_debug_type($uuid))),
|
||||
};
|
||||
}
|
||||
|
||||
public function randomBased(): RandomBasedUuidFactory
|
||||
{
|
||||
return new class($this->create(...)) extends RandomBasedUuidFactory {
|
||||
public function __construct(
|
||||
private \Closure $create,
|
||||
) {
|
||||
}
|
||||
|
||||
public function create(): UuidV4
|
||||
{
|
||||
if (!($uuid = ($this->create)()) instanceof UuidV4) {
|
||||
throw new InvalidArgumentException(\sprintf('Next UUID in sequence is not a UuidV4: "%s" given.', get_debug_type($uuid)));
|
||||
}
|
||||
|
||||
return $uuid;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
public function timeBased(Uuid|string|null $node = null): TimeBasedUuidFactory
|
||||
{
|
||||
if (\is_string($node ??= $this->timeBasedNode)) {
|
||||
$node = Uuid::fromString($node);
|
||||
}
|
||||
|
||||
return new class($this->create(...), $node) extends TimeBasedUuidFactory {
|
||||
public function __construct(
|
||||
private \Closure $create,
|
||||
private ?Uuid $node = null,
|
||||
) {
|
||||
}
|
||||
|
||||
public function create(?\DateTimeInterface $time = null): Uuid&TimeBasedUidInterface
|
||||
{
|
||||
$uuid = ($this->create)();
|
||||
|
||||
if (!($uuid instanceof Uuid && $uuid instanceof TimeBasedUidInterface)) {
|
||||
throw new InvalidArgumentException(\sprintf('Next UUID in sequence is not a Uuid and TimeBasedUidInterface: "%s" given.', get_debug_type($uuid)));
|
||||
}
|
||||
|
||||
if (null !== $time && $uuid->getDateTime() !== $time) {
|
||||
throw new InvalidArgumentException(\sprintf('Next UUID in sequence does not match the expected time: "%s" != "%s".', $uuid->getDateTime()->format('@U.uT'), $time->format('@U.uT')));
|
||||
}
|
||||
|
||||
if (null !== $this->node && ($uuid instanceof UuidV1 || $uuid instanceof UuidV6) && $uuid->getNode() !== substr($this->node->toRfc4122(), -12)) {
|
||||
throw new InvalidArgumentException(\sprintf('Next UUID in sequence does not match the expected node: "%s" != "%s".', $uuid->getNode(), substr($this->node->toRfc4122(), -12)));
|
||||
}
|
||||
|
||||
return $uuid;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
public function nameBased(Uuid|string|null $namespace = null): NameBasedUuidFactory
|
||||
{
|
||||
if (null === $namespace ??= $this->nameBasedNamespace) {
|
||||
throw new LogicException(\sprintf('A namespace should be defined when using "%s()".', __METHOD__));
|
||||
}
|
||||
|
||||
return new class($this->create(...), $namespace) extends NameBasedUuidFactory {
|
||||
public function __construct(
|
||||
private \Closure $create,
|
||||
private Uuid|string $namespace,
|
||||
) {
|
||||
}
|
||||
|
||||
public function create(string $name): UuidV5|UuidV3
|
||||
{
|
||||
if (!($uuid = ($this->create)()) instanceof UuidV5 && !$uuid instanceof UuidV3) {
|
||||
throw new InvalidArgumentException(\sprintf('Next UUID in sequence is not a UuidV5 or UuidV3: "%s".', get_debug_type($uuid)));
|
||||
}
|
||||
|
||||
$factory = new UuidFactory(nameBasedClass: $uuid::class, nameBasedNamespace: $this->namespace);
|
||||
|
||||
if ($uuid->toRfc4122() !== $expectedUuid = $factory->nameBased()->create($name)->toRfc4122()) {
|
||||
throw new InvalidArgumentException(\sprintf('Next UUID in sequence does not match the expected named UUID: "%s" != "%s".', $uuid->toRfc4122(), $expectedUuid));
|
||||
}
|
||||
|
||||
return $uuid;
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
41
vendor/symfony/uid/Factory/NameBasedUuidFactory.php
vendored
Executable file
41
vendor/symfony/uid/Factory/NameBasedUuidFactory.php
vendored
Executable file
@@ -0,0 +1,41 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Symfony package.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien@symfony.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Symfony\Component\Uid\Factory;
|
||||
|
||||
use Symfony\Component\Uid\Uuid;
|
||||
use Symfony\Component\Uid\UuidV3;
|
||||
use Symfony\Component\Uid\UuidV5;
|
||||
|
||||
class NameBasedUuidFactory
|
||||
{
|
||||
public function __construct(
|
||||
private string $class,
|
||||
private Uuid $namespace,
|
||||
) {
|
||||
}
|
||||
|
||||
public function create(string $name): UuidV5|UuidV3
|
||||
{
|
||||
switch ($class = $this->class) {
|
||||
case UuidV5::class: return Uuid::v5($this->namespace, $name);
|
||||
case UuidV3::class: return Uuid::v3($this->namespace, $name);
|
||||
}
|
||||
|
||||
if (is_subclass_of($class, UuidV5::class)) {
|
||||
$uuid = Uuid::v5($this->namespace, $name);
|
||||
} else {
|
||||
$uuid = Uuid::v3($this->namespace, $name);
|
||||
}
|
||||
|
||||
return new $class($uuid);
|
||||
}
|
||||
}
|
||||
32
vendor/symfony/uid/Factory/RandomBasedUuidFactory.php
vendored
Executable file
32
vendor/symfony/uid/Factory/RandomBasedUuidFactory.php
vendored
Executable file
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Symfony package.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien@symfony.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Symfony\Component\Uid\Factory;
|
||||
|
||||
use Symfony\Component\Uid\UuidV4;
|
||||
|
||||
class RandomBasedUuidFactory
|
||||
{
|
||||
/**
|
||||
* @param class-string $class
|
||||
*/
|
||||
public function __construct(
|
||||
private string $class,
|
||||
) {
|
||||
}
|
||||
|
||||
public function create(): UuidV4
|
||||
{
|
||||
$class = $this->class;
|
||||
|
||||
return new $class();
|
||||
}
|
||||
}
|
||||
38
vendor/symfony/uid/Factory/TimeBasedUuidFactory.php
vendored
Executable file
38
vendor/symfony/uid/Factory/TimeBasedUuidFactory.php
vendored
Executable file
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Symfony package.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien@symfony.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Symfony\Component\Uid\Factory;
|
||||
|
||||
use Symfony\Component\Uid\TimeBasedUidInterface;
|
||||
use Symfony\Component\Uid\Uuid;
|
||||
|
||||
class TimeBasedUuidFactory
|
||||
{
|
||||
/**
|
||||
* @param class-string<Uuid&TimeBasedUidInterface> $class
|
||||
*/
|
||||
public function __construct(
|
||||
private string $class,
|
||||
private ?Uuid $node = null,
|
||||
) {
|
||||
}
|
||||
|
||||
public function create(?\DateTimeInterface $time = null): Uuid&TimeBasedUidInterface
|
||||
{
|
||||
$class = $this->class;
|
||||
|
||||
if (null === $time && null === $this->node) {
|
||||
return new $class();
|
||||
}
|
||||
|
||||
return new $class($class::generate($time, $this->node));
|
||||
}
|
||||
}
|
||||
22
vendor/symfony/uid/Factory/UlidFactory.php
vendored
Executable file
22
vendor/symfony/uid/Factory/UlidFactory.php
vendored
Executable file
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Symfony package.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien@symfony.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Symfony\Component\Uid\Factory;
|
||||
|
||||
use Symfony\Component\Uid\Ulid;
|
||||
|
||||
class UlidFactory
|
||||
{
|
||||
public function create(?\DateTimeInterface $time = null): Ulid
|
||||
{
|
||||
return new Ulid(null === $time ? null : Ulid::generate($time));
|
||||
}
|
||||
}
|
||||
99
vendor/symfony/uid/Factory/UuidFactory.php
vendored
Executable file
99
vendor/symfony/uid/Factory/UuidFactory.php
vendored
Executable file
@@ -0,0 +1,99 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Symfony package.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien@symfony.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Symfony\Component\Uid\Factory;
|
||||
|
||||
use Symfony\Component\Uid\Exception\LogicException;
|
||||
use Symfony\Component\Uid\Uuid;
|
||||
use Symfony\Component\Uid\UuidV1;
|
||||
use Symfony\Component\Uid\UuidV4;
|
||||
use Symfony\Component\Uid\UuidV5;
|
||||
use Symfony\Component\Uid\UuidV7;
|
||||
|
||||
class UuidFactory
|
||||
{
|
||||
private string $defaultClass;
|
||||
private string $timeBasedClass;
|
||||
private string $nameBasedClass;
|
||||
private string $randomBasedClass;
|
||||
private ?Uuid $timeBasedNode;
|
||||
private ?Uuid $nameBasedNamespace;
|
||||
|
||||
public function __construct(string|int $defaultClass = UuidV7::class, string|int $timeBasedClass = UuidV7::class, string|int $nameBasedClass = UuidV5::class, string|int $randomBasedClass = UuidV4::class, Uuid|string|null $timeBasedNode = null, Uuid|string|null $nameBasedNamespace = null)
|
||||
{
|
||||
if (null !== $timeBasedNode && !$timeBasedNode instanceof Uuid) {
|
||||
$timeBasedNode = Uuid::fromString($timeBasedNode);
|
||||
}
|
||||
|
||||
if (null !== $nameBasedNamespace) {
|
||||
$nameBasedNamespace = $this->getNamespace($nameBasedNamespace);
|
||||
}
|
||||
|
||||
$this->defaultClass = is_numeric($defaultClass) ? Uuid::class.'V'.$defaultClass : $defaultClass;
|
||||
$this->timeBasedClass = is_numeric($timeBasedClass) ? Uuid::class.'V'.$timeBasedClass : $timeBasedClass;
|
||||
$this->nameBasedClass = is_numeric($nameBasedClass) ? Uuid::class.'V'.$nameBasedClass : $nameBasedClass;
|
||||
$this->randomBasedClass = is_numeric($randomBasedClass) ? Uuid::class.'V'.$randomBasedClass : $randomBasedClass;
|
||||
$this->timeBasedNode = $timeBasedNode;
|
||||
$this->nameBasedNamespace = $nameBasedNamespace;
|
||||
}
|
||||
|
||||
public function create(): Uuid
|
||||
{
|
||||
$class = $this->defaultClass;
|
||||
|
||||
return new $class();
|
||||
}
|
||||
|
||||
public function randomBased(): RandomBasedUuidFactory
|
||||
{
|
||||
return new RandomBasedUuidFactory($this->randomBasedClass);
|
||||
}
|
||||
|
||||
public function timeBased(Uuid|string|null $node = null): TimeBasedUuidFactory
|
||||
{
|
||||
$node ??= $this->timeBasedNode;
|
||||
|
||||
if (null !== $node && !$node instanceof Uuid) {
|
||||
$node = Uuid::fromString($node);
|
||||
}
|
||||
|
||||
return new TimeBasedUuidFactory($this->timeBasedClass, $node);
|
||||
}
|
||||
|
||||
/**
|
||||
* @throws LogicException When no namespace is defined
|
||||
*/
|
||||
public function nameBased(Uuid|string|null $namespace = null): NameBasedUuidFactory
|
||||
{
|
||||
$namespace ??= $this->nameBasedNamespace;
|
||||
|
||||
if (null === $namespace) {
|
||||
throw new LogicException(\sprintf('A namespace should be defined when using "%s()".', __METHOD__));
|
||||
}
|
||||
|
||||
return new NameBasedUuidFactory($this->nameBasedClass, $this->getNamespace($namespace));
|
||||
}
|
||||
|
||||
private function getNamespace(Uuid|string $namespace): Uuid
|
||||
{
|
||||
if ($namespace instanceof Uuid) {
|
||||
return $namespace;
|
||||
}
|
||||
|
||||
return match ($namespace) {
|
||||
'dns' => new UuidV1(Uuid::NAMESPACE_DNS),
|
||||
'url' => new UuidV1(Uuid::NAMESPACE_URL),
|
||||
'oid' => new UuidV1(Uuid::NAMESPACE_OID),
|
||||
'x500' => new UuidV1(Uuid::NAMESPACE_X500),
|
||||
default => Uuid::fromString($namespace),
|
||||
};
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user