Skip to content

Commit

Permalink
Merge branch '8.x' into develop
Browse files Browse the repository at this point in the history
Signed-off-by: Mior Muhammad Zaki <[email protected]>
  • Loading branch information
crynobone committed Jul 24, 2024
2 parents 380518b + 1fa5042 commit b29f712
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
"symfony/polyfill-php83": "^1.28"
},
"require-dev": {
"laravel/pint": "^1.6",
"laravel/pint": "^1.17",
"laravel/tinker": "^2.9",
"phpstan/phpstan": "^1.11",
"phpunit/phpunit": "^10.5 || ^11.0"
Expand Down
2 changes: 1 addition & 1 deletion src/DuskServer.php
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ protected function guardServerStarting(): void
protected function prepareCommand(): array
{
return [
(string) (new PhpExecutableFinder())->find(false),
(string) (new PhpExecutableFinder)->find(false),
'-S',
sprintf('%s:%s', $this->host, $this->port),
join_paths(__DIR__, 'server.php'),
Expand Down
8 changes: 4 additions & 4 deletions src/Options.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ public static function using($callback)
{
static::$chromeOptionsCallback = $callback;

return new static();
return new static;
}

/**
Expand All @@ -86,7 +86,7 @@ public static function addArgument(string $argument)
array_push(static::$arguments, $argument);
}

return new static();
return new static;
}

/**
Expand All @@ -100,7 +100,7 @@ public static function removeArgument(string $argument)
static::$arguments = array_values(array_filter(static::$arguments, static fn ($option) => $option !== $argument));
}

return new static();
return new static;
}

/**
Expand Down Expand Up @@ -246,7 +246,7 @@ public static function userAgent(string $useragent)
*/
public static function getChromeOptions()
{
return tap(new ChromeOptions(), static function ($option) {
return tap(new ChromeOptions, static function ($option) {
if (static::$w3cCompliant === false) {
$option->setExperimentalOption('w3c', static::$w3cCompliant);
}
Expand Down
4 changes: 2 additions & 2 deletions tests/Unit/Concerns/CanServeSiteTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class CanServeSiteTest extends TestCase
#[Test]
public function it_starts_and_stops_a_server()
{
$dummy = new CanServeSiteDummy();
$dummy = new CanServeSiteDummy;

$dummy::serve('127.0.0.1', 8001);

Expand All @@ -33,7 +33,7 @@ public function it_starts_and_stops_a_server()
#[Test]
public function it_stops_an_existing_server_and_starts_a_new_one_with_consecutive_serve_requests()
{
$dummy = new CanServeSiteDummy();
$dummy = new CanServeSiteDummy;

$dummy::serve('127.0.0.1', 8001);

Expand Down
12 changes: 6 additions & 6 deletions tests/Unit/DuskServerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@ public function it_provides_the_laravel_public_directory()
{
$this->assertEquals(
realpath(__DIR__.'/../../laravel'),
(new DuskServer())->basePath()
(new DuskServer)->basePath()
);
}

#[Test]
public function it_provides_the_laravel_public_directory_from_custom_location()
{
$server = new DuskServer();
$server = new DuskServer;
$server->setLaravel(basePath: '/dir/project/laravel');

$this->assertEquals(
Expand All @@ -33,8 +33,8 @@ public function it_provides_the_laravel_public_directory_from_custom_location()
public function it_fails_when_there_is_a_server_on_the_host_and_port_already()
{
try {
$a = new DuskServer();
$b = new DuskServer();
$a = new DuskServer;
$b = new DuskServer;

$a->start();
$this->waitForServerToStart();
Expand Down Expand Up @@ -69,15 +69,15 @@ public function an_early_exit_does_not_leave_an_orphan_server()
// We have everything from the script so far available
// So create a server and exit (to simluate a dd() or similar in a test)
// Once complete, the parent can check for the orpahn server.
(new DuskServer())->start();
(new DuskServer)->start();
$this->waitForServerToStart();
exit();
break;
default:
// @parent
pcntl_waitpid($pid, $status);
try {
(new DuskServer())->start();
(new DuskServer)->start();
$this->assertTrue(true, 'We did not end up with an orphan server');
} catch (UnableToStartServer $e) {
$this->fail('There was an orphan server. You\'ll need to remove it manually.');
Expand Down

0 comments on commit b29f712

Please sign in to comment.