🔧
This commit is contained in:
0
vendor/nunomaduro/collision/LICENSE.md
vendored
Normal file → Executable file
0
vendor/nunomaduro/collision/LICENSE.md
vendored
Normal file → Executable file
30
vendor/nunomaduro/collision/composer.json
vendored
30
vendor/nunomaduro/collision/composer.json
vendored
@@ -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": {
|
||||
|
||||
@@ -48,7 +48,7 @@ class CollisionServiceProvider extends ServiceProvider
|
||||
|
||||
$solutionsRepository = new IgnitionSolutionsRepository($solutionProviderRepository);
|
||||
} else {
|
||||
$solutionsRepository = new NullSolutionsRepository();
|
||||
$solutionsRepository = new NullSolutionsRepository;
|
||||
}
|
||||
|
||||
$writer = new Writer($solutionsRepository);
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
|
||||
@@ -11,6 +11,4 @@ use RuntimeException;
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
final class NotSupportedYetException extends RuntimeException implements RenderlessEditor, RenderlessTrace
|
||||
{
|
||||
}
|
||||
final class NotSupportedYetException extends RuntimeException implements RenderlessEditor, RenderlessTrace {}
|
||||
|
||||
@@ -11,6 +11,4 @@ use RuntimeException;
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
final class RequirementsException extends RuntimeException implements RenderlessEditor, RenderlessTrace
|
||||
{
|
||||
}
|
||||
final class RequirementsException extends RuntimeException implements RenderlessEditor, RenderlessTrace {}
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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)) {
|
||||
|
||||
@@ -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());
|
||||
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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)) {
|
||||
|
||||
@@ -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";
|
||||
|
||||
@@ -7,6 +7,4 @@ namespace NunoMaduro\Collision\Contracts;
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
interface RenderlessEditor
|
||||
{
|
||||
}
|
||||
interface RenderlessEditor {}
|
||||
|
||||
@@ -7,6 +7,4 @@ namespace NunoMaduro\Collision\Contracts;
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
interface RenderlessTrace
|
||||
{
|
||||
}
|
||||
interface RenderlessTrace {}
|
||||
|
||||
@@ -4,7 +4,7 @@ declare(strict_types=1);
|
||||
|
||||
namespace NunoMaduro\Collision\Contracts;
|
||||
|
||||
use Spatie\Ignition\Contracts\Solution;
|
||||
use Spatie\ErrorSolutions\Contracts\Solution;
|
||||
use Throwable;
|
||||
|
||||
/**
|
||||
|
||||
4
vendor/nunomaduro/collision/src/Coverage.php
vendored
4
vendor/nunomaduro/collision/src/Coverage.php
vendored
@@ -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();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
4
vendor/nunomaduro/collision/src/Handler.php
vendored
4
vendor/nunomaduro/collision/src/Handler.php
vendored
@@ -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;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -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;
|
||||
|
||||
6
vendor/nunomaduro/collision/src/Provider.php
vendored
6
vendor/nunomaduro/collision/src/Provider.php
vendored
@@ -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;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
16
vendor/nunomaduro/collision/src/Writer.php
vendored
16
vendor/nunomaduro/collision/src/Writer.php
vendored
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user