@@ -13,13 +13,13 @@ |
||
13 | 13 | public function allowRequest(Request $request): bool |
14 | 14 | { |
15 | 15 | if (Config::get('jaravel.http.allow_request')) { |
16 | - if (!Caller::call(Config::get('jaravel.http.allow_request'), [$request])) { |
|
16 | + if (!Caller::call(Config::get('jaravel.http.allow_request'), [ $request ])) { |
|
17 | 17 | return false; |
18 | 18 | } |
19 | 19 | } |
20 | 20 | |
21 | 21 | if (Config::get('jaravel.http.deny_request')) { |
22 | - if (Caller::call(Config::get('jaravel.http.deny_request'), [$request])) { |
|
22 | + if (Caller::call(Config::get('jaravel.http.deny_request'), [ $request ])) { |
|
23 | 23 | return false; |
24 | 24 | } |
25 | 25 | } |
@@ -31,7 +31,7 @@ |
||
31 | 31 | return $command; |
32 | 32 | } |
33 | 33 | |
34 | - $command->{$tracingContextField} = []; |
|
34 | + $command->{$tracingContextField} = [ ]; |
|
35 | 35 | $this->tracer->inject($span->getContext(), Formats\TEXT_MAP, $command->{$tracingContextField}); |
36 | 36 | |
37 | 37 | return $command; |
@@ -19,9 +19,9 @@ |
||
19 | 19 | |
20 | 20 | public function allow(): bool |
21 | 21 | { |
22 | - $filteredCommands = Config::get('jaravel.console.filter_commands', ['schedule:run', 'horizon', 'queue:']); |
|
22 | + $filteredCommands = Config::get('jaravel.console.filter_commands', [ 'schedule:run', 'horizon', 'queue:' ]); |
|
23 | 23 | |
24 | - $command = $this->request->server('argv')[1] ?? ''; |
|
24 | + $command = $this->request->server('argv')[ 1 ] ?? ''; |
|
25 | 25 | |
26 | 26 | return !Str::contains($command, $filteredCommands); |
27 | 27 | } |
@@ -17,19 +17,19 @@ |
||
17 | 17 | { |
18 | 18 | public static function create(): callable |
19 | 19 | { |
20 | - return function (callable $handler) { |
|
21 | - return function (RequestInterface $request, array $options) use ($handler) { |
|
20 | + return function(callable $handler) { |
|
21 | + return function(RequestInterface $request, array $options) use ($handler) { |
|
22 | 22 | /** @var Tracer $tracer */ |
23 | 23 | $tracer = App::make(Tracer::class); |
24 | 24 | /** @var SpanCreator $spanCreator */ |
25 | 25 | $spanCreator = App::make(SpanCreator::class); |
26 | 26 | |
27 | - $span = $spanCreator->create(Caller::call(Config::get('jaravel.guzzle.span_name'), [$request])); |
|
27 | + $span = $spanCreator->create(Caller::call(Config::get('jaravel.guzzle.span_name'), [ $request ])); |
|
28 | 28 | |
29 | - $headers = []; |
|
29 | + $headers = [ ]; |
|
30 | 30 | $tracer->inject($span->getContext(), Formats\TEXT_MAP, $headers); |
31 | 31 | |
32 | - SpanTagHelper::setTags($span, Caller::call(Config::get('jaravel.guzzle.tags'), [$request])); |
|
32 | + SpanTagHelper::setTags($span, Caller::call(Config::get('jaravel.guzzle.tags'), [ $request ])); |
|
33 | 33 | |
34 | 34 | foreach ($headers as $name => $value) { |
35 | 35 | $request = $request->withHeader($name, $value); |
@@ -35,8 +35,8 @@ discard block |
||
35 | 35 | * Describes configuration for incoming Http requests |
36 | 36 | */ |
37 | 37 | 'http' => [ |
38 | - 'span_name' => fn (Request $request) => 'App: ' . $request->path(), |
|
39 | - 'tags' => fn (Request $request, Response $response) => [ |
|
38 | + 'span_name' => fn(Request $request) => 'App: ' . $request->path(), |
|
39 | + 'tags' => fn(Request $request, Response $response) => [ |
|
40 | 40 | 'type' => 'http', |
41 | 41 | 'request_host' => $request->getHost(), |
42 | 42 | 'request_path' => $request->path(), |
@@ -50,9 +50,9 @@ discard block |
||
50 | 50 | * Describes configuration for console commands |
51 | 51 | */ |
52 | 52 | 'console' => [ |
53 | - 'span_name' => fn (string $command, ?InputInterface $input = null) => 'Console: ' . $command, |
|
54 | - 'filter_commands' => ['schedule:run', 'horizon', 'queue:'], |
|
55 | - 'tags' => fn (string $command, int $exitCode, ?InputInterface $input = null, ?OutputInterface $output = null) => [ |
|
53 | + 'span_name' => fn(string $command, ?InputInterface $input = null) => 'Console: ' . $command, |
|
54 | + 'filter_commands' => [ 'schedule:run', 'horizon', 'queue:' ], |
|
55 | + 'tags' => fn(string $command, int $exitCode, ?InputInterface $input = null, ?OutputInterface $output = null) => [ |
|
56 | 56 | 'type' => 'console', |
57 | 57 | 'console_command' => $command, |
58 | 58 | 'console_exit_code' => $exitCode, |
@@ -63,8 +63,8 @@ discard block |
||
63 | 63 | * Describes configuration for queued jobs |
64 | 64 | */ |
65 | 65 | 'job' => [ |
66 | - 'span_name' => fn ($realJob, ?Job $job) => 'Job: ' . get_class($realJob), |
|
67 | - 'tags' => fn ($realJob, ?Job $job) => [ |
|
66 | + 'span_name' => fn($realJob, ?Job $job) => 'Job: ' . get_class($realJob), |
|
67 | + 'tags' => fn($realJob, ?Job $job) => [ |
|
68 | 68 | 'type' => 'job', |
69 | 69 | 'job_class' => get_class($realJob), |
70 | 70 | 'job_id' => optional($job) |
@@ -22,7 +22,7 @@ |
||
22 | 22 | { |
23 | 23 | $this->spanCreator |
24 | 24 | ->create( |
25 | - Caller::call(ConfigRepository::get('jaravel.console.span_name'), [$event->command, $event->input]) |
|
25 | + Caller::call(ConfigRepository::get('jaravel.console.span_name'), [ $event->command, $event->input ]) |
|
26 | 26 | ); |
27 | 27 | } |
28 | 28 | } |
@@ -26,13 +26,13 @@ |
||
26 | 26 | return; |
27 | 27 | } |
28 | 28 | |
29 | - $callableConfig = Config::get('jaravel.console.tags', fn () => [ |
|
29 | + $callableConfig = Config::get('jaravel.console.tags', fn() => [ |
|
30 | 30 | 'type' => 'console', |
31 | 31 | ]); |
32 | 32 | |
33 | 33 | SpanTagHelper::setTags( |
34 | 34 | $span, |
35 | - Caller::call($callableConfig, [$event->command, $event->exitCode, $event->input, $event->output]) |
|
35 | + Caller::call($callableConfig, [ $event->command, $event->exitCode, $event->input, $event->output ]) |
|
36 | 36 | ); |
37 | 37 | |
38 | 38 | optional($this->tracer->getScopeManager()->getActive()) |
@@ -42,7 +42,7 @@ discard block |
||
42 | 42 | public function extendJobsDispatcher(): void |
43 | 43 | { |
44 | 44 | $dispatcher = $this->app->make(Dispatcher::class); |
45 | - $this->app->extend(Dispatcher::class, function () use ($dispatcher) { |
|
45 | + $this->app->extend(Dispatcher::class, function() use ($dispatcher) { |
|
46 | 46 | return $this->app->make(JobWithTracingInjectionDispatcher::class, [ |
47 | 47 | 'dispatcher' => $dispatcher, |
48 | 48 | ]); |
@@ -77,7 +77,7 @@ discard block |
||
77 | 77 | return; |
78 | 78 | } |
79 | 79 | |
80 | - Event::listen(MessageLogged::class, function (MessageLogged $e) { |
|
80 | + Event::listen(MessageLogged::class, function(MessageLogged $e) { |
|
81 | 81 | $span = $this->app->make(Tracer::class)->getActiveSpan(); |
82 | 82 | if (!$span) { |
83 | 83 | return; |
@@ -5,13 +5,13 @@ |
||
5 | 5 | use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; |
6 | 6 | use Symplify\EasyCodingStandard\ValueObject\Option; |
7 | 7 | |
8 | -return static function (ContainerConfigurator $containerConfigurator): void { |
|
8 | +return static function(ContainerConfigurator $containerConfigurator): void { |
|
9 | 9 | $containerConfigurator->import(__DIR__ . '/vendor/umbrellio/code-style-php/umbrellio-cs.php'); |
10 | 10 | |
11 | 11 | $parameters = $containerConfigurator->parameters(); |
12 | 12 | |
13 | 13 | $parameters->set(Option::CACHE_DIRECTORY, '.ecs_cache'); |
14 | - $parameters->set(Option::FILE_EXTENSIONS, ['php']); |
|
14 | + $parameters->set(Option::FILE_EXTENSIONS, [ 'php' ]); |
|
15 | 15 | |
16 | - $parameters->set(Option::PATHS, [__DIR__ . '/src', __DIR__ . '/tests']); |
|
16 | + $parameters->set(Option::PATHS, [ __DIR__ . '/src', __DIR__ . '/tests' ]); |
|
17 | 17 | }; |