Skip to content

Commit 7d82a57

Browse files
committed
Rename services
1 parent 4b45f15 commit 7d82a57

File tree

7 files changed

+20
-20
lines changed

7 files changed

+20
-20
lines changed

src/Http/HttpRequestHandler.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ private function handle(ServerRequestInterface $request): ResponseInterface
6464
$symfonyResponse = $this->kernel->handle($symfonyRequest);
6565

6666
/** @var WorkerProcess $worker */
67-
$worker = $this->kernel->getContainer()->get('phprunner.worker');
67+
$worker = $this->kernel->getContainer()->get('phpstreamserver.worker');
6868

6969
if ($this->kernel instanceof TerminableInterface) {
7070
$worker->getEventLoop()->defer(function () use ($symfonyRequest, $symfonyResponse): void {

src/Internal/WorkerConfigurator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,6 @@ public function configure(WorkerProcess $worker): void
3535
$worker->setLogger($this->logger);
3636
$worker->setErrorHandler($errorHandlerClosure);
3737

38-
$this->kernel->getContainer()->set('phprunner.worker', $worker);
38+
$this->kernel->getContainer()->set('phpstreamserver.worker', $worker);
3939
}
4040
}

src/Worker/HttpServerWorker.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,10 @@ private function onStart(): void
4949
{
5050
$kernel = $this->kernelFactory->createKernel();
5151
$kernel->boot();
52-
$kernel->getContainer()->get('phprunner.worker_configurator')->configure($this);
52+
$kernel->getContainer()->get('phpstreamserver.worker_configurator')->configure($this);
5353

5454
/** @var \Closure $httpHandler */
55-
$httpHandler = $kernel->getContainer()->get('phprunner.http_request_handler');
55+
$httpHandler = $kernel->getContainer()->get('phpstreamserver.http_request_handler');
5656

5757
/** @var EventDispatcherInterface $eventDispatcher */
5858
$eventDispatcher = $kernel->getContainer()->get('event_dispatcher');

src/Worker/ProcessWorker.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,9 @@ private function onStart(): void
3333
{
3434
$kernel = $this->kernelFactory->createKernel();
3535
$kernel->boot();
36-
$kernel->getContainer()->get('phprunner.worker_configurator')->configure($this);
36+
$kernel->getContainer()->get('phpstreamserver.worker_configurator')->configure($this);
3737
/** @var Application $application */
38-
$application = $kernel->getContainer()->get('phprunner.application');
38+
$application = $kernel->getContainer()->get('phpstreamserver.application');
3939

4040
/** @psalm-suppress RiskyTruthyFalsyComparison */
4141
if ($application->has(\strstr($this->command, ' ', true) ?: $this->command)) {

src/Worker/SchedulerWorker.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ private function onStart(): void
3939
{
4040
$this->kernel = $this->kernelFactory->createKernel();
4141
$this->kernel->boot();
42-
$this->kernel->getContainer()->get('phprunner.worker_configurator')->configure($this);
42+
$this->kernel->getContainer()->get('phpstreamserver.worker_configurator')->configure($this);
4343

4444
/**
4545
* @var string|null $name
@@ -109,7 +109,7 @@ private function runCommand(TriggerInterface $trigger, string $name, string $com
109109
}
110110

111111
/** @var Application $application */
112-
$application = $this->kernel->getContainer()->get('phprunner.application');
112+
$application = $this->kernel->getContainer()->get('phpstreamserver.application');
113113

114114
/** @psalm-suppress RiskyTruthyFalsyComparison */
115115
if ($application->has(\strstr($command, ' ', true) ?: $command)) {

src/config/services.php

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919
return static function (array $config, ContainerBuilder $container) {
2020
$container
21-
->register('phprunner.config_loader', ConfigLoader::class)
21+
->register('phpstreamserver.config_loader', ConfigLoader::class)
2222
->addMethodCall('setConfig', [$config])
2323
->addTag('kernel.cache_warmer')
2424
->setArguments([
@@ -29,19 +29,19 @@
2929
;
3030

3131
$container
32-
->register('phprunner.http_request_handler', HttpRequestHandler::class)
32+
->register('phpstreamserver.http_request_handler', HttpRequestHandler::class)
3333
->setArguments([new Reference('kernel')])
3434
->setPublic(true)
3535
;
3636

3737
$container
38-
->register('phprunner.worker_configurator', WorkerConfigurator::class)
38+
->register('phpstreamserver.worker_configurator', WorkerConfigurator::class)
3939
->setArguments([new Reference('kernel'), new Reference('logger')])
4040
->setPublic(true)
4141
;
4242

4343
$container
44-
->register('phprunner.application', Application::class)
44+
->register('phpstreamserver.application', Application::class)
4545
->addMethodCall('setAutoExit', [false])
4646
->setArguments([new Reference('kernel')])
4747
->setShared(false)
@@ -50,7 +50,7 @@
5050

5151
if ($config['reload_strategy']['on_exception']['active']) {
5252
$container
53-
->register('phprunner.on_exception_reload_strategy', OnException::class)
53+
->register('phpstreamserver.on_exception_reload_strategy', OnException::class)
5454
->addTag('kernel.event_listener', [
5555
'event' => HttpServerStartEvent::class,
5656
'method' => 'onServerStart',
@@ -68,7 +68,7 @@
6868

6969
if ($config['reload_strategy']['on_each_request']['active']) {
7070
$container
71-
->register('phprunner.on_each_request_reload_strategy', OnEachRequest::class)
71+
->register('phpstreamserver.on_each_request_reload_strategy', OnEachRequest::class)
7272
->addTag('kernel.event_listener', [
7373
'event' => HttpServerStartEvent::class,
7474
'method' => 'onServerStart',
@@ -78,7 +78,7 @@
7878

7979
if ($config['reload_strategy']['on_ttl_limit']['active']) {
8080
$container
81-
->register('phprunner.on_ttl_limit_reload_strategy', OnTTLLimit::class)
81+
->register('phpstreamserver.on_ttl_limit_reload_strategy', OnTTLLimit::class)
8282
->addTag('kernel.event_listener', [
8383
'event' => HttpServerStartEvent::class,
8484
'method' => 'onServerStart',
@@ -91,7 +91,7 @@
9191

9292
if ($config['reload_strategy']['on_requests_limit']['active']) {
9393
$container
94-
->register('phprunner.on_requests_limit_reload_strategy', OnRequestsLimit::class)
94+
->register('phpstreamserver.on_requests_limit_reload_strategy', OnRequestsLimit::class)
9595
->addTag('kernel.event_listener', [
9696
'event' => HttpServerStartEvent::class,
9797
'method' => 'onServerStart',
@@ -105,7 +105,7 @@
105105

106106
if ($config['reload_strategy']['on_memory_limit']['active']) {
107107
$container
108-
->register('phprunner.on_on_memory_limit_reload_strategy', OnMemoryLimit::class)
108+
->register('phpstreamserver.on_on_memory_limit_reload_strategy', OnMemoryLimit::class)
109109
->addTag('kernel.event_listener', [
110110
'event' => HttpServerStartEvent::class,
111111
'method' => 'onServerStart',

tests/ServicesAutowiringTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ public function testServiceAutowiring(): void
1515
{
1616
$container = self::getContainer();
1717

18-
$this->assertInstanceOf(HttpRequestHandler::class, $container->get('phprunner.http_request_handler'));
19-
$this->assertInstanceOf(WorkerConfigurator::class, $container->get('phprunner.worker_configurator'));
20-
$this->assertInstanceOf(Application::class, $container->get('phprunner.application'));
18+
$this->assertInstanceOf(HttpRequestHandler::class, $container->get('phpstreamserver.http_request_handler'));
19+
$this->assertInstanceOf(WorkerConfigurator::class, $container->get('phpstreamserver.worker_configurator'));
20+
$this->assertInstanceOf(Application::class, $container->get('phpstreamserver.application'));
2121
}
2222
}

0 commit comments

Comments
 (0)