Skip to content

Commit cccf19e

Browse files
committed
#74 stabilize clients events of api settings
1 parent 0ba14f6 commit cccf19e

File tree

4 files changed

+9
-13
lines changed

4 files changed

+9
-13
lines changed

app/src/Application/Bootloader/AppBootloader.php

+2-8
Original file line numberDiff line numberDiff line change
@@ -45,14 +45,8 @@ public function defineSingletons(): array
4545

4646
Settings::class => fn(
4747
EnvironmentInterface $env,
48-
): AppVersion => new AppVersion(
49-
version: $env->get('APP_VERSION', 'dev'),
50-
),
51-
52-
ClientSettings::class => fn(
53-
EnvironmentInterface $env,
54-
): ClientSettings => new ClientSettings(
55-
version: $env->get('CLIENT_SUPPORTED_EVENTS', 'http-dump,inspector,monolog,profiler,ray,sentry,smtp,var-dump'),
48+
): Settings => new Settings(
49+
supportedEvents: $env->get('CLIENT_SUPPORTED_EVENTS', 'http-dump,inspector,monolog,profiler,ray,sentry,smtp,var-dump'),
5650
),
5751
];
5852
}

app/src/Application/Client/Settings.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
use Spiral\Core\Attribute\Singleton;
88

99
#[Singleton]
10-
final readonly class ClientSettings
10+
final readonly class Settings
1111
{
1212
public function __construct(
1313
public string $supportedEvents,

app/src/Interfaces/Http/Controller/SettingsAction.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ public function __invoke(
2121
AuthSettings $settings,
2222
UrlTemplate $ideUrl,
2323
AppVersion $appVersion,
24-
ClientSettings $clientSettings,
24+
Settings $clientSettings,
2525
): ResourceInterface {
26-
$supportedEvents = \explode(',', $clientSettings->supportedEvents);
26+
$supportedEvents = \array_filter(\explode(',', $clientSettings->supportedEvents));
2727

2828
return new JsonResource([
2929
'auth' => [

docker-compose.yaml

+4-2
Original file line numberDiff line numberDiff line change
@@ -53,14 +53,16 @@ services:
5353
AUTH_SCOPES: openid,email,profile
5454

5555
# Client
56-
CLIENT_SUPPORTED_EVENTS: ${CLIENT_SUPPORTED_EVENTS}
56+
CLIENT_SUPPORTED_EVENTS: http-dump,inspector,monolog,profiler,ray,sentry,smtp,var-dump
5757
labels:
5858
- "traefik.enable=true"
5959
- "traefik.http.routers.buggregator-http.entrypoints=web"
6060
- "traefik.http.routers.buggregator-http.rule=Host(`buggregator.localhost`)"
6161
- "traefik.http.services.buggregator-http.loadbalancer.server.port=8000"
6262
volumes:
63-
- ./:/app
63+
- ./app:/app/app
64+
- ./runtime:/app/runtime
65+
- ./vendor:/app/vendor
6466
networks:
6567
- buggregator-network
6668

0 commit comments

Comments
 (0)