🆙 Add cms i using 🆙

This commit is contained in:
2025-11-25 22:42:56 +01:00
parent 94704e0925
commit d44196149e
35591 changed files with 3601123 additions and 0 deletions
@@ -0,0 +1,36 @@
<?php
declare(strict_types=1);
namespace Pest\Arch\ValueObjects;
use PHPUnit\Framework\ExpectationFailedException;
/**
* @internal
*/
final class Dependency
{
/**
* Creates a new Dependency instance.
*/
public function __construct(
public readonly string $value,
) {
// ..
}
/**
* Creates a new Dependency instance from the given "expectation" input.
*/
public static function fromString(string $value): self
{
if (str_contains($value, '/')) {
throw new ExpectationFailedException(
"Expecting '{$value}' to be a class name or namespace, but it contains a path.",
);
}
return new self($value);
}
}
@@ -0,0 +1,47 @@
<?php
declare(strict_types=1);
namespace Pest\Arch\ValueObjects;
use Pest\Expectation;
use PHPUnit\Framework\ExpectationFailedException;
/**
* @internal
*/
final class Targets
{
/**
* Creates a new Target instance.
*
* @param array<int, string> $value
*/
public function __construct(
public readonly array $value,
) {
// ..
}
/**
* Creates a new Target instance from the given "expectation" input.
*
* @param Expectation<array<int, string>|string> $expectation
*/
public static function fromExpectation(Expectation $expectation): self
{
assert(is_string($expectation->value) || is_array($expectation->value)); // @phpstan-ignore-line
$values = is_string($expectation->value) ? [$expectation->value] : $expectation->value;
foreach ($values as $value) {
if (str_contains($value, '/')) {
throw new ExpectationFailedException(
"Expecting '{$value}' to be a class name or namespace, but it contains a path.",
);
}
}
return new self($values);
}
}
@@ -0,0 +1,16 @@
<?php
declare(strict_types=1);
namespace Pest\Arch\ValueObjects;
final class Violation
{
/**
* Creates a new violation instance.
*/
public function __construct(public readonly string $path, public readonly int $start, public readonly int $end)
{
//
}
}