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 18, 2023
1 parent 76b7840 commit 516bcce
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 13 deletions.
5 changes: 4 additions & 1 deletion composer.json
Expand Up @@ -66,11 +66,14 @@
"@composer run clear",
"@composer run prepare"
],
"prepare": "@php testbench package:discover --ansi",
"clear": "@php testbench package:purge-skeleton --ansi",
"prepare": "@php testbench package:discover --ansi",
"ci": [
"@composer audit",
"@composer run prepare",
"@composer run lint"
],
"lint": [
"@php vendor/bin/pint",
"@php vendor/bin/phpstan analyse"
],
Expand Down
2 changes: 1 addition & 1 deletion src/Concerns/WithWorkbench.php
Expand Up @@ -23,7 +23,7 @@ protected function setUpWithWorkbench(): void
/** @var \Orchestra\Testbench\Contracts\Config $config */
$config = static::$cachedConfigurationForWorkbench ?? new Config();

(new StartWorkbench($config))->bootstrap($app);
(new StartWorkbench(config: $config, loadWorkbenchProviders: false))->bootstrap($app);

(new LoadMigrationsFromArray(
$config['migrations'] ?? [], $config['seeders'] ?? false,
Expand Down
18 changes: 7 additions & 11 deletions src/Foundation/Bootstrap/StartWorkbench.php
Expand Up @@ -11,21 +11,17 @@
*/
final class StartWorkbench
{
/**
* The project configuration.
*
* @var \Orchestra\Testbench\Contracts\Config
*/
public $config;

/**
* Construct a new Create Vendor Symlink bootstrapper.
*
* @param \Orchestra\Testbench\Contracts\Config $config
* @param bool $loadWorkbenchProviders
*/
public function __construct(Config $config)
{
$this->config = $config;
public function __construct(
public Config $config,
public bool $loadWorkbenchProviders = true
) {
//
}

/**
Expand All @@ -38,7 +34,7 @@ public function bootstrap(Application $app): void
{
$app->instance(Config::class, $this->config);

if (class_exists(WorkbenchServiceProvider::class)) {
if ($this->loadWorkbenchProviders === true && class_exists(WorkbenchServiceProvider::class)) {
$app->register(WorkbenchServiceProvider::class);
}
}
Expand Down

0 comments on commit 516bcce

Please sign in to comment.