Skip to content

Commit 1a7986b

Browse files
authored
Rename Agent to match Laravel's naming conventions (#103)
1 parent 4de70d6 commit 1a7986b

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

src/Console/Agent.php src/Console/AgentCommand.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
* @internal
2424
*/
2525
#[AsCommand(name: 'nightwatch:agent')]
26-
final class Agent extends Command
26+
final class AgentCommand extends Command
2727
{
2828
/**
2929
* @var string

src/Factories/AgentFactory.php

+4-4
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
use Illuminate\Contracts\Foundation\Application;
66
use Illuminate\Support\Env;
77
use Laravel\Nightwatch\Buffers\StreamBuffer;
8-
use Laravel\Nightwatch\Console\Agent;
8+
use Laravel\Nightwatch\Console\AgentCommand;
99

1010
use function is_string;
1111
use function rtrim;
@@ -38,7 +38,7 @@ public function __construct(
3838
//
3939
}
4040

41-
public function __invoke(Application $app): Agent
41+
public function __invoke(Application $app): AgentCommand
4242
{
4343
$debug = (bool) Env::get('NIGHTWATCH_DEBUG');
4444

@@ -47,7 +47,7 @@ public function __invoke(Application $app): Agent
4747
// constructed, which will happen when running the `php artisan list`
4848
// command, we make sure to resolve the server only when actually
4949
// running the command.
50-
$app->bindMethod([Agent::class, 'handle'], function (Agent $agent, Application $app) use ($debug): void {
50+
$app->bindMethod([AgentCommand::class, 'handle'], function (AgentCommand $agent, Application $app) use ($debug): void {
5151
$base = $agent->option('base-url');
5252

5353
if (! is_string($base)) {
@@ -65,6 +65,6 @@ public function __invoke(Application $app): Agent
6565
);
6666
});
6767

68-
return new Agent(new StreamBuffer, $debug ? 1 : 10);
68+
return new AgentCommand(new StreamBuffer, $debug ? 1 : 10);
6969
}
7070
}

src/NightwatchServiceProvider.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
use Illuminate\Support\Env;
3939
use Illuminate\Support\ServiceProvider;
4040
use Illuminate\Support\Str;
41-
use Laravel\Nightwatch\Console\Agent;
41+
use Laravel\Nightwatch\Console\AgentCommand;
4242
use Laravel\Nightwatch\Contracts\LocalIngest;
4343
use Laravel\Nightwatch\Factories\AgentFactory;
4444
use Laravel\Nightwatch\Factories\Logger;
@@ -187,7 +187,7 @@ private function registerLogger(): void
187187

188188
private function registerAgent(): void
189189
{
190-
$this->app->singleton(Agent::class, (new AgentFactory($this->nightwatchConfig))(...));
190+
$this->app->singleton(AgentCommand::class, (new AgentFactory($this->nightwatchConfig))(...));
191191
}
192192

193193
private function registerMiddleware(): void
@@ -232,7 +232,7 @@ private function registerPublications(): void
232232
private function registerCommands(): void
233233
{
234234
$this->commands([
235-
Console\Agent::class,
235+
Console\AgentCommand::class,
236236
]);
237237
}
238238

0 commit comments

Comments
 (0)