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 9, 2025
1 parent ada34f0 commit d003141
Showing 1 changed file with 18 additions and 9 deletions.
27 changes: 18 additions & 9 deletions src/Workbench.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,15 @@ class Workbench extends \Orchestra\Testbench\Workbench\Workbench
* Get the path to the application (Laravel) folder.
*
* @no-named-arguments
*
* @param array<int, string|null>|string ...$path
*/
public static function applicationPath(array|string $path = ''): string
{
return base_path(
join_paths(...Arr::wrap(\func_num_args() > 1 ? \func_get_args() : $path))
);
/** @var array<int, string|null> $paths */
$paths = Arr::wrap(\func_num_args() > 1 ? \func_get_args() : $path);

return base_path(join_paths(...$paths));
}

/**
Expand All @@ -47,26 +50,32 @@ public static function laravelPath(array|string $path = ''): string
* Get the path to the package folder.
*
* @no-named-arguments
*
* @param array<int, string|null>|string ...$path
*/
public static function packagePath(array|string $path = ''): string
{
$path = Arr::wrap(\func_num_args() > 1 ? \func_get_args() : $path);
/** @var array<int, string|null> $paths */
$paths = Arr::wrap(\func_num_args() > 1 ? \func_get_args() : $path);

/** @phpstan-ignore argument.named */
return package_path(...$path);
/** @phpstan-ignore argument.type */
return package_path(...$paths);
}

/**
* Get the path to the workbench folder.
*
* @no-named-arguments
*
* @param array<int, string|null>|string ...$path
*/
public static function path(array|string $path = ''): string
{
$path = Arr::wrap(\func_num_args() > 1 ? \func_get_args() : $path);
/** @var array<int, string|null> $paths */
$paths = Arr::wrap(\func_num_args() > 1 ? \func_get_args() : $path);

/** @phpstan-ignore argument.named */
return workbench_path(...$path);
/** @phpstan-ignore argument.type */
return workbench_path(...$paths);
}

/**
Expand Down

0 comments on commit d003141

Please sign in to comment.