Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions .github/workflows/tasks.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: Tasks

on:
on:
push:
pull_request:

Expand All @@ -11,7 +11,7 @@ jobs:
strategy:
fail-fast: false
matrix:
php: [ '8.1', '8.2', '8.3' ]
php: [ '8.1', '8.2', '8.3', '8.4' ]
typo3: [ '11', '12', '13' ]
sentry: [ false, true ]
exclude:
Expand All @@ -31,22 +31,22 @@ jobs:
# mysql version: '5.7'
# mysql database: 'typo3_test'
# mysql root password: 'root'
- uses: actions/checkout@v2
- uses: actions/cache@v2
- uses: actions/checkout@v4
- uses: actions/cache@v4
with:
path: ~/.composer/cache/files
key: ${{ runner.os }}-${{ matrix.php }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-${{ matrix.php }}-composer-
- run: composer require typo3/minimal="^${{ matrix.typo3 }}" --dev --ignore-platform-req=php+
- run: composer remove sentry/sdk --dev
- run: composer remove sentry/sdk --dev --ignore-platform-req=php+
if: ${{ ! matrix.sentry }}
- run: composer install --no-interaction --no-progress --ignore-platform-req=php+
- run: ./vendor/bin/grumphp run --ansi
- run: composer test
- run: jq 'del(.logs.html)' infection.json > infection.json.new && mv infection.json.new infection.json
- run: composer infection
- uses: codecov/codecov-action@v3
- uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: Resources/Public/test-result/clover.xml
Expand All @@ -64,7 +64,7 @@ jobs:
TYPO3_API_PASSWORD: ${{ secrets.TYPO3_API_PASSWORD }}

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Get the version
id: get_version
run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//}
Expand Down
2 changes: 1 addition & 1 deletion Classes/EventListener/ConsoleCommandEventListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
{
$stopWatch = array_pop($this->stopWatches);
if ($stopWatch === null) {
throw new Exception('No stopWatch found, did you start the command already?');
throw new Exception('No stopWatch found, did you start the command already?', 7800196394);

Check warning on line 28 in Classes/EventListener/ConsoleCommandEventListener.php

View check run for this annotation

Codecov / codecov/patch

Classes/EventListener/ConsoleCommandEventListener.php#L28

Added line #L28 was not covered by tests
}

$stopWatch->stop();
Expand Down
1 change: 1 addition & 0 deletions Classes/Middleware/XClassMiddlewareDispatcher.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ public function handle(ServerRequestInterface $request): ResponseInterface
$stop = TimingUtility::stopWatch('bootstrap');
$stop->startTime = $_SERVER["REQUEST_TIME_FLOAT"];
$stop->stop();

$request = $request->withAttribute('middleware.in.total', TimingUtility::stopWatch('middleware.in.total'));
if ($this->tip instanceof WrapMiddleware) {
$this->tip->isFirst();
Expand Down
2 changes: 1 addition & 1 deletion Classes/Service/SentryService.php
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@
'port' => $uri->getPort(),
'path' => $uri->getPath(),
]);
$description = ($info[0] ?? '') . ' ' . $partialUri . ' ' . ($info[2] ?? '');
$description = $info[0] . ' ' . $partialUri . ' ' . ($info[2] ?? '');

Check warning on line 271 in Classes/Service/SentryService.php

View check run for this annotation

Codecov / codecov/patch

Classes/Service/SentryService.php#L271

Added line #L271 was not covered by tests
$span->setData([
'http.query' => $uri->getQuery(),
'http.fragment' => $uri->getFragment(),
Expand Down
17 changes: 10 additions & 7 deletions Classes/Utility/TimingUtility.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
use Exception;
use Kanti\ServerTiming\Dto\ScriptResult;
use Kanti\ServerTiming\Dto\StopWatch;
use Kanti\ServerTiming\Service\ConfigService;
use Kanti\ServerTiming\Service\RegisterShutdownFunction\RegisterShutdownFunction;
use Kanti\ServerTiming\Service\RegisterShutdownFunction\RegisterShutdownFunctionInterface;
use Kanti\ServerTiming\Service\ConfigService;
use Kanti\ServerTiming\Service\SentryServiceInterface;
use Psr\Http\Message\ResponseInterface;
use SplObjectStorage;
Expand All @@ -22,8 +22,6 @@
{
public const MAX_SINGLE_HEADER_SIZE = 2 ** 12;

private static ?TimingUtility $instance = null;

private bool $registered = false;

/** @var bool */
Expand All @@ -43,7 +41,7 @@

public static function getInstance(): TimingUtility
{
return static::$instance ??= GeneralUtility::makeInstance(TimingUtility::class, new RegisterShutdownFunction(), new ConfigService());
return GeneralUtility::makeInstance(TimingUtility::class, new RegisterShutdownFunction(), new ConfigService());
}

/** @var StopWatch[] */
Expand Down Expand Up @@ -71,7 +69,7 @@

$stop = $this->stopWatchInternal($key, $info);
if (isset($this->stopWatchStack[$key])) {
throw new Exception('only one measurement at a time, use TimingUtility::stopWatch() for parallel measurements');
throw new Exception('only one measurement at a time, use TimingUtility::stopWatch() for parallel measurements', 5736668171);

Check warning on line 72 in Classes/Utility/TimingUtility.php

View check run for this annotation

Codecov / codecov/patch

Classes/Utility/TimingUtility.php#L72

Added line #L72 was not covered by tests
}

$this->stopWatchStack[$key] = $stop;
Expand All @@ -89,7 +87,7 @@
}

if (!isset($this->stopWatchStack[$key])) {
throw new Exception('where is no measurement with this key');
throw new Exception('where is no measurement with this key', 4685025557);

Check warning on line 90 in Classes/Utility/TimingUtility.php

View check run for this annotation

Codecov / codecov/patch

Classes/Utility/TimingUtility.php#L90

Added line #L90 was not covered by tests
}

$stop = $this->stopWatchStack[$key];
Expand Down Expand Up @@ -169,7 +167,7 @@
return $response;
}

$chunks = $this->chunkStringArray($timings, self::MAX_SINGLE_HEADER_SIZE - strlen('Server-Timing: '));

Check warning on line 170 in Classes/Utility/TimingUtility.php

View workflow job for this annotation

GitHub Actions / php: 8.2 TYPO3: 11 sentry/sdk: true

Escaped Mutant for Mutator "Minus": --- Original +++ New @@ @@ if (!$timings) { return $response; } - $chunks = $this->chunkStringArray($timings, self::MAX_SINGLE_HEADER_SIZE - strlen('Server-Timing: ')); + $chunks = $this->chunkStringArray($timings, self::MAX_SINGLE_HEADER_SIZE + strlen('Server-Timing: ')); $memoryUsage = $this->humanReadableFileSize(memory_get_peak_usage()); if ($response) { return $response->withAddedHeader('Server-Timing', $chunks)->withAddedHeader('X-Max-Memory-Usage', $memoryUsage);

Check warning on line 170 in Classes/Utility/TimingUtility.php

View workflow job for this annotation

GitHub Actions / php: 8.3 TYPO3: 11 sentry/sdk: false

Escaped Mutant for Mutator "Minus": --- Original +++ New @@ @@ if (!$timings) { return $response; } - $chunks = $this->chunkStringArray($timings, self::MAX_SINGLE_HEADER_SIZE - strlen('Server-Timing: ')); + $chunks = $this->chunkStringArray($timings, self::MAX_SINGLE_HEADER_SIZE + strlen('Server-Timing: ')); $memoryUsage = $this->humanReadableFileSize(memory_get_peak_usage()); if ($response) { return $response->withAddedHeader('Server-Timing', $chunks)->withAddedHeader('X-Max-Memory-Usage', $memoryUsage);

Check warning on line 170 in Classes/Utility/TimingUtility.php

View workflow job for this annotation

GitHub Actions / php: 8.2 TYPO3: 12 sentry/sdk: true

Escaped Mutant for Mutator "Minus": --- Original +++ New @@ @@ if (!$timings) { return $response; } - $chunks = $this->chunkStringArray($timings, self::MAX_SINGLE_HEADER_SIZE - strlen('Server-Timing: ')); + $chunks = $this->chunkStringArray($timings, self::MAX_SINGLE_HEADER_SIZE + strlen('Server-Timing: ')); $memoryUsage = $this->humanReadableFileSize(memory_get_peak_usage()); if ($response) { return $response->withAddedHeader('Server-Timing', $chunks)->withAddedHeader('X-Max-Memory-Usage', $memoryUsage);

Check warning on line 170 in Classes/Utility/TimingUtility.php

View workflow job for this annotation

GitHub Actions / php: 8.4 TYPO3: 12 sentry/sdk: false

Escaped Mutant for Mutator "Minus": --- Original +++ New @@ @@ if (!$timings) { return $response; } - $chunks = $this->chunkStringArray($timings, self::MAX_SINGLE_HEADER_SIZE - strlen('Server-Timing: ')); + $chunks = $this->chunkStringArray($timings, self::MAX_SINGLE_HEADER_SIZE + strlen('Server-Timing: ')); $memoryUsage = $this->humanReadableFileSize(memory_get_peak_usage()); if ($response) { return $response->withAddedHeader('Server-Timing', $chunks)->withAddedHeader('X-Max-Memory-Usage', $memoryUsage);

Check warning on line 170 in Classes/Utility/TimingUtility.php

View workflow job for this annotation

GitHub Actions / php: 8.2 TYPO3: 13 sentry/sdk: true

Escaped Mutant for Mutator "Minus": @@ @@ if (!$timings) { return $response; } - $chunks = $this->chunkStringArray($timings, self::MAX_SINGLE_HEADER_SIZE - strlen('Server-Timing: ')); + $chunks = $this->chunkStringArray($timings, self::MAX_SINGLE_HEADER_SIZE + strlen('Server-Timing: ')); $memoryUsage = $this->humanReadableFileSize(memory_get_peak_usage()); if ($response) { return $response->withAddedHeader('Server-Timing', $chunks)->withAddedHeader('X-Max-Memory-Usage', $memoryUsage);

Check warning on line 170 in Classes/Utility/TimingUtility.php

View workflow job for this annotation

GitHub Actions / php: 8.1 TYPO3: 11 sentry/sdk: true

Escaped Mutant for Mutator "Minus": --- Original +++ New @@ @@ if (!$timings) { return $response; } - $chunks = $this->chunkStringArray($timings, self::MAX_SINGLE_HEADER_SIZE - strlen('Server-Timing: ')); + $chunks = $this->chunkStringArray($timings, self::MAX_SINGLE_HEADER_SIZE + strlen('Server-Timing: ')); $memoryUsage = $this->humanReadableFileSize(memory_get_peak_usage()); if ($response) { return $response->withAddedHeader('Server-Timing', $chunks)->withAddedHeader('X-Max-Memory-Usage', $memoryUsage);

Check warning on line 170 in Classes/Utility/TimingUtility.php

View workflow job for this annotation

GitHub Actions / php: 8.3 TYPO3: 12 sentry/sdk: false

Escaped Mutant for Mutator "Minus": --- Original +++ New @@ @@ if (!$timings) { return $response; } - $chunks = $this->chunkStringArray($timings, self::MAX_SINGLE_HEADER_SIZE - strlen('Server-Timing: ')); + $chunks = $this->chunkStringArray($timings, self::MAX_SINGLE_HEADER_SIZE + strlen('Server-Timing: ')); $memoryUsage = $this->humanReadableFileSize(memory_get_peak_usage()); if ($response) { return $response->withAddedHeader('Server-Timing', $chunks)->withAddedHeader('X-Max-Memory-Usage', $memoryUsage);

Check warning on line 170 in Classes/Utility/TimingUtility.php

View workflow job for this annotation

GitHub Actions / php: 8.4 TYPO3: 12 sentry/sdk: true

Escaped Mutant for Mutator "Minus": --- Original +++ New @@ @@ if (!$timings) { return $response; } - $chunks = $this->chunkStringArray($timings, self::MAX_SINGLE_HEADER_SIZE - strlen('Server-Timing: ')); + $chunks = $this->chunkStringArray($timings, self::MAX_SINGLE_HEADER_SIZE + strlen('Server-Timing: ')); $memoryUsage = $this->humanReadableFileSize(memory_get_peak_usage()); if ($response) { return $response->withAddedHeader('Server-Timing', $chunks)->withAddedHeader('X-Max-Memory-Usage', $memoryUsage);

Check warning on line 170 in Classes/Utility/TimingUtility.php

View workflow job for this annotation

GitHub Actions / php: 8.2 TYPO3: 12 sentry/sdk: false

Escaped Mutant for Mutator "Minus": --- Original +++ New @@ @@ if (!$timings) { return $response; } - $chunks = $this->chunkStringArray($timings, self::MAX_SINGLE_HEADER_SIZE - strlen('Server-Timing: ')); + $chunks = $this->chunkStringArray($timings, self::MAX_SINGLE_HEADER_SIZE + strlen('Server-Timing: ')); $memoryUsage = $this->humanReadableFileSize(memory_get_peak_usage()); if ($response) { return $response->withAddedHeader('Server-Timing', $chunks)->withAddedHeader('X-Max-Memory-Usage', $memoryUsage);

Check warning on line 170 in Classes/Utility/TimingUtility.php

View workflow job for this annotation

GitHub Actions / php: 8.4 TYPO3: 11 sentry/sdk: true

Escaped Mutant for Mutator "Minus": --- Original +++ New @@ @@ if (!$timings) { return $response; } - $chunks = $this->chunkStringArray($timings, self::MAX_SINGLE_HEADER_SIZE - strlen('Server-Timing: ')); + $chunks = $this->chunkStringArray($timings, self::MAX_SINGLE_HEADER_SIZE + strlen('Server-Timing: ')); $memoryUsage = $this->humanReadableFileSize(memory_get_peak_usage()); if ($response) { return $response->withAddedHeader('Server-Timing', $chunks)->withAddedHeader('X-Max-Memory-Usage', $memoryUsage);

Check warning on line 170 in Classes/Utility/TimingUtility.php

View workflow job for this annotation

GitHub Actions / php: 8.1 TYPO3: 12 sentry/sdk: true

Escaped Mutant for Mutator "Minus": --- Original +++ New @@ @@ if (!$timings) { return $response; } - $chunks = $this->chunkStringArray($timings, self::MAX_SINGLE_HEADER_SIZE - strlen('Server-Timing: ')); + $chunks = $this->chunkStringArray($timings, self::MAX_SINGLE_HEADER_SIZE + strlen('Server-Timing: ')); $memoryUsage = $this->humanReadableFileSize(memory_get_peak_usage()); if ($response) { return $response->withAddedHeader('Server-Timing', $chunks)->withAddedHeader('X-Max-Memory-Usage', $memoryUsage);

Check warning on line 170 in Classes/Utility/TimingUtility.php

View workflow job for this annotation

GitHub Actions / php: 8.4 TYPO3: 13 sentry/sdk: true

Escaped Mutant for Mutator "Minus": @@ @@ if (!$timings) { return $response; } - $chunks = $this->chunkStringArray($timings, self::MAX_SINGLE_HEADER_SIZE - strlen('Server-Timing: ')); + $chunks = $this->chunkStringArray($timings, self::MAX_SINGLE_HEADER_SIZE + strlen('Server-Timing: ')); $memoryUsage = $this->humanReadableFileSize(memory_get_peak_usage()); if ($response) { return $response->withAddedHeader('Server-Timing', $chunks)->withAddedHeader('X-Max-Memory-Usage', $memoryUsage);

Check warning on line 170 in Classes/Utility/TimingUtility.php

View workflow job for this annotation

GitHub Actions / php: 8.4 TYPO3: 13 sentry/sdk: false

Escaped Mutant for Mutator "Minus": @@ @@ if (!$timings) { return $response; } - $chunks = $this->chunkStringArray($timings, self::MAX_SINGLE_HEADER_SIZE - strlen('Server-Timing: ')); + $chunks = $this->chunkStringArray($timings, self::MAX_SINGLE_HEADER_SIZE + strlen('Server-Timing: ')); $memoryUsage = $this->humanReadableFileSize(memory_get_peak_usage()); if ($response) { return $response->withAddedHeader('Server-Timing', $chunks)->withAddedHeader('X-Max-Memory-Usage', $memoryUsage);

Check warning on line 170 in Classes/Utility/TimingUtility.php

View workflow job for this annotation

GitHub Actions / php: 8.3 TYPO3: 13 sentry/sdk: true

Escaped Mutant for Mutator "Minus": @@ @@ if (!$timings) { return $response; } - $chunks = $this->chunkStringArray($timings, self::MAX_SINGLE_HEADER_SIZE - strlen('Server-Timing: ')); + $chunks = $this->chunkStringArray($timings, self::MAX_SINGLE_HEADER_SIZE + strlen('Server-Timing: ')); $memoryUsage = $this->humanReadableFileSize(memory_get_peak_usage()); if ($response) { return $response->withAddedHeader('Server-Timing', $chunks)->withAddedHeader('X-Max-Memory-Usage', $memoryUsage);

Check warning on line 170 in Classes/Utility/TimingUtility.php

View workflow job for this annotation

GitHub Actions / php: 8.1 TYPO3: 11 sentry/sdk: false

Escaped Mutant for Mutator "Minus": --- Original +++ New @@ @@ if (!$timings) { return $response; } - $chunks = $this->chunkStringArray($timings, self::MAX_SINGLE_HEADER_SIZE - strlen('Server-Timing: ')); + $chunks = $this->chunkStringArray($timings, self::MAX_SINGLE_HEADER_SIZE + strlen('Server-Timing: ')); $memoryUsage = $this->humanReadableFileSize(memory_get_peak_usage()); if ($response) { return $response->withAddedHeader('Server-Timing', $chunks)->withAddedHeader('X-Max-Memory-Usage', $memoryUsage);

Check warning on line 170 in Classes/Utility/TimingUtility.php

View workflow job for this annotation

GitHub Actions / php: 8.4 TYPO3: 11 sentry/sdk: false

Escaped Mutant for Mutator "Minus": --- Original +++ New @@ @@ if (!$timings) { return $response; } - $chunks = $this->chunkStringArray($timings, self::MAX_SINGLE_HEADER_SIZE - strlen('Server-Timing: ')); + $chunks = $this->chunkStringArray($timings, self::MAX_SINGLE_HEADER_SIZE + strlen('Server-Timing: ')); $memoryUsage = $this->humanReadableFileSize(memory_get_peak_usage()); if ($response) { return $response->withAddedHeader('Server-Timing', $chunks)->withAddedHeader('X-Max-Memory-Usage', $memoryUsage);

Check warning on line 170 in Classes/Utility/TimingUtility.php

View workflow job for this annotation

GitHub Actions / php: 8.2 TYPO3: 11 sentry/sdk: false

Escaped Mutant for Mutator "Minus": --- Original +++ New @@ @@ if (!$timings) { return $response; } - $chunks = $this->chunkStringArray($timings, self::MAX_SINGLE_HEADER_SIZE - strlen('Server-Timing: ')); + $chunks = $this->chunkStringArray($timings, self::MAX_SINGLE_HEADER_SIZE + strlen('Server-Timing: ')); $memoryUsage = $this->humanReadableFileSize(memory_get_peak_usage()); if ($response) { return $response->withAddedHeader('Server-Timing', $chunks)->withAddedHeader('X-Max-Memory-Usage', $memoryUsage);

Check warning on line 170 in Classes/Utility/TimingUtility.php

View workflow job for this annotation

GitHub Actions / php: 8.1 TYPO3: 12 sentry/sdk: false

Escaped Mutant for Mutator "Minus": --- Original +++ New @@ @@ if (!$timings) { return $response; } - $chunks = $this->chunkStringArray($timings, self::MAX_SINGLE_HEADER_SIZE - strlen('Server-Timing: ')); + $chunks = $this->chunkStringArray($timings, self::MAX_SINGLE_HEADER_SIZE + strlen('Server-Timing: ')); $memoryUsage = $this->humanReadableFileSize(memory_get_peak_usage()); if ($response) { return $response->withAddedHeader('Server-Timing', $chunks)->withAddedHeader('X-Max-Memory-Usage', $memoryUsage);

Check warning on line 170 in Classes/Utility/TimingUtility.php

View workflow job for this annotation

GitHub Actions / php: 8.2 TYPO3: 13 sentry/sdk: false

Escaped Mutant for Mutator "Minus": @@ @@ if (!$timings) { return $response; } - $chunks = $this->chunkStringArray($timings, self::MAX_SINGLE_HEADER_SIZE - strlen('Server-Timing: ')); + $chunks = $this->chunkStringArray($timings, self::MAX_SINGLE_HEADER_SIZE + strlen('Server-Timing: ')); $memoryUsage = $this->humanReadableFileSize(memory_get_peak_usage()); if ($response) { return $response->withAddedHeader('Server-Timing', $chunks)->withAddedHeader('X-Max-Memory-Usage', $memoryUsage);

Check warning on line 170 in Classes/Utility/TimingUtility.php

View workflow job for this annotation

GitHub Actions / php: 8.3 TYPO3: 11 sentry/sdk: true

Escaped Mutant for Mutator "Minus": --- Original +++ New @@ @@ if (!$timings) { return $response; } - $chunks = $this->chunkStringArray($timings, self::MAX_SINGLE_HEADER_SIZE - strlen('Server-Timing: ')); + $chunks = $this->chunkStringArray($timings, self::MAX_SINGLE_HEADER_SIZE + strlen('Server-Timing: ')); $memoryUsage = $this->humanReadableFileSize(memory_get_peak_usage()); if ($response) { return $response->withAddedHeader('Server-Timing', $chunks)->withAddedHeader('X-Max-Memory-Usage', $memoryUsage);

Check warning on line 170 in Classes/Utility/TimingUtility.php

View workflow job for this annotation

GitHub Actions / php: 8.3 TYPO3: 13 sentry/sdk: true

Escaped Mutant for Mutator "Minus": @@ @@ if (!$timings) { return $response; } - $chunks = $this->chunkStringArray($timings, self::MAX_SINGLE_HEADER_SIZE - strlen('Server-Timing: ')); + $chunks = $this->chunkStringArray($timings, self::MAX_SINGLE_HEADER_SIZE + strlen('Server-Timing: ')); $memoryUsage = $this->humanReadableFileSize(memory_get_peak_usage()); if ($response) { return $response->withAddedHeader('Server-Timing', $chunks)->withAddedHeader('X-Max-Memory-Usage', $memoryUsage);

Check warning on line 170 in Classes/Utility/TimingUtility.php

View workflow job for this annotation

GitHub Actions / php: 8.3 TYPO3: 12 sentry/sdk: true

Escaped Mutant for Mutator "Minus": --- Original +++ New @@ @@ if (!$timings) { return $response; } - $chunks = $this->chunkStringArray($timings, self::MAX_SINGLE_HEADER_SIZE - strlen('Server-Timing: ')); + $chunks = $this->chunkStringArray($timings, self::MAX_SINGLE_HEADER_SIZE + strlen('Server-Timing: ')); $memoryUsage = $this->humanReadableFileSize(memory_get_peak_usage()); if ($response) { return $response->withAddedHeader('Server-Timing', $chunks)->withAddedHeader('X-Max-Memory-Usage', $memoryUsage);

Check warning on line 170 in Classes/Utility/TimingUtility.php

View workflow job for this annotation

GitHub Actions / php: 8.1 TYPO3: 12 sentry/sdk: true

Escaped Mutant for Mutator "Minus": --- Original +++ New @@ @@ if (!$timings) { return $response; } - $chunks = $this->chunkStringArray($timings, self::MAX_SINGLE_HEADER_SIZE - strlen('Server-Timing: ')); + $chunks = $this->chunkStringArray($timings, self::MAX_SINGLE_HEADER_SIZE + strlen('Server-Timing: ')); $memoryUsage = $this->humanReadableFileSize(memory_get_peak_usage()); if ($response) { return $response->withAddedHeader('Server-Timing', $chunks)->withAddedHeader('X-Max-Memory-Usage', $memoryUsage);

Check warning on line 170 in Classes/Utility/TimingUtility.php

View workflow job for this annotation

GitHub Actions / php: 8.2 TYPO3: 13 sentry/sdk: false

Escaped Mutant for Mutator "Minus": @@ @@ if (!$timings) { return $response; } - $chunks = $this->chunkStringArray($timings, self::MAX_SINGLE_HEADER_SIZE - strlen('Server-Timing: ')); + $chunks = $this->chunkStringArray($timings, self::MAX_SINGLE_HEADER_SIZE + strlen('Server-Timing: ')); $memoryUsage = $this->humanReadableFileSize(memory_get_peak_usage()); if ($response) { return $response->withAddedHeader('Server-Timing', $chunks)->withAddedHeader('X-Max-Memory-Usage', $memoryUsage);

Check warning on line 170 in Classes/Utility/TimingUtility.php

View workflow job for this annotation

GitHub Actions / php: 8.4 TYPO3: 11 sentry/sdk: true

Escaped Mutant for Mutator "Minus": --- Original +++ New @@ @@ if (!$timings) { return $response; } - $chunks = $this->chunkStringArray($timings, self::MAX_SINGLE_HEADER_SIZE - strlen('Server-Timing: ')); + $chunks = $this->chunkStringArray($timings, self::MAX_SINGLE_HEADER_SIZE + strlen('Server-Timing: ')); $memoryUsage = $this->humanReadableFileSize(memory_get_peak_usage()); if ($response) { return $response->withAddedHeader('Server-Timing', $chunks)->withAddedHeader('X-Max-Memory-Usage', $memoryUsage);

Check warning on line 170 in Classes/Utility/TimingUtility.php

View workflow job for this annotation

GitHub Actions / php: 8.3 TYPO3: 12 sentry/sdk: true

Escaped Mutant for Mutator "Minus": --- Original +++ New @@ @@ if (!$timings) { return $response; } - $chunks = $this->chunkStringArray($timings, self::MAX_SINGLE_HEADER_SIZE - strlen('Server-Timing: ')); + $chunks = $this->chunkStringArray($timings, self::MAX_SINGLE_HEADER_SIZE + strlen('Server-Timing: ')); $memoryUsage = $this->humanReadableFileSize(memory_get_peak_usage()); if ($response) { return $response->withAddedHeader('Server-Timing', $chunks)->withAddedHeader('X-Max-Memory-Usage', $memoryUsage);

Check warning on line 170 in Classes/Utility/TimingUtility.php

View workflow job for this annotation

GitHub Actions / php: 8.4 TYPO3: 11 sentry/sdk: false

Escaped Mutant for Mutator "Minus": --- Original +++ New @@ @@ if (!$timings) { return $response; } - $chunks = $this->chunkStringArray($timings, self::MAX_SINGLE_HEADER_SIZE - strlen('Server-Timing: ')); + $chunks = $this->chunkStringArray($timings, self::MAX_SINGLE_HEADER_SIZE + strlen('Server-Timing: ')); $memoryUsage = $this->humanReadableFileSize(memory_get_peak_usage()); if ($response) { return $response->withAddedHeader('Server-Timing', $chunks)->withAddedHeader('X-Max-Memory-Usage', $memoryUsage);

Check warning on line 170 in Classes/Utility/TimingUtility.php

View workflow job for this annotation

GitHub Actions / php: 8.3 TYPO3: 12 sentry/sdk: false

Escaped Mutant for Mutator "Minus": --- Original +++ New @@ @@ if (!$timings) { return $response; } - $chunks = $this->chunkStringArray($timings, self::MAX_SINGLE_HEADER_SIZE - strlen('Server-Timing: ')); + $chunks = $this->chunkStringArray($timings, self::MAX_SINGLE_HEADER_SIZE + strlen('Server-Timing: ')); $memoryUsage = $this->humanReadableFileSize(memory_get_peak_usage()); if ($response) { return $response->withAddedHeader('Server-Timing', $chunks)->withAddedHeader('X-Max-Memory-Usage', $memoryUsage);

Check warning on line 170 in Classes/Utility/TimingUtility.php

View workflow job for this annotation

GitHub Actions / php: 8.4 TYPO3: 12 sentry/sdk: false

Escaped Mutant for Mutator "Minus": --- Original +++ New @@ @@ if (!$timings) { return $response; } - $chunks = $this->chunkStringArray($timings, self::MAX_SINGLE_HEADER_SIZE - strlen('Server-Timing: ')); + $chunks = $this->chunkStringArray($timings, self::MAX_SINGLE_HEADER_SIZE + strlen('Server-Timing: ')); $memoryUsage = $this->humanReadableFileSize(memory_get_peak_usage()); if ($response) { return $response->withAddedHeader('Server-Timing', $chunks)->withAddedHeader('X-Max-Memory-Usage', $memoryUsage);

Check warning on line 170 in Classes/Utility/TimingUtility.php

View workflow job for this annotation

GitHub Actions / php: 8.4 TYPO3: 12 sentry/sdk: true

Escaped Mutant for Mutator "Minus": --- Original +++ New @@ @@ if (!$timings) { return $response; } - $chunks = $this->chunkStringArray($timings, self::MAX_SINGLE_HEADER_SIZE - strlen('Server-Timing: ')); + $chunks = $this->chunkStringArray($timings, self::MAX_SINGLE_HEADER_SIZE + strlen('Server-Timing: ')); $memoryUsage = $this->humanReadableFileSize(memory_get_peak_usage()); if ($response) { return $response->withAddedHeader('Server-Timing', $chunks)->withAddedHeader('X-Max-Memory-Usage', $memoryUsage);

Check warning on line 170 in Classes/Utility/TimingUtility.php

View workflow job for this annotation

GitHub Actions / php: 8.1 TYPO3: 11 sentry/sdk: true

Escaped Mutant for Mutator "Minus": --- Original +++ New @@ @@ if (!$timings) { return $response; } - $chunks = $this->chunkStringArray($timings, self::MAX_SINGLE_HEADER_SIZE - strlen('Server-Timing: ')); + $chunks = $this->chunkStringArray($timings, self::MAX_SINGLE_HEADER_SIZE + strlen('Server-Timing: ')); $memoryUsage = $this->humanReadableFileSize(memory_get_peak_usage()); if ($response) { return $response->withAddedHeader('Server-Timing', $chunks)->withAddedHeader('X-Max-Memory-Usage', $memoryUsage);

Check warning on line 170 in Classes/Utility/TimingUtility.php

View workflow job for this annotation

GitHub Actions / php: 8.3 TYPO3: 13 sentry/sdk: false

Escaped Mutant for Mutator "Minus": @@ @@ if (!$timings) { return $response; } - $chunks = $this->chunkStringArray($timings, self::MAX_SINGLE_HEADER_SIZE - strlen('Server-Timing: ')); + $chunks = $this->chunkStringArray($timings, self::MAX_SINGLE_HEADER_SIZE + strlen('Server-Timing: ')); $memoryUsage = $this->humanReadableFileSize(memory_get_peak_usage()); if ($response) { return $response->withAddedHeader('Server-Timing', $chunks)->withAddedHeader('X-Max-Memory-Usage', $memoryUsage);

Check warning on line 170 in Classes/Utility/TimingUtility.php

View workflow job for this annotation

GitHub Actions / php: 8.1 TYPO3: 11 sentry/sdk: false

Escaped Mutant for Mutator "Minus": --- Original +++ New @@ @@ if (!$timings) { return $response; } - $chunks = $this->chunkStringArray($timings, self::MAX_SINGLE_HEADER_SIZE - strlen('Server-Timing: ')); + $chunks = $this->chunkStringArray($timings, self::MAX_SINGLE_HEADER_SIZE + strlen('Server-Timing: ')); $memoryUsage = $this->humanReadableFileSize(memory_get_peak_usage()); if ($response) { return $response->withAddedHeader('Server-Timing', $chunks)->withAddedHeader('X-Max-Memory-Usage', $memoryUsage);

Check warning on line 170 in Classes/Utility/TimingUtility.php

View workflow job for this annotation

GitHub Actions / php: 8.2 TYPO3: 12 sentry/sdk: true

Escaped Mutant for Mutator "Minus": --- Original +++ New @@ @@ if (!$timings) { return $response; } - $chunks = $this->chunkStringArray($timings, self::MAX_SINGLE_HEADER_SIZE - strlen('Server-Timing: ')); + $chunks = $this->chunkStringArray($timings, self::MAX_SINGLE_HEADER_SIZE + strlen('Server-Timing: ')); $memoryUsage = $this->humanReadableFileSize(memory_get_peak_usage()); if ($response) { return $response->withAddedHeader('Server-Timing', $chunks)->withAddedHeader('X-Max-Memory-Usage', $memoryUsage);

Check warning on line 170 in Classes/Utility/TimingUtility.php

View workflow job for this annotation

GitHub Actions / php: 8.2 TYPO3: 11 sentry/sdk: true

Escaped Mutant for Mutator "Minus": --- Original +++ New @@ @@ if (!$timings) { return $response; } - $chunks = $this->chunkStringArray($timings, self::MAX_SINGLE_HEADER_SIZE - strlen('Server-Timing: ')); + $chunks = $this->chunkStringArray($timings, self::MAX_SINGLE_HEADER_SIZE + strlen('Server-Timing: ')); $memoryUsage = $this->humanReadableFileSize(memory_get_peak_usage()); if ($response) { return $response->withAddedHeader('Server-Timing', $chunks)->withAddedHeader('X-Max-Memory-Usage', $memoryUsage);

Check warning on line 170 in Classes/Utility/TimingUtility.php

View workflow job for this annotation

GitHub Actions / php: 8.3 TYPO3: 11 sentry/sdk: true

Escaped Mutant for Mutator "Minus": --- Original +++ New @@ @@ if (!$timings) { return $response; } - $chunks = $this->chunkStringArray($timings, self::MAX_SINGLE_HEADER_SIZE - strlen('Server-Timing: ')); + $chunks = $this->chunkStringArray($timings, self::MAX_SINGLE_HEADER_SIZE + strlen('Server-Timing: ')); $memoryUsage = $this->humanReadableFileSize(memory_get_peak_usage()); if ($response) { return $response->withAddedHeader('Server-Timing', $chunks)->withAddedHeader('X-Max-Memory-Usage', $memoryUsage);

Check warning on line 170 in Classes/Utility/TimingUtility.php

View workflow job for this annotation

GitHub Actions / php: 8.2 TYPO3: 13 sentry/sdk: true

Escaped Mutant for Mutator "Minus": @@ @@ if (!$timings) { return $response; } - $chunks = $this->chunkStringArray($timings, self::MAX_SINGLE_HEADER_SIZE - strlen('Server-Timing: ')); + $chunks = $this->chunkStringArray($timings, self::MAX_SINGLE_HEADER_SIZE + strlen('Server-Timing: ')); $memoryUsage = $this->humanReadableFileSize(memory_get_peak_usage()); if ($response) { return $response->withAddedHeader('Server-Timing', $chunks)->withAddedHeader('X-Max-Memory-Usage', $memoryUsage);

Check warning on line 170 in Classes/Utility/TimingUtility.php

View workflow job for this annotation

GitHub Actions / php: 8.1 TYPO3: 12 sentry/sdk: false

Escaped Mutant for Mutator "Minus": --- Original +++ New @@ @@ if (!$timings) { return $response; } - $chunks = $this->chunkStringArray($timings, self::MAX_SINGLE_HEADER_SIZE - strlen('Server-Timing: ')); + $chunks = $this->chunkStringArray($timings, self::MAX_SINGLE_HEADER_SIZE + strlen('Server-Timing: ')); $memoryUsage = $this->humanReadableFileSize(memory_get_peak_usage()); if ($response) { return $response->withAddedHeader('Server-Timing', $chunks)->withAddedHeader('X-Max-Memory-Usage', $memoryUsage);

Check warning on line 170 in Classes/Utility/TimingUtility.php

View workflow job for this annotation

GitHub Actions / php: 8.4 TYPO3: 13 sentry/sdk: true

Escaped Mutant for Mutator "Minus": @@ @@ if (!$timings) { return $response; } - $chunks = $this->chunkStringArray($timings, self::MAX_SINGLE_HEADER_SIZE - strlen('Server-Timing: ')); + $chunks = $this->chunkStringArray($timings, self::MAX_SINGLE_HEADER_SIZE + strlen('Server-Timing: ')); $memoryUsage = $this->humanReadableFileSize(memory_get_peak_usage()); if ($response) { return $response->withAddedHeader('Server-Timing', $chunks)->withAddedHeader('X-Max-Memory-Usage', $memoryUsage);

Check warning on line 170 in Classes/Utility/TimingUtility.php

View workflow job for this annotation

GitHub Actions / php: 8.2 TYPO3: 12 sentry/sdk: false

Escaped Mutant for Mutator "Minus": --- Original +++ New @@ @@ if (!$timings) { return $response; } - $chunks = $this->chunkStringArray($timings, self::MAX_SINGLE_HEADER_SIZE - strlen('Server-Timing: ')); + $chunks = $this->chunkStringArray($timings, self::MAX_SINGLE_HEADER_SIZE + strlen('Server-Timing: ')); $memoryUsage = $this->humanReadableFileSize(memory_get_peak_usage()); if ($response) { return $response->withAddedHeader('Server-Timing', $chunks)->withAddedHeader('X-Max-Memory-Usage', $memoryUsage);

Check warning on line 170 in Classes/Utility/TimingUtility.php

View workflow job for this annotation

GitHub Actions / php: 8.3 TYPO3: 13 sentry/sdk: false

Escaped Mutant for Mutator "Minus": @@ @@ if (!$timings) { return $response; } - $chunks = $this->chunkStringArray($timings, self::MAX_SINGLE_HEADER_SIZE - strlen('Server-Timing: ')); + $chunks = $this->chunkStringArray($timings, self::MAX_SINGLE_HEADER_SIZE + strlen('Server-Timing: ')); $memoryUsage = $this->humanReadableFileSize(memory_get_peak_usage()); if ($response) { return $response->withAddedHeader('Server-Timing', $chunks)->withAddedHeader('X-Max-Memory-Usage', $memoryUsage);

Check warning on line 170 in Classes/Utility/TimingUtility.php

View workflow job for this annotation

GitHub Actions / php: 8.2 TYPO3: 11 sentry/sdk: false

Escaped Mutant for Mutator "Minus": --- Original +++ New @@ @@ if (!$timings) { return $response; } - $chunks = $this->chunkStringArray($timings, self::MAX_SINGLE_HEADER_SIZE - strlen('Server-Timing: ')); + $chunks = $this->chunkStringArray($timings, self::MAX_SINGLE_HEADER_SIZE + strlen('Server-Timing: ')); $memoryUsage = $this->humanReadableFileSize(memory_get_peak_usage()); if ($response) { return $response->withAddedHeader('Server-Timing', $chunks)->withAddedHeader('X-Max-Memory-Usage', $memoryUsage);

Check warning on line 170 in Classes/Utility/TimingUtility.php

View workflow job for this annotation

GitHub Actions / php: 8.4 TYPO3: 13 sentry/sdk: false

Escaped Mutant for Mutator "Minus": @@ @@ if (!$timings) { return $response; } - $chunks = $this->chunkStringArray($timings, self::MAX_SINGLE_HEADER_SIZE - strlen('Server-Timing: ')); + $chunks = $this->chunkStringArray($timings, self::MAX_SINGLE_HEADER_SIZE + strlen('Server-Timing: ')); $memoryUsage = $this->humanReadableFileSize(memory_get_peak_usage()); if ($response) { return $response->withAddedHeader('Server-Timing', $chunks)->withAddedHeader('X-Max-Memory-Usage', $memoryUsage);

Check warning on line 170 in Classes/Utility/TimingUtility.php

View workflow job for this annotation

GitHub Actions / php: 8.3 TYPO3: 11 sentry/sdk: false

Escaped Mutant for Mutator "Minus": --- Original +++ New @@ @@ if (!$timings) { return $response; } - $chunks = $this->chunkStringArray($timings, self::MAX_SINGLE_HEADER_SIZE - strlen('Server-Timing: ')); + $chunks = $this->chunkStringArray($timings, self::MAX_SINGLE_HEADER_SIZE + strlen('Server-Timing: ')); $memoryUsage = $this->humanReadableFileSize(memory_get_peak_usage()); if ($response) { return $response->withAddedHeader('Server-Timing', $chunks)->withAddedHeader('X-Max-Memory-Usage', $memoryUsage);

$memoryUsage = $this->humanReadableFileSize(memory_get_peak_usage());
if ($response) {
Expand Down Expand Up @@ -298,10 +296,15 @@
private function chunkStringArray(array $timings, int $maxLength): array
{
$result = [];
$length = 0;

Check warning on line 299 in Classes/Utility/TimingUtility.php

View workflow job for this annotation

GitHub Actions / php: 8.2 TYPO3: 11 sentry/sdk: true

Escaped Mutant for Mutator "DecrementInteger": --- Original +++ New @@ @@ private function chunkStringArray(array $timings, int $maxLength) : array { $result = []; - $length = 0; + $length = -1; $index = 0; foreach ($timings as $timing) { if ($length <= 0) {

Check warning on line 299 in Classes/Utility/TimingUtility.php

View workflow job for this annotation

GitHub Actions / php: 8.3 TYPO3: 11 sentry/sdk: false

Escaped Mutant for Mutator "DecrementInteger": --- Original +++ New @@ @@ private function chunkStringArray(array $timings, int $maxLength) : array { $result = []; - $length = 0; + $length = -1; $index = 0; foreach ($timings as $timing) { if ($length <= 0) {

Check warning on line 299 in Classes/Utility/TimingUtility.php

View workflow job for this annotation

GitHub Actions / php: 8.2 TYPO3: 12 sentry/sdk: true

Escaped Mutant for Mutator "DecrementInteger": --- Original +++ New @@ @@ private function chunkStringArray(array $timings, int $maxLength) : array { $result = []; - $length = 0; + $length = -1; $index = 0; foreach ($timings as $timing) { if ($length <= 0) {

Check warning on line 299 in Classes/Utility/TimingUtility.php

View workflow job for this annotation

GitHub Actions / php: 8.4 TYPO3: 12 sentry/sdk: false

Escaped Mutant for Mutator "DecrementInteger": --- Original +++ New @@ @@ private function chunkStringArray(array $timings, int $maxLength) : array { $result = []; - $length = 0; + $length = -1; $index = 0; foreach ($timings as $timing) { if ($length <= 0) {

Check warning on line 299 in Classes/Utility/TimingUtility.php

View workflow job for this annotation

GitHub Actions / php: 8.2 TYPO3: 13 sentry/sdk: true

Escaped Mutant for Mutator "DecrementInteger": @@ @@ private function chunkStringArray(array $timings, int $maxLength): array { $result = []; - $length = 0; + $length = -1; $index = 0; foreach ($timings as $timing) { if ($length <= 0) {

Check warning on line 299 in Classes/Utility/TimingUtility.php

View workflow job for this annotation

GitHub Actions / php: 8.1 TYPO3: 11 sentry/sdk: true

Escaped Mutant for Mutator "DecrementInteger": --- Original +++ New @@ @@ private function chunkStringArray(array $timings, int $maxLength) : array { $result = []; - $length = 0; + $length = -1; $index = 0; foreach ($timings as $timing) { if ($length <= 0) {

Check warning on line 299 in Classes/Utility/TimingUtility.php

View workflow job for this annotation

GitHub Actions / php: 8.3 TYPO3: 12 sentry/sdk: false

Escaped Mutant for Mutator "DecrementInteger": --- Original +++ New @@ @@ private function chunkStringArray(array $timings, int $maxLength) : array { $result = []; - $length = 0; + $length = -1; $index = 0; foreach ($timings as $timing) { if ($length <= 0) {

Check warning on line 299 in Classes/Utility/TimingUtility.php

View workflow job for this annotation

GitHub Actions / php: 8.4 TYPO3: 12 sentry/sdk: true

Escaped Mutant for Mutator "DecrementInteger": --- Original +++ New @@ @@ private function chunkStringArray(array $timings, int $maxLength) : array { $result = []; - $length = 0; + $length = -1; $index = 0; foreach ($timings as $timing) { if ($length <= 0) {

Check warning on line 299 in Classes/Utility/TimingUtility.php

View workflow job for this annotation

GitHub Actions / php: 8.2 TYPO3: 12 sentry/sdk: false

Escaped Mutant for Mutator "DecrementInteger": --- Original +++ New @@ @@ private function chunkStringArray(array $timings, int $maxLength) : array { $result = []; - $length = 0; + $length = -1; $index = 0; foreach ($timings as $timing) { if ($length <= 0) {

Check warning on line 299 in Classes/Utility/TimingUtility.php

View workflow job for this annotation

GitHub Actions / php: 8.4 TYPO3: 11 sentry/sdk: true

Escaped Mutant for Mutator "DecrementInteger": --- Original +++ New @@ @@ private function chunkStringArray(array $timings, int $maxLength) : array { $result = []; - $length = 0; + $length = -1; $index = 0; foreach ($timings as $timing) { if ($length <= 0) {

Check warning on line 299 in Classes/Utility/TimingUtility.php

View workflow job for this annotation

GitHub Actions / php: 8.1 TYPO3: 12 sentry/sdk: true

Escaped Mutant for Mutator "DecrementInteger": --- Original +++ New @@ @@ private function chunkStringArray(array $timings, int $maxLength) : array { $result = []; - $length = 0; + $length = -1; $index = 0; foreach ($timings as $timing) { if ($length <= 0) {

Check warning on line 299 in Classes/Utility/TimingUtility.php

View workflow job for this annotation

GitHub Actions / php: 8.4 TYPO3: 13 sentry/sdk: true

Escaped Mutant for Mutator "DecrementInteger": @@ @@ private function chunkStringArray(array $timings, int $maxLength): array { $result = []; - $length = 0; + $length = -1; $index = 0; foreach ($timings as $timing) { if ($length <= 0) {

Check warning on line 299 in Classes/Utility/TimingUtility.php

View workflow job for this annotation

GitHub Actions / php: 8.4 TYPO3: 13 sentry/sdk: false

Escaped Mutant for Mutator "DecrementInteger": @@ @@ private function chunkStringArray(array $timings, int $maxLength): array { $result = []; - $length = 0; + $length = -1; $index = 0; foreach ($timings as $timing) { if ($length <= 0) {

Check warning on line 299 in Classes/Utility/TimingUtility.php

View workflow job for this annotation

GitHub Actions / php: 8.3 TYPO3: 13 sentry/sdk: true

Escaped Mutant for Mutator "DecrementInteger": @@ @@ private function chunkStringArray(array $timings, int $maxLength): array { $result = []; - $length = 0; + $length = -1; $index = 0; foreach ($timings as $timing) { if ($length <= 0) {

Check warning on line 299 in Classes/Utility/TimingUtility.php

View workflow job for this annotation

GitHub Actions / php: 8.1 TYPO3: 11 sentry/sdk: false

Escaped Mutant for Mutator "DecrementInteger": --- Original +++ New @@ @@ private function chunkStringArray(array $timings, int $maxLength) : array { $result = []; - $length = 0; + $length = -1; $index = 0; foreach ($timings as $timing) { if ($length <= 0) {

Check warning on line 299 in Classes/Utility/TimingUtility.php

View workflow job for this annotation

GitHub Actions / php: 8.4 TYPO3: 11 sentry/sdk: false

Escaped Mutant for Mutator "DecrementInteger": --- Original +++ New @@ @@ private function chunkStringArray(array $timings, int $maxLength) : array { $result = []; - $length = 0; + $length = -1; $index = 0; foreach ($timings as $timing) { if ($length <= 0) {

Check warning on line 299 in Classes/Utility/TimingUtility.php

View workflow job for this annotation

GitHub Actions / php: 8.2 TYPO3: 11 sentry/sdk: false

Escaped Mutant for Mutator "DecrementInteger": --- Original +++ New @@ @@ private function chunkStringArray(array $timings, int $maxLength) : array { $result = []; - $length = 0; + $length = -1; $index = 0; foreach ($timings as $timing) { if ($length <= 0) {

Check warning on line 299 in Classes/Utility/TimingUtility.php

View workflow job for this annotation

GitHub Actions / php: 8.1 TYPO3: 12 sentry/sdk: false

Escaped Mutant for Mutator "DecrementInteger": --- Original +++ New @@ @@ private function chunkStringArray(array $timings, int $maxLength) : array { $result = []; - $length = 0; + $length = -1; $index = 0; foreach ($timings as $timing) { if ($length <= 0) {

Check warning on line 299 in Classes/Utility/TimingUtility.php

View workflow job for this annotation

GitHub Actions / php: 8.2 TYPO3: 13 sentry/sdk: false

Escaped Mutant for Mutator "DecrementInteger": @@ @@ private function chunkStringArray(array $timings, int $maxLength): array { $result = []; - $length = 0; + $length = -1; $index = 0; foreach ($timings as $timing) { if ($length <= 0) {

Check warning on line 299 in Classes/Utility/TimingUtility.php

View workflow job for this annotation

GitHub Actions / php: 8.3 TYPO3: 11 sentry/sdk: true

Escaped Mutant for Mutator "DecrementInteger": --- Original +++ New @@ @@ private function chunkStringArray(array $timings, int $maxLength) : array { $result = []; - $length = 0; + $length = -1; $index = 0; foreach ($timings as $timing) { if ($length <= 0) {

Check warning on line 299 in Classes/Utility/TimingUtility.php

View workflow job for this annotation

GitHub Actions / php: 8.3 TYPO3: 13 sentry/sdk: true

Escaped Mutant for Mutator "DecrementInteger": @@ @@ private function chunkStringArray(array $timings, int $maxLength): array { $result = []; - $length = 0; + $length = -1; $index = 0; foreach ($timings as $timing) { if ($length <= 0) {

Check warning on line 299 in Classes/Utility/TimingUtility.php

View workflow job for this annotation

GitHub Actions / php: 8.3 TYPO3: 12 sentry/sdk: true

Escaped Mutant for Mutator "DecrementInteger": --- Original +++ New @@ @@ private function chunkStringArray(array $timings, int $maxLength) : array { $result = []; - $length = 0; + $length = -1; $index = 0; foreach ($timings as $timing) { if ($length <= 0) {

Check warning on line 299 in Classes/Utility/TimingUtility.php

View workflow job for this annotation

GitHub Actions / php: 8.1 TYPO3: 12 sentry/sdk: true

Escaped Mutant for Mutator "DecrementInteger": --- Original +++ New @@ @@ private function chunkStringArray(array $timings, int $maxLength) : array { $result = []; - $length = 0; + $length = -1; $index = 0; foreach ($timings as $timing) { if ($length <= 0) {

Check warning on line 299 in Classes/Utility/TimingUtility.php

View workflow job for this annotation

GitHub Actions / php: 8.2 TYPO3: 13 sentry/sdk: false

Escaped Mutant for Mutator "DecrementInteger": @@ @@ private function chunkStringArray(array $timings, int $maxLength): array { $result = []; - $length = 0; + $length = -1; $index = 0; foreach ($timings as $timing) { if ($length <= 0) {

Check warning on line 299 in Classes/Utility/TimingUtility.php

View workflow job for this annotation

GitHub Actions / php: 8.4 TYPO3: 11 sentry/sdk: true

Escaped Mutant for Mutator "DecrementInteger": --- Original +++ New @@ @@ private function chunkStringArray(array $timings, int $maxLength) : array { $result = []; - $length = 0; + $length = -1; $index = 0; foreach ($timings as $timing) { if ($length <= 0) {

Check warning on line 299 in Classes/Utility/TimingUtility.php

View workflow job for this annotation

GitHub Actions / php: 8.3 TYPO3: 12 sentry/sdk: true

Escaped Mutant for Mutator "DecrementInteger": --- Original +++ New @@ @@ private function chunkStringArray(array $timings, int $maxLength) : array { $result = []; - $length = 0; + $length = -1; $index = 0; foreach ($timings as $timing) { if ($length <= 0) {

Check warning on line 299 in Classes/Utility/TimingUtility.php

View workflow job for this annotation

GitHub Actions / php: 8.4 TYPO3: 11 sentry/sdk: false

Escaped Mutant for Mutator "DecrementInteger": --- Original +++ New @@ @@ private function chunkStringArray(array $timings, int $maxLength) : array { $result = []; - $length = 0; + $length = -1; $index = 0; foreach ($timings as $timing) { if ($length <= 0) {

Check warning on line 299 in Classes/Utility/TimingUtility.php

View workflow job for this annotation

GitHub Actions / php: 8.3 TYPO3: 12 sentry/sdk: false

Escaped Mutant for Mutator "DecrementInteger": --- Original +++ New @@ @@ private function chunkStringArray(array $timings, int $maxLength) : array { $result = []; - $length = 0; + $length = -1; $index = 0; foreach ($timings as $timing) { if ($length <= 0) {

Check warning on line 299 in Classes/Utility/TimingUtility.php

View workflow job for this annotation

GitHub Actions / php: 8.4 TYPO3: 12 sentry/sdk: false

Escaped Mutant for Mutator "DecrementInteger": --- Original +++ New @@ @@ private function chunkStringArray(array $timings, int $maxLength) : array { $result = []; - $length = 0; + $length = -1; $index = 0; foreach ($timings as $timing) { if ($length <= 0) {

Check warning on line 299 in Classes/Utility/TimingUtility.php

View workflow job for this annotation

GitHub Actions / php: 8.4 TYPO3: 12 sentry/sdk: true

Escaped Mutant for Mutator "DecrementInteger": --- Original +++ New @@ @@ private function chunkStringArray(array $timings, int $maxLength) : array { $result = []; - $length = 0; + $length = -1; $index = 0; foreach ($timings as $timing) { if ($length <= 0) {

Check warning on line 299 in Classes/Utility/TimingUtility.php

View workflow job for this annotation

GitHub Actions / php: 8.1 TYPO3: 11 sentry/sdk: true

Escaped Mutant for Mutator "DecrementInteger": --- Original +++ New @@ @@ private function chunkStringArray(array $timings, int $maxLength) : array { $result = []; - $length = 0; + $length = -1; $index = 0; foreach ($timings as $timing) { if ($length <= 0) {

Check warning on line 299 in Classes/Utility/TimingUtility.php

View workflow job for this annotation

GitHub Actions / php: 8.3 TYPO3: 13 sentry/sdk: false

Escaped Mutant for Mutator "DecrementInteger": @@ @@ private function chunkStringArray(array $timings, int $maxLength): array { $result = []; - $length = 0; + $length = -1; $index = 0; foreach ($timings as $timing) { if ($length <= 0) {

Check warning on line 299 in Classes/Utility/TimingUtility.php

View workflow job for this annotation

GitHub Actions / php: 8.1 TYPO3: 11 sentry/sdk: false

Escaped Mutant for Mutator "DecrementInteger": --- Original +++ New @@ @@ private function chunkStringArray(array $timings, int $maxLength) : array { $result = []; - $length = 0; + $length = -1; $index = 0; foreach ($timings as $timing) { if ($length <= 0) {

Check warning on line 299 in Classes/Utility/TimingUtility.php

View workflow job for this annotation

GitHub Actions / php: 8.2 TYPO3: 12 sentry/sdk: true

Escaped Mutant for Mutator "DecrementInteger": --- Original +++ New @@ @@ private function chunkStringArray(array $timings, int $maxLength) : array { $result = []; - $length = 0; + $length = -1; $index = 0; foreach ($timings as $timing) { if ($length <= 0) {

Check warning on line 299 in Classes/Utility/TimingUtility.php

View workflow job for this annotation

GitHub Actions / php: 8.2 TYPO3: 11 sentry/sdk: true

Escaped Mutant for Mutator "DecrementInteger": --- Original +++ New @@ @@ private function chunkStringArray(array $timings, int $maxLength) : array { $result = []; - $length = 0; + $length = -1; $index = 0; foreach ($timings as $timing) { if ($length <= 0) {

Check warning on line 299 in Classes/Utility/TimingUtility.php

View workflow job for this annotation

GitHub Actions / php: 8.3 TYPO3: 11 sentry/sdk: true

Escaped Mutant for Mutator "DecrementInteger": --- Original +++ New @@ @@ private function chunkStringArray(array $timings, int $maxLength) : array { $result = []; - $length = 0; + $length = -1; $index = 0; foreach ($timings as $timing) { if ($length <= 0) {

Check warning on line 299 in Classes/Utility/TimingUtility.php

View workflow job for this annotation

GitHub Actions / php: 8.2 TYPO3: 13 sentry/sdk: true

Escaped Mutant for Mutator "DecrementInteger": @@ @@ private function chunkStringArray(array $timings, int $maxLength): array { $result = []; - $length = 0; + $length = -1; $index = 0; foreach ($timings as $timing) { if ($length <= 0) {

Check warning on line 299 in Classes/Utility/TimingUtility.php

View workflow job for this annotation

GitHub Actions / php: 8.1 TYPO3: 12 sentry/sdk: false

Escaped Mutant for Mutator "DecrementInteger": --- Original +++ New @@ @@ private function chunkStringArray(array $timings, int $maxLength) : array { $result = []; - $length = 0; + $length = -1; $index = 0; foreach ($timings as $timing) { if ($length <= 0) {

Check warning on line 299 in Classes/Utility/TimingUtility.php

View workflow job for this annotation

GitHub Actions / php: 8.4 TYPO3: 13 sentry/sdk: true

Escaped Mutant for Mutator "DecrementInteger": @@ @@ private function chunkStringArray(array $timings, int $maxLength): array { $result = []; - $length = 0; + $length = -1; $index = 0; foreach ($timings as $timing) { if ($length <= 0) {

Check warning on line 299 in Classes/Utility/TimingUtility.php

View workflow job for this annotation

GitHub Actions / php: 8.2 TYPO3: 12 sentry/sdk: false

Escaped Mutant for Mutator "DecrementInteger": --- Original +++ New @@ @@ private function chunkStringArray(array $timings, int $maxLength) : array { $result = []; - $length = 0; + $length = -1; $index = 0; foreach ($timings as $timing) { if ($length <= 0) {

Check warning on line 299 in Classes/Utility/TimingUtility.php

View workflow job for this annotation

GitHub Actions / php: 8.3 TYPO3: 13 sentry/sdk: false

Escaped Mutant for Mutator "DecrementInteger": @@ @@ private function chunkStringArray(array $timings, int $maxLength): array { $result = []; - $length = 0; + $length = -1; $index = 0; foreach ($timings as $timing) { if ($length <= 0) {

Check warning on line 299 in Classes/Utility/TimingUtility.php

View workflow job for this annotation

GitHub Actions / php: 8.2 TYPO3: 11 sentry/sdk: false

Escaped Mutant for Mutator "DecrementInteger": --- Original +++ New @@ @@ private function chunkStringArray(array $timings, int $maxLength) : array { $result = []; - $length = 0; + $length = -1; $index = 0; foreach ($timings as $timing) { if ($length <= 0) {

Check warning on line 299 in Classes/Utility/TimingUtility.php

View workflow job for this annotation

GitHub Actions / php: 8.4 TYPO3: 13 sentry/sdk: false

Escaped Mutant for Mutator "DecrementInteger": @@ @@ private function chunkStringArray(array $timings, int $maxLength): array { $result = []; - $length = 0; + $length = -1; $index = 0; foreach ($timings as $timing) { if ($length <= 0) {

Check warning on line 299 in Classes/Utility/TimingUtility.php

View workflow job for this annotation

GitHub Actions / php: 8.3 TYPO3: 11 sentry/sdk: false

Escaped Mutant for Mutator "DecrementInteger": --- Original +++ New @@ @@ private function chunkStringArray(array $timings, int $maxLength) : array { $result = []; - $length = 0; + $length = -1; $index = 0; foreach ($timings as $timing) { if ($length <= 0) {
$index = 0;
foreach ($timings as $timing) {
$length += 1 + strlen($timing);
if ($length <= 0) {
$length = strlen($timing);
} else {
$length += 1 + strlen($timing);
}

if ($length > $maxLength) {
$index++;
$length = strlen($timing);
Expand Down
99 changes: 92 additions & 7 deletions Tests/TimingUtilityTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

namespace Kanti\ServerTiming\Tests;

use Exception;
use Generator;
use Kanti\ServerTiming\Dto\ScriptResult;
use Kanti\ServerTiming\Service\ConfigService;
Expand All @@ -18,10 +19,8 @@
use PHPUnit\Framework\TestCase;
use Psr\Http\Message\RequestInterface;
use Psr\Http\Message\ResponseInterface;
use Reflection;
use ReflectionClass;
use Symfony\Component\DependencyInjection\Container;
use TYPO3\CMS\Core\Core\Environment;
use TYPO3\CMS\Core\Http\HtmlResponse;
use TYPO3\CMS\Core\Http\Response;
use TYPO3\CMS\Core\Http\ServerRequest;
Expand Down Expand Up @@ -95,8 +94,8 @@ public function stopWatchStopIfNot(): void
#[Test]
public function stopWatchInternal(): void
{
TimingUtility::getInstance()->stopWatchInternal('test');
self::assertTrue(true, 'isCallable');
$stopWatch = TimingUtility::getInstance()->stopWatchInternal('test');
self::assertInstanceOf(StopWatch::class, $stopWatch);
}

#[Test]
Expand Down Expand Up @@ -227,22 +226,31 @@ public function shutdown(string $expected, array $stopWatches, ?int $numberOfTim
$GLOBALS['TYPO3_CONF_VARS']['EXTENSIONS']['server_timing']['length_of_description'] = $lengthOfDescription;
}

$reflection = new ReflectionClass(TimingUtility::class);
$isAlreadyShutdown = $reflection->getProperty('alreadyShutdown');
self::assertFalse($isAlreadyShutdown->getValue($timingUtility));

$response = $timingUtility->shutdown(ScriptResult::fromRequest(new ServerRequest(), new Response()));
$result = $response?->getHeader('Server-Timing')[0];
self::assertSame($expected, $result);

self::assertTrue($isAlreadyShutdown->getValue($timingUtility));
}

public static function dataProviderShutdown(): Generator
{
$stopWatch1 = new StopWatch('key1', 'info');
$stopWatch1->startTime = 100003.0003;
$stopWatch1->stopTime = 100004.0003;

$stopWatch2 = new StopWatch('key2', 'info for longer description');
$stopWatch2->startTime = 100004.0004;
$stopWatch2->stopTime = 100015.0004;

$stopWatch3 = new StopWatch(' key3', 'info');
$stopWatch3->startTime = 100004.0004;
$stopWatch3->stopTime = 100025.0004;

$stopWatch4 = new StopWatch('key4', 'short duration');
$stopWatch4->startTime = 100003.0003;
$stopWatch4->stopTime = 100004.0000;
Expand Down Expand Up @@ -300,6 +308,9 @@ public function addSentryTraceHeaders(RequestInterface $request, StopWatch $stop
return $request;
}

/**
* @param list<StopWatch> $stopWatches
*/
public function sendSentryTrace(ScriptResult $result, array $stopWatches): ?ResponseInterface
{
$sortedWatches = $stopWatches;
Expand Down Expand Up @@ -336,21 +347,27 @@ public static function dataProviderCombineIfToMuch(): Generator
$stopWatchX = new StopWatch('x', 'info');
$stopWatchX->startTime = 100001.0001;
$stopWatchX->stopTime = 100002.0001;

$stopWatchX2 = new StopWatch('x', 'info');
$stopWatchX2->startTime = 100002.0002;
$stopWatchX2->stopTime = 100003.0002;

$stopWatchA = new StopWatch('key', 'info');
$stopWatchA->startTime = 100003.0003;
$stopWatchA->stopTime = 100004.0003;

$stopWatchB = new StopWatch('key', 'info');
$stopWatchB->startTime = 100004.0004;
$stopWatchB->stopTime = 100005.0004;

$stopWatchBig1 = new StopWatch('key', 'info');
$stopWatchBig1->startTime = 100005.0005;
$stopWatchBig1->stopTime = 100106.0005;

$stopWatchD = new StopWatch('key', 'info');
$stopWatchD->startTime = 100006.0006;
$stopWatchD->stopTime = 100007.0006;

$stopWatchBig2 = new StopWatch('key', 'info');
$stopWatchBig2->startTime = 100007.0007;
$stopWatchBig2->stopTime = 100108.0007;
Expand Down Expand Up @@ -412,15 +429,83 @@ public function shouldTrack(): void
self::assertFalse($timingUtility->shouldTrack());
}

/**
* @param list<string> $timings
* @param list<string> $expected
*/
#[Test]
public function chunkStringArray(): void
#[DataProvider('chunkStringArrayDataProvider')]
public function chunkStringArray(array $timings, int $maxLength, array $expected): void
{
$reflection = new ReflectionClass(TimingUtility::class);
$reflectionMethod = $reflection->getMethod('chunkStringArray');
$reflectionMethod->setAccessible(true);

$result = $reflectionMethod->invoke($this->getTestInstance(), ['a', 'b', 'c', 'd', 'e', 'f'], 4);
self::assertSame(['a,b', 'c,d', 'e,f'], $result);
$result = $reflectionMethod->invoke($this->getTestInstance(), $timings, $maxLength);
self::assertSame($expected, $result);
self::assertIsList($result);
}

/**
* @return Generator<string, array{timings: list<string>, maxLength: int, expected: list<string>}>
*/
public static function chunkStringArrayDataProvider(): Generator
{
yield 'maxLength 1' => [
'timings' => ['a', 'b', 'c', 'd', 'e', 'f'],
'maxLength' => 1,
'expected' => ['a', 'b', 'c', 'd', 'e', 'f'],
];
yield 'maxLength 2' => [
'timings' => ['a', 'b', 'c', 'd', 'e', 'f'],
'maxLength' => 2,
'expected' => ['a', 'b', 'c', 'd', 'e', 'f'],
];
yield 'maxLength 3' => [
'timings' => ['a', 'b', 'c', 'd', 'e', 'f'],
'maxLength' => 3,
'expected' => ['a,b', 'c,d', 'e,f'],
];
yield 'maxLength 4' => [
'timings' => ['a', 'b', 'c', 'd', 'e', 'f'],
'maxLength' => 4,
'expected' => ['a,b', 'c,d', 'e,f'],
];
yield 'maxLength 5' => [
'timings' => ['a', 'b', 'c', 'd', 'e', 'f'],
'maxLength' => 5,
'expected' => ['a,b,c', 'd,e,f'],
];
yield 'maxLength 6' => [
'timings' => ['a', 'b', 'c', 'd', 'e', 'f'],
'maxLength' => 6,
'expected' => ['a,b,c', 'd,e,f'],
];
yield 'maxLength 7' => [
'timings' => ['a', 'b', 'c', 'd', 'e', 'f'],
'maxLength' => 7,
'expected' => ['a,b,c,d', 'e,f'],
];
yield 'maxLength 8' => [
'timings' => ['a', 'b', 'c', 'd', 'e', 'f'],
'maxLength' => 8,
'expected' => ['a,b,c,d', 'e,f'],
];
yield 'maxLength 9' => [
'timings' => ['a', 'b', 'c', 'd', 'e', 'f'],
'maxLength' => 9,
'expected' => ['a,b,c,d,e', 'f'],
];
yield 'maxLength 10' => [
'timings' => ['a', 'b', 'c', 'd', 'e', 'f'],
'maxLength' => 10,
'expected' => ['a,b,c,d,e', 'f'],
];
yield 'maxLength 11' => [
'timings' => ['a', 'b', 'c', 'd', 'e', 'f'],
'maxLength' => 11,
'expected' => ['a,b,c,d,e,f'],
];
}

/**
Expand Down
10 changes: 5 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,19 @@
}
],
"require": {
"php": "~8.1.0 || ~8.2.0 || ~8.3.0",
"php": "~8.1.0 || ~8.2.0 || ~8.3.0 || ~8.4.0",
"composer-runtime-api": "^2.0.0",
"typo3/cms-core": "^11.0 || ^12.0 || ^13.0",
"typo3/cms-extbase": "^11.0 || ^12.0 || ^13.0"
},
"require-dev": {
"infection/infection": "^0.26.13 || ^0.27.11",
"infection/infection": "^0.26.13 || ^0.27.11 || ^0.29.14",
"phpstan/extension-installer": "^1.1",
"phpunit/phpunit": "^10 || ^11",
"pluswerk/grumphp-config": "^7",
"saschaegerer/phpstan-typo3": "^1.10.1",
"pluswerk/grumphp-config": "^7 || ^10",
"saschaegerer/phpstan-typo3": "^1.10.1 || ^2.1.0",
"sentry/sdk": "^3.5",
"ssch/typo3-rector": "^2.6.4",
"ssch/typo3-rector": "^2.6.4 || ^3.3.0",
"typo3/cms-adminpanel": "^11.0 || ^12.0 || ^13.0"
},
"minimum-stability": "stable",
Expand Down
Loading
Loading