Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
Signed-off-by: Mior Muhammad Zaki <crynobone@gmail.com>
  • Loading branch information
crynobone committed Aug 26, 2024
1 parent 4e88bd6 commit 32707fd
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 7 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"laravel/framework": "^9.52.9 || ^10.48.2",
"laravel/tinker": "^2.8.2",
"orchestra/canvas": "^7.11.1 || ^8.11.9",
"orchestra/testbench-core": "^7.44 || ^8.25",
"orchestra/testbench-core": "^7.46 || ^8.27",
"spatie/laravel-ray": "^1.32.4",
"symfony/polyfill-php83": "^1.28",
"symfony/yaml": "^6.0.9"
Expand Down
20 changes: 14 additions & 6 deletions src/Workbench.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

namespace Orchestra\Workbench;

use Illuminate\Support\Arr;

/**
* @phpstan-import-type TWorkbenchConfig from \Orchestra\Testbench\Foundation\Config
*/
Expand All @@ -10,25 +12,31 @@ class Workbench
/**
* Get the path to the laravel folder.
*/
public static function laravelPath(string $path = ''): string
public static function laravelPath(array|string $path = ''): string
{
return app()->basePath($path);
return app()->basePath(
\Orchestra\Testbench\join_paths(...Arr::wrap(\func_num_args() > 1 ? \func_get_args() : $path))
);
}

/**
* Get the path to the package folder.
*/
public static function packagePath(string $path = ''): string
public static function packagePath(array|string $path = ''): string
{
return \Orchestra\Testbench\package_path($path);
return \Orchestra\Testbench\package_path(
...Arr::wrap(\func_num_args() > 1 ? \func_get_args() : $path)
);
}

/**
* Get the path to the workbench folder.
*/
public static function path(string $path = ''): string
public static function path(array|string $path = ''): string
{
return \Orchestra\Testbench\workbench_path($path);
return \Orchestra\Testbench\workbench_path(
...Arr::wrap(\func_num_args() > 1 ? \func_get_args() : $path)
);
}

/**
Expand Down

0 comments on commit 32707fd

Please sign in to comment.