Skip to content

Commit c7b2f50

Browse files
committed
fix: nits
1 parent ae22ba9 commit c7b2f50

File tree

4 files changed

+7
-22
lines changed

4 files changed

+7
-22
lines changed

.github/workflows/static-analysis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
- uses: php-actions/composer@v6
1515
with:
1616
progress: yes
17-
php_version: 8.3
17+
php_version: 8.1
1818
version: 2
1919
- name: "PHP-CS-Fixer"
2020
run: composer check-cs

src/Collector/Neo4jDataCollector.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ private function recursiveToArray(mixed $obj): mixed
134134
{
135135
if (is_array($obj)) {
136136
return array_map(
137-
fn (mixed $x) => $this->recursiveToArray($x),
137+
fn(mixed $x) => $this->recursiveToArray($x),
138138
$obj
139139
);
140140
}

src/EventHandler.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ class EventHandler
2828
public function __construct(
2929
?EventDispatcherInterface $dispatcher,
3030
private readonly string $alias,
31-
private readonly Stopwatch $stopwatch
31+
private readonly ?Stopwatch $stopwatch
3232
) {
3333
$this->dispatcher = $dispatcher;
3434
}
@@ -52,15 +52,15 @@ public function handle(callable $runHandler, Statement $statement, ?string $alia
5252

5353
$stopWatchName = sprintf('neo4j.%s.query', $alias ?? $this->alias);
5454
try {
55-
$this->stopwatch->start($stopWatchName);
55+
$this->stopwatch?->start($stopWatchName);
5656
$tbr = $runHandler($statement);
57-
$this->stopwatch->stop($stopWatchName);
57+
$this->stopwatch?->stop($stopWatchName);
5858
$this->dispatcher->dispatch(
5959
new PostRunEvent($alias ?? $this->alias, $tbr->getSummary(), $time),
6060
PostRunEvent::EVENT_ID
6161
);
6262
} catch (Neo4jException $e) {
63-
$this->stopwatch->stop($stopWatchName);
63+
$this->stopwatch?->stop($stopWatchName);
6464
/** @noinspection PhpUnhandledExceptionInspection */
6565
$time = new \DateTimeImmutable('now', new \DateTimeZone(date_default_timezone_get()));
6666
$event = new FailureEvent($alias ?? $this->alias, $statement, $e, $time);

src/Resources/views/web_profiler.html.twig

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -89,26 +89,11 @@
8989
<strong class="font-normal text-small">Parameters</strong>: {{ statement.result.statement.parameters|default([])|json_encode }}
9090
</div>
9191
<div>
92-
<strong class="font-normal text-small">Tag</strong>: {{ statement.result.tag|default('N/A')|yaml_encode }}
93-
</div>
94-
{# {% if statement.result.success %}#}
95-
<div>
96-
<strong class="font-normal text-small">Number of results</strong>: {{ statement.result.nb_results|default('N/A') }}
97-
</div>
98-
<div>
99-
<strong class="font-normal text-small">Scheme</strong>: {{ statement.result.scheme|default('N/A') }}
92+
<strong class="font-normal text-small">Alias</strong>: {{ statement.alias|default('N/A') }}
10093
</div>
10194
<div>
10295
<strong class="font-normal text-small">Statistics</strong>: {{ statement|json_encode }}
10396
</div>
104-
{# {% else %}#}
105-
{# <div>#}
106-
{# <strong class="font-normal text-small">Type</strong>: {{ statement.result.exceptionCode }}#}
107-
{# </div>#}
108-
{# <div>#}
109-
{# <strong class="font-normal text-small">message</strong>: {{ statement.result.exceptionMessage }}#}
110-
{# </div>.suc#}
111-
{# {% endif %}#}
11297
</div>
11398
</td>
11499
<td class="nowrap">{% if status is same as('success') %}{% if start_time is not null and end_time is not null %}{{ '%0.2f'|format(end_time - start_time) }}ms{% endif %}{% else %}N/A{% endif %}</td>

0 commit comments

Comments
 (0)