This commit is contained in:
2025-05-12 14:25:25 +02:00
parent ab2db755ef
commit 9e378ca2b7
2719 changed files with 46505 additions and 60181 deletions

0
vendor/nunomaduro/collision/LICENSE.md vendored Normal file → Executable file
View File

View File

@@ -15,26 +15,26 @@
],
"require": {
"php": "^8.1.0",
"filp/whoops": "^2.15.3",
"nunomaduro/termwind": "^1.15.1",
"symfony/console": "^6.3.4"
"filp/whoops": "^2.17.0",
"nunomaduro/termwind": "^1.17.0",
"symfony/console": "^6.4.17"
},
"conflict": {
"laravel/framework": ">=11.0.0"
},
"require-dev": {
"brianium/paratest": "^7.3.0",
"laravel/framework": "^10.28.0",
"laravel/pint": "^1.13.3",
"laravel/sail": "^1.25.0",
"laravel/sanctum": "^3.3.1",
"laravel/tinker": "^2.8.2",
"nunomaduro/larastan": "^2.6.4",
"orchestra/testbench-core": "^8.13.0",
"pestphp/pest": "^2.23.2",
"phpunit/phpunit": "^10.4.1",
"sebastian/environment": "^6.0.1",
"spatie/laravel-ignition": "^2.3.1"
"brianium/paratest": "^7.4.8",
"laravel/framework": "^10.48.29",
"laravel/pint": "^1.21.2",
"laravel/sail": "^1.41.0",
"laravel/sanctum": "^3.3.3",
"laravel/tinker": "^2.10.1",
"nunomaduro/larastan": "^2.10.0",
"orchestra/testbench-core": "^8.35.0",
"pestphp/pest": "^2.36.0",
"phpunit/phpunit": "^10.5.36",
"sebastian/environment": "^6.1.0",
"spatie/laravel-ignition": "^2.9.1"
},
"autoload-dev": {
"psr-4": {

View File

@@ -48,7 +48,7 @@ class CollisionServiceProvider extends ServiceProvider
$solutionsRepository = new IgnitionSolutionsRepository($solutionProviderRepository);
} else {
$solutionsRepository = new NullSolutionsRepository();
$solutionsRepository = new NullSolutionsRepository;
}
$writer = new Writer($solutionsRepository);

View File

@@ -195,7 +195,7 @@ class TestCommand extends Command
if ($this->option('ansi')) {
$arguments[] = '--colors=always';
} elseif ($this->option('no-ansi')) { // @phpstan-ignore-line
} elseif ($this->option('no-ansi')) {
$arguments[] = '--colors=never';
} elseif ((new Console)->hasColorSupport()) {
$arguments[] = '--colors=always';
@@ -281,7 +281,7 @@ class TestCommand extends Command
"--runner=\Illuminate\Testing\ParallelRunner",
], $options);
$inputDefinition = new InputDefinition();
$inputDefinition = new InputDefinition;
Options::setInputDefinition($inputDefinition);
$input = new ArgvInput($options, $inputDefinition);
@@ -379,7 +379,7 @@ class TestCommand extends Command
$vars = [];
foreach ((new Parser())->parse($content) as $entry) {
foreach ((new Parser)->parse($content) as $entry) {
$vars[] = $entry->getName();
}

View File

@@ -11,6 +11,4 @@ use RuntimeException;
/**
* @internal
*/
final class NotSupportedYetException extends RuntimeException implements RenderlessEditor, RenderlessTrace
{
}
final class NotSupportedYetException extends RuntimeException implements RenderlessEditor, RenderlessTrace {}

View File

@@ -11,6 +11,4 @@ use RuntimeException;
/**
* @internal
*/
final class RequirementsException extends RuntimeException implements RenderlessEditor, RenderlessTrace
{
}
final class RequirementsException extends RuntimeException implements RenderlessEditor, RenderlessTrace {}

View File

@@ -31,7 +31,7 @@ final class ConfigureIO
*/
public static function of(InputInterface $input, Output $output): void
{
$application = new Application();
$application = new Application;
$reflector = new ReflectionObject($application);
$method = $reflector->getMethod('configureIO');
$method->setAccessible(true);

View File

@@ -98,19 +98,19 @@ final class DefaultPrinter
{
$this->output = new ConsoleOutput(OutputInterface::VERBOSITY_NORMAL, $colors);
ConfigureIO::of(new ArgvInput(), $this->output);
ConfigureIO::of(new ArgvInput, $this->output);
self::$verbose = $this->output->isVerbose();
$this->style = new Style($this->output);
$this->state = new State();
$this->state = new State;
}
/**
* If the printer instances should be compact.
*/
public static function compact(bool $value = null): bool
public static function compact(?bool $value = null): bool
{
if (! is_null($value)) {
self::$compact = $value;
@@ -122,7 +122,7 @@ final class DefaultPrinter
/**
* If the printer instances should profile.
*/
public static function profile(bool $value = null): bool
public static function profile(?bool $value = null): bool
{
if (! is_null($value)) {
self::$profile = $value;
@@ -165,7 +165,7 @@ final class DefaultPrinter
$test = $event->test();
if (! $test instanceof TestMethod) {
throw new ShouldNotHappen();
throw new ShouldNotHappen;
}
if (! $this->state->existsInTestCase($event->test())) {
@@ -196,7 +196,7 @@ final class DefaultPrinter
$test = $event->test();
if (! $test instanceof TestMethod) {
throw new ShouldNotHappen();
throw new ShouldNotHappen;
}
if ($this->state->testCaseHasChanged($test)) {

View File

@@ -55,7 +55,7 @@ final class Style
public function __construct(ConsoleOutputInterface $output)
{
if (! $output instanceof ConsoleOutput) {
throw new ShouldNotHappen();
throw new ShouldNotHappen;
}
$this->terminal = terminal();
@@ -173,7 +173,7 @@ final class Style
array_map(function (TestResult $testResult): void {
if (! $testResult->throwable instanceof Throwable) {
throw new ShouldNotHappen();
throw new ShouldNotHappen;
}
renderUsing($this->output);
@@ -327,7 +327,7 @@ final class Style
*/
public function writeError(Throwable $throwable): void
{
$writer = (new Writer())->setOutput($this->output);
$writer = (new Writer)->setOutput($this->output);
$throwable = new TestException($throwable, $this->output->isVerbose());

View File

@@ -303,7 +303,7 @@ if (class_exists(Version::class) && (int) Version::series() >= 10) {
if ($shouldRegister) {
self::$registered = true;
Facade::instance()->registerSubscriber(new self());
Facade::instance()->registerSubscriber(new self);
}
}
}

View File

@@ -63,7 +63,7 @@ final class TestResult
/**
* Creates a new TestResult instance.
*/
private function __construct(string $id, string $testCaseName, string $description, string $type, string $icon, string $compactIcon, string $color, string $compactColor, Throwable $throwable = null)
private function __construct(string $id, string $testCaseName, string $description, string $type, string $icon, string $compactIcon, string $color, string $compactColor, ?Throwable $throwable = null)
{
$this->id = $id;
$this->testCaseName = $testCaseName;
@@ -114,10 +114,10 @@ final class TestResult
/**
* Creates a new test from the given test case.
*/
public static function fromTestCase(Test $test, string $type, Throwable $throwable = null): self
public static function fromTestCase(Test $test, string $type, ?Throwable $throwable = null): self
{
if (! $test instanceof TestMethod) {
throw new ShouldNotHappen();
throw new ShouldNotHappen;
}
if (is_subclass_of($test->className(), HasPrintableTestCaseName::class)) {
@@ -142,10 +142,10 @@ final class TestResult
/**
* Creates a new test from the given Pest Parallel Test Case.
*/
public static function fromPestParallelTestCase(Test $test, string $type, Throwable $throwable = null): self
public static function fromPestParallelTestCase(Test $test, string $type, ?Throwable $throwable = null): self
{
if (! $test instanceof TestMethod) {
throw new ShouldNotHappen();
throw new ShouldNotHappen;
}
if (is_subclass_of($test->className(), HasPrintableTestCaseName::class)) {

View File

@@ -102,7 +102,7 @@ class ConsoleColor
} elseif ($this->isValidStyle($s)) {
$sequences[] = $this->styleSequence($s);
} else {
throw new ShouldNotHappen();
throw new ShouldNotHappen;
}
}
@@ -218,7 +218,10 @@ class ConsoleColor
preg_match(self::COLOR256_REGEXP, $style, $matches);
// @phpstan-ignore-next-line
$type = $matches[1] === 'bg_' ? self::BACKGROUND : self::FOREGROUND;
// @phpstan-ignore-next-line
$value = $matches[2];
return "$type;5;$value";

View File

@@ -7,6 +7,4 @@ namespace NunoMaduro\Collision\Contracts;
/**
* @internal
*/
interface RenderlessEditor
{
}
interface RenderlessEditor {}

View File

@@ -7,6 +7,4 @@ namespace NunoMaduro\Collision\Contracts;
/**
* @internal
*/
interface RenderlessTrace
{
}
interface RenderlessTrace {}

View File

@@ -4,7 +4,7 @@ declare(strict_types=1);
namespace NunoMaduro\Collision\Contracts;
use Spatie\Ignition\Contracts\Solution;
use Spatie\ErrorSolutions\Contracts\Solution;
use Throwable;
/**

View File

@@ -36,7 +36,7 @@ final class Coverage
*/
public static function isAvailable(): bool
{
$runtime = new Runtime();
$runtime = new Runtime;
if (! $runtime->canCollectCodeCoverage()) {
return false;
@@ -60,7 +60,7 @@ final class Coverage
*/
public static function usingXdebug(): bool
{
return (new Runtime())->hasXdebug();
return (new Runtime)->hasXdebug();
}
/**

View File

@@ -22,9 +22,9 @@ final class Handler extends AbstractHandler
/**
* Creates an instance of the Handler.
*/
public function __construct(Writer $writer = null)
public function __construct(?Writer $writer = null)
{
$this->writer = $writer ?: new Writer();
$this->writer = $writer ?: new Writer;
}
/**

View File

@@ -77,9 +77,9 @@ final class Highlighter
/**
* Creates an instance of the Highlighter.
*/
public function __construct(ConsoleColor $color = null, bool $UTF8 = true)
public function __construct(?ConsoleColor $color = null, bool $UTF8 = true)
{
$this->color = $color ?: new ConsoleColor();
$this->color = $color ?: new ConsoleColor;
foreach (self::DEFAULT_THEME as $name => $styles) {
if (! $this->color->hasTheme($name)) {
@@ -249,7 +249,7 @@ final class Highlighter
return $lines;
}
private function lineNumbers(array $lines, int $markLine = null): string
private function lineNumbers(array $lines, ?int $markLine = null): string
{
$lineStrlen = strlen((string) ((int) array_key_last($lines) + 1));
$lineStrlen = $lineStrlen < self::WIDTH ? self::WIDTH : $lineStrlen;

View File

@@ -27,10 +27,10 @@ final class Provider
/**
* Creates a new instance of the Provider.
*/
public function __construct(RunInterface $run = null, Handler $handler = null)
public function __construct(?RunInterface $run = null, ?Handler $handler = null)
{
$this->run = $run ?: new Run();
$this->handler = $handler ?: new Handler();
$this->run = $run ?: new Run;
$this->handler = $handler ?: new Handler;
}
/**

View File

@@ -76,15 +76,15 @@ final class Writer
* Creates an instance of the writer.
*/
public function __construct(
SolutionsRepository $solutionsRepository = null,
OutputInterface $output = null,
ArgumentFormatter $argumentFormatter = null,
Highlighter $highlighter = null
?SolutionsRepository $solutionsRepository = null,
?OutputInterface $output = null,
?ArgumentFormatter $argumentFormatter = null,
?Highlighter $highlighter = null
) {
$this->solutionsRepository = $solutionsRepository ?: new NullSolutionsRepository();
$this->output = $output ?: new ConsoleOutput();
$this->argumentFormatter = $argumentFormatter ?: new ArgumentFormatter();
$this->highlighter = $highlighter ?: new Highlighter();
$this->solutionsRepository = $solutionsRepository ?: new NullSolutionsRepository;
$this->output = $output ?: new ConsoleOutput;
$this->argumentFormatter = $argumentFormatter ?: new ArgumentFormatter;
$this->highlighter = $highlighter ?: new Highlighter;
}
public function write(Inspector $inspector): void