Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
Signed-off-by: Mior Muhammad Zaki <[email protected]>
  • Loading branch information
crynobone committed Jan 10, 2024
1 parent 35246bb commit 9ad7c1a
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 9 deletions.
5 changes: 5 additions & 0 deletions phpstan-baseline.neon
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,8 @@ parameters:
message: "#^Call to an undefined method Illuminate\\\\Contracts\\\\Foundation\\\\Application\\:\\:environmentPath\\(\\)\\.$#"
count: 1
path: src/Bootstrap/LoadEnvironmentVariables.php

-
message: "#^Parameter \\#2 \\$callback of function transform expects callable\\(object\\)\\: mixed, Closure\\(Orchestra\\\\Testbench\\\\Contracts\\\\Attributes\\\\Resolvable\\)\\: mixed given\\.$#"
count: 1
path: src/PHPUnit/AttributeParser.php
6 changes: 3 additions & 3 deletions src/Bootstrap/LoadConfigurationWithWorkbench.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,9 @@ protected function extendsLoadedConfiguration(Collection $configurations): Colle
yield basename($file->getRealPath(), '.php') => $file->getRealPath();
}
})->reject(static fn ($path, $key) => $configurations->has($key))
->each(static function ($path, $key) use ($configurations) {
$configurations->put($key, $path);
});
->each(static function ($path, $key) use ($configurations) {
$configurations->put($key, $path);
});

return $configurations;
}
Expand Down
6 changes: 3 additions & 3 deletions src/Foundation/Bootstrap/LoadMigrationsFromArray.php
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,9 @@ protected function bootstrapMigrations(Application $app): void
$paths = Collection::make(
! \is_bool($this->migrations) ? Arr::wrap($this->migrations) : []
)->when($this->includesDefaultMigrations($app), static fn ($migrations) => $migrations->push(laravel_migration_path()))
->filter(static fn ($migration) => \is_string($migration))
->transform(static fn ($migration) => transform_relative_path($migration, $app->basePath()))
->all();
->filter(static fn ($migration) => \is_string($migration))
->transform(static fn ($migration) => transform_relative_path($migration, $app->basePath()))
->all();

after_resolving($app, 'migrator', static function ($migrator) use ($paths) {
foreach ((array) $paths as $path) {
Expand Down
2 changes: 1 addition & 1 deletion src/Foundation/Config.php
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ public static function loadFromYaml(string $workingPath, ?string $filename = 'te
yield "{$filename}.example";
yield "{$filename}.dist";
})->filter(static fn ($file) => file_exists(join_paths($workingPath, $file)))
->first();
->first();

if (! \is_null($filename)) {
/**
Expand Down
2 changes: 1 addition & 1 deletion src/Foundation/Console/TestCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ public function phpUnitConfigurationFile()
package_path(DIRECTORY_SEPARATOR.$configurationFile),
package_path(DIRECTORY_SEPARATOR.$configurationFile.'.dist'),
])->filter(static fn ($path) => file_exists($path))
->first() ?? './';
->first() ?? './';
}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/Workbench/Workbench.php
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ public static function discoverRoutes(ApplicationContract $app, ConfigContract $
workbench_path('lang'),
workbench_path(join_paths('resources', 'lang')),
])->filter(static fn ($path) => is_dir($path))
->first();
->first();

if (\is_null($path)) {
return;
Expand Down

0 comments on commit 9ad7c1a

Please sign in to comment.