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 Jul 13, 2024
1 parent 7e5f7df commit 4609c89
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 7 deletions.
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@
"laravel/dusk": "^8.1",
"laravel/serializable-closure": "^1.0",
"orchestra/dusk-updater": "^2.4",
"orchestra/testbench": "^9.1.2",
"orchestra/testbench-core": ">=9.1.3 <9.2.0",
"orchestra/testbench": "^9.2",
"orchestra/testbench-core": "9.x-dev",
"php-webdriver/webdriver": "^1.15.1",
"symfony/polyfill-php83": "^1.28"
},
Expand Down
16 changes: 12 additions & 4 deletions src/Concerns/CanServeSite.php
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,13 @@ public function beforeServingApplication(Closure|string $closure): void
$app = $this->app;

after_resolving($app, 'config', function ($config, $app) use ($closure) {
/**
* @var \Illuminate\Foundation\Application $app
* @var \Illuminate\Contracts\Config\Repository $config
*/
\is_string($closure) && method_exists($this, $closure)
? $this->{$closure}($app, $config)
: value($closure, $app, $config);
? call_user_func([$this, $closure], $app, $config) // @phpstan-ignore argument.type
: value($closure, $app, $config); // @phpstan-ignore argument.type
});

static::$server?->stash([
Expand Down Expand Up @@ -177,9 +181,13 @@ public function createServingApplicationForDuskServer(DuskServer $server)
$closure = \is_string($serializedClosure) ? $serializedClosure : $serializedClosure->getClosure();

after_resolving($app, 'config', function ($config, $app) use ($closure) {
/**
* @var \Illuminate\Foundation\Application $app
* @var \Illuminate\Contracts\Config\Repository $config
*/
\is_string($closure) && method_exists($this, $closure)
? $this->{$closure}($app, $config)
: value($closure, $app, $config);
? call_user_func([$this, $closure], $app, $config) // @phpstan-ignore argument.type
: value($closure, $app, $config); // @phpstan-ignore argument.type
});
}

Expand Down
3 changes: 2 additions & 1 deletion src/TestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,8 @@ protected function registerShutdownFunction()
* @param \Illuminate\Foundation\Application $app
* @return void
*/
private function resolveApplicationResolvingCallback($app): void
#[\Override]
protected function resolveApplicationResolvingCallback($app): void
{
$app->bind(
'Illuminate\Foundation\Bootstrap\LoadConfiguration',
Expand Down

0 comments on commit 4609c89

Please sign in to comment.