From 3d72a7ef551bd2f21b0935826e8093a58da0b774 Mon Sep 17 00:00:00 2001 From: roxblnfk Date: Fri, 24 May 2024 19:02:14 +0400 Subject: [PATCH 01/25] fix: suppress warnings if Closure::bind() is run with static callable --- src/Socket/Client.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Socket/Client.php b/src/Socket/Client.php index ab9a06de..9b1a2692 100644 --- a/src/Socket/Client.php +++ b/src/Socket/Client.php @@ -112,7 +112,7 @@ public function process(): void */ public function setOnPayload(callable $callable): void { - $this->onPayload = \Closure::bind($callable(...), $this) ?? $callable(...); + $this->onPayload = @\Closure::bind($callable(...), $this) ?? $callable(...); } /** @@ -121,7 +121,7 @@ public function setOnPayload(callable $callable): void */ public function setOnClose(callable $callable): void { - $this->onClose = \Closure::bind($callable(...), $this) ?? $callable(...); + $this->onClose = @\Closure::bind($callable(...), $this) ?? $callable(...); } public function send(string $payload): void From b4616c52056cd1803b2d3990178577537a694147 Mon Sep 17 00:00:00 2001 From: Andrij Orlenko <94047334+lotyp@users.noreply.github.com> Date: Fri, 24 May 2024 18:09:34 +0300 Subject: [PATCH 02/25] fix: release asset upload (#99) --- .github/workflows/build-phar-release.yml | 36 ++++-------------------- 1 file changed, 6 insertions(+), 30 deletions(-) diff --git a/.github/workflows/build-phar-release.yml b/.github/workflows/build-phar-release.yml index bc483416..69b651c7 100644 --- a/.github/workflows/build-phar-release.yml +++ b/.github/workflows/build-phar-release.yml @@ -91,37 +91,13 @@ jobs: run: rm ${{ env.GPG_KEYS }} - name: 📤 Upload release assets - uses: actions/github-script@v7.0.1 + uses: softprops/action-gh-release@v2.0.5 + if: startsWith(github.ref, 'refs/tags/') with: - github-token: "${{ secrets.GITHUB_TOKEN }}" - script: | - const fs = require("fs"); - - const files = [ - { - name: "trap.phar", - path: process.env.TRAP_PHAR, - }, - { - name: "trap.phar.asc", - path: process.env.TRAP_PHAR_SIGNATURE, - }, - ]; - - for (const file of files) { - try { - await github.rest.repos.uploadReleaseAsset({ - data: fs.readFileSync(file.path), - name: file.name, - origin: process.env.RELEASE_UPLOAD_URL, - owner: context.repo.owner, - release_id: process.env.RELEASE_ID, - repo: context.repo.repo, - }); - } catch (error) { - core.setFailed(error.message); - } - } + token: "${{ secrets.TRAP_RELEASE_TOKEN }}" + files: | + ${{ process.env.TRAP_PHAR }} + ${{ process.env.TRAP_PHAR_SIGNATURE }} notify-discord: runs-on: ubuntu-latest From 321233fcc2c7b50f7446fcb57b44dadf7bea24c2 Mon Sep 17 00:00:00 2001 From: Aleksei Gagarin Date: Fri, 24 May 2024 19:10:22 +0400 Subject: [PATCH 03/25] chore(master): release 1.7.4 (#100) --- CHANGELOG.md | 8 ++++++++ resources/version.json | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d4ad27e3..7f7d7efb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +## [1.7.4](https://github.com/buggregator/trap/compare/v1.7.3...v1.7.4) (2024-05-24) + + +### Bug Fixes + +* release asset upload ([#99](https://github.com/buggregator/trap/issues/99)) ([b4616c5](https://github.com/buggregator/trap/commit/b4616c52056cd1803b2d3990178577537a694147)) +* suppress warnings if Closure::bind() is run with static callable ([3d72a7e](https://github.com/buggregator/trap/commit/3d72a7ef551bd2f21b0935826e8093a58da0b774)) + ## [1.7.3](https://github.com/buggregator/trap/compare/v1.7.2...v1.7.3) (2024-05-24) diff --git a/resources/version.json b/resources/version.json index 7d4ac4e4..18cc6edc 100644 --- a/resources/version.json +++ b/resources/version.json @@ -1,3 +1,3 @@ { - ".": "1.7.3" + ".": "1.7.4" } From 453e522b6c49c6e9d54cd6256137c8f25925939f Mon Sep 17 00:00:00 2001 From: roxblnfk Date: Fri, 24 May 2024 19:37:27 +0400 Subject: [PATCH 04/25] fix: fix environments in build-phar-release --- .github/workflows/build-phar-release.yml | 4 ++-- composer.lock | 22 +++++++++++----------- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/.github/workflows/build-phar-release.yml b/.github/workflows/build-phar-release.yml index 69b651c7..93cd5873 100644 --- a/.github/workflows/build-phar-release.yml +++ b/.github/workflows/build-phar-release.yml @@ -96,8 +96,8 @@ jobs: with: token: "${{ secrets.TRAP_RELEASE_TOKEN }}" files: | - ${{ process.env.TRAP_PHAR }} - ${{ process.env.TRAP_PHAR_SIGNATURE }} + ${{ env.TRAP_PHAR }} + ${{ env.TRAP_PHAR_SIGNATURE }} notify-discord: runs-on: ubuntu-latest diff --git a/composer.lock b/composer.lock index d2c44918..46fd5f80 100644 --- a/composer.lock +++ b/composer.lock @@ -3388,16 +3388,16 @@ }, { "name": "phpstan/phpstan", - "version": "1.11.1", + "version": "1.11.2", "source": { "type": "git", "url": "https://github.com/phpstan/phpstan.git", - "reference": "e524358f930e41a2b4cca1320e3b04fc26b39e0b" + "reference": "0d5d4294a70deb7547db655c47685d680e39cfec" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan/zipball/e524358f930e41a2b4cca1320e3b04fc26b39e0b", - "reference": "e524358f930e41a2b4cca1320e3b04fc26b39e0b", + "url": "https://api.github.com/repos/phpstan/phpstan/zipball/0d5d4294a70deb7547db655c47685d680e39cfec", + "reference": "0d5d4294a70deb7547db655c47685d680e39cfec", "shasum": "" }, "require": { @@ -3442,7 +3442,7 @@ "type": "github" } ], - "time": "2024-05-15T08:00:59+00:00" + "time": "2024-05-24T13:23:04+00:00" }, { "name": "phpstan/phpstan-deprecation-rules", @@ -4415,16 +4415,16 @@ }, { "name": "react/promise", - "version": "v3.1.0", + "version": "v3.2.0", "source": { "type": "git", "url": "https://github.com/reactphp/promise.git", - "reference": "e563d55d1641de1dea9f5e84f3cccc66d2bfe02c" + "reference": "8a164643313c71354582dc850b42b33fa12a4b63" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/reactphp/promise/zipball/e563d55d1641de1dea9f5e84f3cccc66d2bfe02c", - "reference": "e563d55d1641de1dea9f5e84f3cccc66d2bfe02c", + "url": "https://api.github.com/repos/reactphp/promise/zipball/8a164643313c71354582dc850b42b33fa12a4b63", + "reference": "8a164643313c71354582dc850b42b33fa12a4b63", "shasum": "" }, "require": { @@ -4476,7 +4476,7 @@ ], "support": { "issues": "https://github.com/reactphp/promise/issues", - "source": "https://github.com/reactphp/promise/tree/v3.1.0" + "source": "https://github.com/reactphp/promise/tree/v3.2.0" }, "funding": [ { @@ -4484,7 +4484,7 @@ "type": "open_collective" } ], - "time": "2023-11-16T16:21:57+00:00" + "time": "2024-05-24T10:39:05+00:00" }, { "name": "react/socket", From 78873fb316b564ed430d55363f98bc5880e18b5c Mon Sep 17 00:00:00 2001 From: Aleksei Gagarin Date: Fri, 24 May 2024 19:42:08 +0400 Subject: [PATCH 05/25] chore(master): release 1.7.5 (#101) --- CHANGELOG.md | 7 +++++++ resources/version.json | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7f7d7efb..16cbb66a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## [1.7.5](https://github.com/buggregator/trap/compare/v1.7.4...v1.7.5) (2024-05-24) + + +### Bug Fixes + +* fix environments in build-phar-release ([453e522](https://github.com/buggregator/trap/commit/453e522b6c49c6e9d54cd6256137c8f25925939f)) + ## [1.7.4](https://github.com/buggregator/trap/compare/v1.7.3...v1.7.4) (2024-05-24) diff --git a/resources/version.json b/resources/version.json index 18cc6edc..78036ac1 100644 --- a/resources/version.json +++ b/resources/version.json @@ -1,3 +1,3 @@ { - ".": "1.7.4" + ".": "1.7.5" } From 12d3d954f769012590843c3281415ef8936a4f4b Mon Sep 17 00:00:00 2001 From: roxblnfk Date: Sat, 25 May 2024 01:35:47 +0400 Subject: [PATCH 06/25] feat: add `tr()` function --- src/Client/TrapHandle.php | 15 +++++ src/Support/{ => Caster}/ProtobufCaster.php | 5 +- src/Support/Caster/TickerCaster.php | 23 ++++++++ src/Support/Tick.php | 62 +++++++++++++++++++++ src/functions.php | 44 ++++++++++++++- 5 files changed, 145 insertions(+), 4 deletions(-) rename src/Support/{ => Caster}/ProtobufCaster.php (98%) create mode 100644 src/Support/Caster/TickerCaster.php create mode 100644 src/Support/Tick.php diff --git a/src/Client/TrapHandle.php b/src/Client/TrapHandle.php index 505f25fb..9a02633e 100644 --- a/src/Client/TrapHandle.php +++ b/src/Client/TrapHandle.php @@ -7,6 +7,7 @@ use Buggregator\Trap\Client\TrapHandle\Counter; use Buggregator\Trap\Client\TrapHandle\Dumper as VarDumper; use Buggregator\Trap\Client\TrapHandle\StaticState; +use Buggregator\Trap\Support\Tick; use Symfony\Component\VarDumper\Caster\TraceStub; /** @@ -35,6 +36,20 @@ public static function fromArray(array $array): self return new self($array); } + /** + * Create a new instance with a single value. + * + * @param int<0, max> $number The tick number. + * @param float $delta The time delta between the current and previous tick. + */ + public static function fromTicker(int $number, float $delta, int $memory): self + { + $self = new self([]); + $self->values[] = new Tick($number, $delta, $memory, $self->staticState->stackTrace[0]); + + return $self; + } + /** * Dump only if the condition is true. * The check is performed immediately upon declaration. diff --git a/src/Support/ProtobufCaster.php b/src/Support/Caster/ProtobufCaster.php similarity index 98% rename from src/Support/ProtobufCaster.php rename to src/Support/Caster/ProtobufCaster.php index 25789d4f..26f4225d 100644 --- a/src/Support/ProtobufCaster.php +++ b/src/Support/Caster/ProtobufCaster.php @@ -2,11 +2,10 @@ declare(strict_types=1); -namespace Buggregator\Trap\Support; +namespace Buggregator\Trap\Support\Caster; -use Buggregator\Trap\Support\Caster\EnumValue; -use Google\Protobuf\Internal\Descriptor as InternalDescriptor; use Google\Protobuf\Descriptor as PublicDescriptor; +use Google\Protobuf\Internal\Descriptor as InternalDescriptor; use Google\Protobuf\Internal\DescriptorPool; use Google\Protobuf\Internal\GPBType; use Google\Protobuf\Internal\MapField; diff --git a/src/Support/Caster/TickerCaster.php b/src/Support/Caster/TickerCaster.php new file mode 100644 index 00000000..68c7d4ba --- /dev/null +++ b/src/Support/Caster/TickerCaster.php @@ -0,0 +1,23 @@ +type = $stub::TYPE_REF; + $stub->class = $tick->__toString(); + $stub->attr = $tick->line; + + return []; + } +} diff --git a/src/Support/Tick.php b/src/Support/Tick.php new file mode 100644 index 00000000..d3e69de3 --- /dev/null +++ b/src/Support/Tick.php @@ -0,0 +1,62 @@ + $number The tick number. + * @param float $delta The time delta between the current and previous tick. + * @param int $memory The memory usage. + * @param array{ + * function?: string, + * line?: int, + * file?: string, + * class?: class-string, + * type?: string, + * args?: list + * } $line The stack trace line. + */ + public function __construct( + public readonly int $number, + public readonly float $delta, + public readonly int $memory, + public readonly array $line, + ) { + } + + public function __toString(): string + { + // Format delta + $delta = $this->delta; + $deltaStr = match (true) { + $delta === 0.0 => '-.---', + $delta < 0.001 => \sprintf('+%.3fms', $delta * 1000), + $delta < 0.01 => \sprintf('+%.2fms', $delta * 1000), + $delta < 1 => \sprintf('+%.1fms', ($delta * 1000)), + $delta < 10 => \sprintf('+%.2fs', $delta), + $delta < 60 => \sprintf('+%.3fs', $delta), + default => \sprintf('+%dm %ds', (int) $delta % 60, (int) $delta % 60), + }; + + return \sprintf( + "Tick #%d %s %sM", + $this->number, + $deltaStr, + \number_format( + $this->memory / 1024 / 1024, + 2, + '.', + '_', + ), + ); + } +} diff --git a/src/functions.php b/src/functions.php index 622a505a..7fdc96b3 100644 --- a/src/functions.php +++ b/src/functions.php @@ -4,7 +4,9 @@ use Buggregator\Trap\Client\TrapHandle; use Buggregator\Trap\Support\Caster\EnumValue; -use Buggregator\Trap\Support\ProtobufCaster; +use Buggregator\Trap\Support\Caster\ProtobufCaster; +use Buggregator\Trap\Support\Caster\TickerCaster; +use Buggregator\Trap\Support\Tick; use Google\Protobuf\Internal\MapField; use Google\Protobuf\Internal\Message; use Google\Protobuf\Internal\RepeatedField; @@ -26,6 +28,44 @@ function trap(mixed ...$values): TrapHandle // do nothing } +try { + /** + * Send values into Buggregator and return the first value. + * + * When arguments are passed it equals to {@see trap()} with `->return()` method call. + * When no arguments passed, it calculates ticks, time between the last `tr()` call and memory usage. + * + * @param mixed ...$values + */ + function tr(mixed ...$values): mixed + { + static $counter = -1; + static $time = 0; + + ++$counter; + + try { + if ($values === []) { + $previous = $time; + $mem = $time = \microtime(true); + return TrapHandle::fromTicker( + $counter, + $counter === 0 ? 0 : $mem - $previous, + memory_get_usage(), + )->return(); + } + + $mem = $time = \microtime(true); + /** @psalm-suppress InternalMethod */ + return TrapHandle::fromArray($values)->return(); + } finally { + $mem === $time and $time = \microtime(true); + } + } +} catch (\Throwable $e) { + // do nothing +} + /** * Register the var-dump caster for protobuf messages */ @@ -38,4 +78,6 @@ function trap(mixed ...$values): TrapHandle AbstractCloner::$defaultCasters[MapField::class] ??= [ProtobufCaster::class, 'castMap']; /** @psalm-suppress MixedAssignment */ AbstractCloner::$defaultCasters[EnumValue::class] ??= [ProtobufCaster::class, 'castEnum']; + /** @psalm-suppress MixedAssignment */ + AbstractCloner::$defaultCasters[Tick::class] ??= [TickerCaster::class, 'cast']; } From eb58da281b7303a9f271e4d25afb49f0d5644fbb Mon Sep 17 00:00:00 2001 From: roxblnfk Date: Sat, 25 May 2024 01:44:42 +0400 Subject: [PATCH 07/25] feat: add `td()` function --- src/Client/TrapHandle/StackTrace.php | 19 ++++++++++++++----- src/functions.php | 20 ++++++++++++++++++++ 2 files changed, 34 insertions(+), 5 deletions(-) diff --git a/src/Client/TrapHandle/StackTrace.php b/src/Client/TrapHandle/StackTrace.php index 5d96006a..e0924620 100644 --- a/src/Client/TrapHandle/StackTrace.php +++ b/src/Client/TrapHandle/StackTrace.php @@ -5,7 +5,6 @@ namespace Buggregator\Trap\Client\TrapHandle; /** - * * @psalm-type StackTraceWithObjects = list + */ + public static array $facades = []; + /** * Returns a backtrace as an array. * Removes the internal frames and the first next frames after them. @@ -46,16 +52,19 @@ public static function stackTrace(string $baseDir = '', bool $provideObjects = f ($provideObjects ? \DEBUG_BACKTRACE_PROVIDE_OBJECT : 0) | \DEBUG_BACKTRACE_IGNORE_ARGS, ) as $frame ) { - if (\str_starts_with($frame['class'] ?? '', 'Buggregator\\Trap\\Client\\')) { + $class = $frame['class'] ?? ''; + if (\str_starts_with($class, 'Buggregator\\Trap\\Client\\')) { $internal = true; $stack = []; continue; } if ($internal) { - // todo check the NoStackTrace attribute - - $internal = false; + if ($class === '' && \array_key_exists($frame['function'], self::$facades)) { + $stack = []; + } else { + $internal = false; + } } // Convert absolute paths to relative ones diff --git a/src/functions.php b/src/functions.php index 7fdc96b3..af8507df 100644 --- a/src/functions.php +++ b/src/functions.php @@ -3,6 +3,7 @@ declare(strict_types=1); use Buggregator\Trap\Client\TrapHandle; +use Buggregator\Trap\Client\TrapHandle\StackTrace; use Buggregator\Trap\Support\Caster\EnumValue; use Buggregator\Trap\Support\Caster\ProtobufCaster; use Buggregator\Trap\Support\Caster\TickerCaster; @@ -24,6 +25,8 @@ function trap(mixed ...$values): TrapHandle /** @psalm-suppress InternalMethod */ return TrapHandle::fromArray($values); } + + StackTrace::$facades['trap'] = true; } catch (\Throwable $e) { // do nothing } @@ -62,6 +65,23 @@ function tr(mixed ...$values): mixed $mem === $time and $time = \microtime(true); } } + + StackTrace::$facades['tr'] = true; + + /** + * Send values into Buggregator and die. + * + * When no arguments passed, it works like {@see tr()}. + * + * @param mixed ...$values + */ + function td(mixed ...$values): never + { + \tr(...$values); + die; + } + + StackTrace::$facades['td'] = true; } catch (\Throwable $e) { // do nothing } From 7262bde7bce7df421952b0760110ed7296ab3c25 Mon Sep 17 00:00:00 2001 From: roxblnfk Date: Sat, 25 May 2024 18:12:37 +0400 Subject: [PATCH 08/25] chore: refactor tracing when `tr()` or `td()` are called without params --- src/Client/TrapHandle.php | 4 +- src/Client/TrapHandle/StackTrace.php | 4 +- src/Support/Caster/TickerCaster.php | 45 ++++++++++++++++++++-- src/Support/{Tick.php => Caster/Trace.php} | 23 +++++------ src/Support/Caster/TraceFile.php | 33 ++++++++++++++++ src/functions.php | 11 ++++-- 6 files changed, 95 insertions(+), 25 deletions(-) rename src/Support/{Tick.php => Caster/Trace.php} (75%) create mode 100644 src/Support/Caster/TraceFile.php diff --git a/src/Client/TrapHandle.php b/src/Client/TrapHandle.php index 9a02633e..310c00a5 100644 --- a/src/Client/TrapHandle.php +++ b/src/Client/TrapHandle.php @@ -7,7 +7,7 @@ use Buggregator\Trap\Client\TrapHandle\Counter; use Buggregator\Trap\Client\TrapHandle\Dumper as VarDumper; use Buggregator\Trap\Client\TrapHandle\StaticState; -use Buggregator\Trap\Support\Tick; +use Buggregator\Trap\Support\Caster\Trace; use Symfony\Component\VarDumper\Caster\TraceStub; /** @@ -45,7 +45,7 @@ public static function fromArray(array $array): self public static function fromTicker(int $number, float $delta, int $memory): self { $self = new self([]); - $self->values[] = new Tick($number, $delta, $memory, $self->staticState->stackTrace[0]); + $self->values[] = new Trace($number, $delta, $memory, \array_slice($self->staticState->stackTrace, 0, 3)); return $self; } diff --git a/src/Client/TrapHandle/StackTrace.php b/src/Client/TrapHandle/StackTrace.php index e0924620..a8a9bb06 100644 --- a/src/Client/TrapHandle/StackTrace.php +++ b/src/Client/TrapHandle/StackTrace.php @@ -6,7 +6,7 @@ /** * @psalm-type StackTraceWithObjects = list * }> * @psalm-type SimpleStackTrace = listtype = $stub::TYPE_REF; $stub->class = $tick->__toString(); - $stub->attr = $tick->line; + $stub->type = $stub::TYPE_OBJECT; + $stub->attr = $tick->stack; + $stub->handle = 0; + + $result = []; + foreach ($tick->stack as $line) { + $result[Caster::PREFIX_VIRTUAL . self::renderMethod($line)] = new TraceFile($line); + } + + return $result; + } + + public static function castLine(TraceFile $line, array $a, Stub $stub, bool $isNested): array + { + $stub->type = $stub::TYPE_REF; + $stub->attr = $line->line; + $stub->handle = 0; + $stub->class = $line->__toString(); return []; } + + /** + * @param array{ + * function: string, + * line?: int, + * file?: string, + * class?: class-string, + * type?: string, + * args?: list + * } $line The stack trace line. + */ + private static function renderMethod(array $line): string + { + if (!isset($line['class'])) { + return $line['function'] . '()'; + } + + $line['type'] ??= "::"; + + return "{$line['class']}{$line['type']}{$line['function']}()"; + } } diff --git a/src/Support/Tick.php b/src/Support/Caster/Trace.php similarity index 75% rename from src/Support/Tick.php rename to src/Support/Caster/Trace.php index d3e69de3..559ecdb9 100644 --- a/src/Support/Tick.php +++ b/src/Support/Caster/Trace.php @@ -2,34 +2,34 @@ declare(strict_types=1); -namespace Buggregator\Trap\Support; +namespace Buggregator\Trap\Support\Caster; /** - * Data object representing a tick. + * Data object representing a trace. * * @see tr() * @internal */ -final class Tick +final class Trace { /** * @param int<0, max> $number The tick number. * @param float $delta The time delta between the current and previous tick. * @param int $memory The memory usage. - * @param array{ - * function?: string, + * @param list - * } $line The stack trace line. + * }> $stack The stack trace. */ public function __construct( public readonly int $number, public readonly float $delta, public readonly int $memory, - public readonly array $line, + public readonly array $stack, ) { } @@ -48,15 +48,10 @@ public function __toString(): string }; return \sprintf( - "Tick #%d %s %sM", + "Trace #%d %s %sM", $this->number, $deltaStr, - \number_format( - $this->memory / 1024 / 1024, - 2, - '.', - '_', - ), + \number_format($this->memory / 1024 / 1024, 2, '.', '_'), ); } } diff --git a/src/Support/Caster/TraceFile.php b/src/Support/Caster/TraceFile.php new file mode 100644 index 00000000..1c606919 --- /dev/null +++ b/src/Support/Caster/TraceFile.php @@ -0,0 +1,33 @@ + + * } $line The stack trace line. + */ + public function __construct( + public readonly array $line, + ) { + } + + public function __toString(): string + { + return isset($this->line['file'], $this->line['line']) + ? \basename($this->line['file']) . ':' . $this->line['line'] + : ''; + } +} diff --git a/src/functions.php b/src/functions.php index af8507df..8bcb8f79 100644 --- a/src/functions.php +++ b/src/functions.php @@ -6,8 +6,9 @@ use Buggregator\Trap\Client\TrapHandle\StackTrace; use Buggregator\Trap\Support\Caster\EnumValue; use Buggregator\Trap\Support\Caster\ProtobufCaster; +use Buggregator\Trap\Support\Caster\Trace; use Buggregator\Trap\Support\Caster\TickerCaster; -use Buggregator\Trap\Support\Tick; +use Buggregator\Trap\Support\Caster\TraceFile; use Google\Protobuf\Internal\MapField; use Google\Protobuf\Internal\Message; use Google\Protobuf\Internal\RepeatedField; @@ -42,8 +43,10 @@ function trap(mixed ...$values): TrapHandle */ function tr(mixed ...$values): mixed { + /** @var int<0, max> $counter */ static $counter = -1; - static $time = 0; + /** @var float $time */ + static $time = 0.0; ++$counter; @@ -99,5 +102,7 @@ function td(mixed ...$values): never /** @psalm-suppress MixedAssignment */ AbstractCloner::$defaultCasters[EnumValue::class] ??= [ProtobufCaster::class, 'castEnum']; /** @psalm-suppress MixedAssignment */ - AbstractCloner::$defaultCasters[Tick::class] ??= [TickerCaster::class, 'cast']; + AbstractCloner::$defaultCasters[Trace::class] = [TickerCaster::class, 'cast']; + /** @psalm-suppress MixedAssignment */ + AbstractCloner::$defaultCasters[TraceFile::class] = [TickerCaster::class, 'castLine']; } From 873bb167671c0f408bbfd7ba9d2926af7f453b08 Mon Sep 17 00:00:00 2001 From: LT Date: Sun, 26 May 2024 11:27:50 +0300 Subject: [PATCH 09/25] feat: Syntax sugar highlight --- src/Client/TrapHandle.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/Client/TrapHandle.php b/src/Client/TrapHandle.php index 505f25fb..6547dbec 100644 --- a/src/Client/TrapHandle.php +++ b/src/Client/TrapHandle.php @@ -172,6 +172,11 @@ public function context(mixed ...$values): self return $this; } + public function highlight(string $language): self + { + return $this->context(language: $language); + } + public function __destruct() { $this->haveToSend() and $this->sendDump(); From 8c206284f75d67385a04006bbe026bd0af4abf48 Mon Sep 17 00:00:00 2001 From: roxblnfk Date: Sun, 26 May 2024 10:32:30 +0400 Subject: [PATCH 10/25] chore: fix composer.json script section; fix CS --- composer.json | 45 +++++++++++++++++++++----------- src/Support/Caster/Trace.php | 3 +-- src/Support/Caster/TraceFile.php | 3 +-- src/functions.php | 12 ++++----- 4 files changed, 38 insertions(+), 25 deletions(-) diff --git a/composer.json b/composer.json index 6e55ed2d..6e3dd385 100644 --- a/composer.json +++ b/composer.json @@ -108,20 +108,35 @@ "sort-packages": true }, "scripts": { - "cs:diff": "php vendor/bin/php-cs-fixer fix --dry-run -v --diff", - "cs:fix": "php vendor/bin/php-cs-fixer fix -v", - "infect": "XDEBUG_MODE=coverage php vendor/bin/roave-infection-static-analysis-plugin --configuration=infection.json.dist", - "infect:ci": "XDEBUG_MODE=coverage php vendor/bin/roave-infection-static-analysis-plugin --ansi --configuration=infection.json.dist --logger-github --ignore-msi-with-no-mutations --only-covered", - "psalm": "php vendor/bin/psalm --show-info=true", - "psalm:baseline": "php vendor/bin/psalm --set-baseline=psalm-baseline.xml", - "psalm:ci": "php vendor/bin/psalm --output-format=github --shepherd --show-info=false --stats --threads=4", - "refactor": "php vendor/bin/rector process --config=rector.php", - "refactor:ci": "php vendor/bin/rector process --config=rector.php --dry-run --ansi", - "stan": "php vendor/bin/phpstan analyse --memory-limit=2G", - "stan:baseline": "php vendor/bin/phpstan analyse --generate-baseline --memory-limit=2G --allow-empty-baseline", - "stan:ci": "php vendor/bin/phpstan analyse --memory-limit=2G --error-format=github", - "test": "XDEBUG_MODE=coverage php vendor/bin/pest --exclude-group=phpunit-only --color=always", - "test:cc": "XDEBUG_MODE=coverage php vendor/bin/pest --coverage --coverage-clover=.build/phpunit/logs/clover.xml --exclude-group=phpunit-only --color=always", - "test:sep": "XDEBUG_MODE=coverage php vendor/bin/phpunit --group=phpunit-only --color=always --exclude-testsuite=Arch" + "cs:diff": "php-cs-fixer fix --dry-run -v --diff", + "cs:fix": "php-cs-fixer fix -v", + "infect": [ + "@putenv XDEBUG_MODE=coverage", + "roave-infection-static-analysis-plugin --configuration=infection.json.dist" + ], + "infect:ci": [ + "@putenv XDEBUG_MODE=coverage", + "roave-infection-static-analysis-plugin --ansi --configuration=infection.json.dist --logger-github --ignore-msi-with-no-mutations --only-covered" + ], + "psalm": "psalm --show-info=true", + "psalm:baseline": "psalm --set-baseline=psalm-baseline.xml", + "psalm:ci": "psalm --output-format=github --shepherd --show-info=false --stats --threads=4", + "refactor": "rector process --config=rector.php", + "refactor:ci": "rector process --config=rector.php --dry-run --ansi", + "stan": "phpstan analyse --memory-limit=2G", + "stan:baseline": "phpstan analyse --generate-baseline --memory-limit=2G --allow-empty-baseline", + "stan:ci": "phpstan analyse --memory-limit=2G --error-format=github", + "test": [ + "@putenv XDEBUG_MODE=coverage", + "pest --exclude-group=phpunit-only --color=always" + ], + "test:cc": [ + "@putenv XDEBUG_MODE=coverage", + "pest --coverage --coverage-clover=.build/phpunit/logs/clover.xml --exclude-group=phpunit-only --color=always" + ], + "test:sep": [ + "@putenv XDEBUG_MODE=coverage", + "phpunit --group=phpunit-only --color=always --exclude-testsuite=Arch" + ] } } diff --git a/src/Support/Caster/Trace.php b/src/Support/Caster/Trace.php index 559ecdb9..e3475ed0 100644 --- a/src/Support/Caster/Trace.php +++ b/src/Support/Caster/Trace.php @@ -30,8 +30,7 @@ public function __construct( public readonly float $delta, public readonly int $memory, public readonly array $stack, - ) { - } + ) {} public function __toString(): string { diff --git a/src/Support/Caster/TraceFile.php b/src/Support/Caster/TraceFile.php index 1c606919..9240e153 100644 --- a/src/Support/Caster/TraceFile.php +++ b/src/Support/Caster/TraceFile.php @@ -21,8 +21,7 @@ final class TraceFile */ public function __construct( public readonly array $line, - ) { - } + ) {} public function __toString(): string { diff --git a/src/functions.php b/src/functions.php index 8bcb8f79..3d39cf11 100644 --- a/src/functions.php +++ b/src/functions.php @@ -43,25 +43,25 @@ function trap(mixed ...$values): TrapHandle */ function tr(mixed ...$values): mixed { - /** @var int<0, max> $counter */ + /** @var int<-1, max> $counter */ static $counter = -1; /** @var float $time */ static $time = 0.0; ++$counter; + $previous = $time; + $mem = $time = \microtime(true); try { if ($values === []) { - $previous = $time; - $mem = $time = \microtime(true); + /** @psalm-suppress InternalMethod */ return TrapHandle::fromTicker( $counter, $counter === 0 ? 0 : $mem - $previous, - memory_get_usage(), + \memory_get_usage(), )->return(); } - $mem = $time = \microtime(true); /** @psalm-suppress InternalMethod */ return TrapHandle::fromArray($values)->return(); } finally { @@ -92,7 +92,7 @@ function td(mixed ...$values): never /** * Register the var-dump caster for protobuf messages */ -if (class_exists(AbstractCloner::class)) { +if (\class_exists(AbstractCloner::class)) { /** @psalm-suppress MixedAssignment */ AbstractCloner::$defaultCasters[Message::class] ??= [ProtobufCaster::class, 'cast']; /** @psalm-suppress MixedAssignment */ From 3dc0c4f7d6522d5babdf9a7d70e72304fce99fb5 Mon Sep 17 00:00:00 2001 From: github-actions Date: Mon, 27 May 2024 08:23:44 +0000 Subject: [PATCH 11/25] style(php-cs-fixer): lint php files and fix coding standards --- src/functions.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/functions.php b/src/functions.php index 3d39cf11..7c3e7ec0 100644 --- a/src/functions.php +++ b/src/functions.php @@ -51,21 +51,21 @@ function tr(mixed ...$values): mixed ++$counter; $previous = $time; - $mem = $time = \microtime(true); + $mem = $time = microtime(true); try { if ($values === []) { /** @psalm-suppress InternalMethod */ return TrapHandle::fromTicker( $counter, $counter === 0 ? 0 : $mem - $previous, - \memory_get_usage(), + memory_get_usage(), )->return(); } /** @psalm-suppress InternalMethod */ return TrapHandle::fromArray($values)->return(); } finally { - $mem === $time and $time = \microtime(true); + $mem === $time and $time = microtime(true); } } @@ -80,7 +80,7 @@ function tr(mixed ...$values): mixed */ function td(mixed ...$values): never { - \tr(...$values); + tr(...$values); die; } @@ -92,7 +92,7 @@ function td(mixed ...$values): never /** * Register the var-dump caster for protobuf messages */ -if (\class_exists(AbstractCloner::class)) { +if (class_exists(AbstractCloner::class)) { /** @psalm-suppress MixedAssignment */ AbstractCloner::$defaultCasters[Message::class] ??= [ProtobufCaster::class, 'cast']; /** @psalm-suppress MixedAssignment */ From cfeed3719637b796ca3e3ce3156f989a4af8108a Mon Sep 17 00:00:00 2001 From: roxblnfk Date: Mon, 27 May 2024 12:25:07 +0400 Subject: [PATCH 12/25] change GPG key --- .github/phar/keys.asc.gpg | Bin 5258 -> 1129 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/.github/phar/keys.asc.gpg b/.github/phar/keys.asc.gpg index fde9a21bcaa8ec6aff62924d556b35ee9e35e6cb..c05bb6713ee3950a9eec6ea50481866b80875dea 100644 GIT binary patch literal 1129 zcmV-v1eW`Z4Fm}T2)wzB=R}%?3+>YC0g(eoq{wIV7l8o&R_$os-+nxblpgB3I8b_% zGS?Y%EH|qOVe!nf*-Oc-F#Ij*FfHe1OvQ{yg3oo$?3##~$)oOm7DJ$IXg{)as3=^2zd@ljnM_wrQ|;ktGw4^Y-L>}eV2Klo{U~E()K+xDi zJ5-LA*8o>xqsL#v2b*J&k#z$&BN(eH%Q7%WH-4rH*MhmT{%;CrSRDY^ciY#zqef3v zl6}K&`wUZ;L~y&d1+(FMB^Xh2eiS8^hmHHDKl6^sWd;8Ni+EXzc%<3c6_v_zOsIv7 zZNw52%j}|WE3bv10V9xcDE3~2^*ay zAb7WLk81`jgd-ny=j@G%i<01j_G zbg!7Hj*e%rdO7j^hTNqj2B;APe^DQ;;QH1({AROuCnyd{?h(D}(P{wcgivoz*6=X6 z7e&fEwkt)nvFRz%?GXXC-F^b%+7ZxK5YA0yT_iP?0p;MQHf`4}fS^*t-=xf+c_#;a z;|KcpKwSTsWwLp)lWKOO_Y8Xdc}?k&PF4I7GRBGM-);r_*|)7W=rWg vKg%DEmv)lrJHelnrmIw=nRbbIaXN*qdsrRcY>(@O;J8G?jZo%E*5bPb7wS3-ZI#c&rsJkA*oGO;i_w?+wHL`K5=wjh9 z4`h@(g2=xo5T_^vHB%5w==4hs7_;;FLHu3H-;O#gq^R&atFu-5d_DM=hRmq<#75$~ zQN@!u%e=kBd;aEPhNRFTSN~Jqk{ek7o4^*GYd<)La5{p}XX}aFVGU!=)iQQh6V`ea z+dM3}udRl-D{Nmrh|N(7xRD1R?y|#s;?-dV7>A8~%^xiX(q1*-GoSi%mU*+EgwVoc zej|h6>~Sx>>A-Z0m*YT7TB%^JKdcqmy*J6|9l;`MECk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b5i>BR From 26a08ea4171867686f3f4baa1bf17fa79c19a1e0 Mon Sep 17 00:00:00 2001 From: LT Date: Mon, 27 May 2024 16:13:04 +0300 Subject: [PATCH 13/25] test: Rename method and tests --- src/Client/TrapHandle.php | 8 ++++++-- tests/Unit/Client/TrapTest.php | 7 +++++++ 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/src/Client/TrapHandle.php b/src/Client/TrapHandle.php index 6547dbec..1d78be9e 100644 --- a/src/Client/TrapHandle.php +++ b/src/Client/TrapHandle.php @@ -172,9 +172,13 @@ public function context(mixed ...$values): self return $this; } - public function highlight(string $language): self + /** + * Code highlighting. + * Will call the context method{@see context()} and pass the language parameter + */ + public function code(string $syntax): self { - return $this->context(language: $language); + return $this->context(language: $syntax); } public function __destruct() diff --git a/tests/Unit/Client/TrapTest.php b/tests/Unit/Client/TrapTest.php index 55cb241b..52ac0740 100644 --- a/tests/Unit/Client/TrapTest.php +++ b/tests/Unit/Client/TrapTest.php @@ -47,6 +47,13 @@ public function testContextMultiple(): void self::assertSame(['foo' => 'new', 'bar' => 'bar-context'], self::$lastData->getContext()); } + public function testCodeHighlight(): void + { + trap('test-value')->code('php'); + + self::assertSame(['language' => 'php'], self::$lastData->getContext()); + } + /** * Check the first line of dumped stacktrace string contains right file and line. */ From 0a450c2974e273be4c3a865bcf3b3aee75fc413b Mon Sep 17 00:00:00 2001 From: Aleksei Gagarin Date: Mon, 27 May 2024 18:07:47 +0400 Subject: [PATCH 14/25] Update src/Client/TrapHandle.php --- src/Client/TrapHandle.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/Client/TrapHandle.php b/src/Client/TrapHandle.php index 1d78be9e..af08b3f9 100644 --- a/src/Client/TrapHandle.php +++ b/src/Client/TrapHandle.php @@ -173,8 +173,14 @@ public function context(mixed ...$values): self } /** - * Code highlighting. - * Will call the context method{@see context()} and pass the language parameter + * Code syntax highlighting. + * + * Adds `language` data context to denote the passed data as source code. + * In this case, Buggragator will perform code highlighting. + * + * Note: it equals to `trap()->context(language: $syntax);` + * + * @param non-empty-string $syntax The name of the programming language */ public function code(string $syntax): self { From 4852dfd26db8da25772f2d7db71e4616357a4cbd Mon Sep 17 00:00:00 2001 From: Danil Shutsky Date: Mon, 27 May 2024 19:15:04 +0300 Subject: [PATCH 15/25] Update TrapHandle.php Co-authored-by: Aleksei Gagarin --- src/Client/TrapHandle.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/Client/TrapHandle.php b/src/Client/TrapHandle.php index af08b3f9..14f755cd 100644 --- a/src/Client/TrapHandle.php +++ b/src/Client/TrapHandle.php @@ -176,10 +176,17 @@ public function context(mixed ...$values): self * Code syntax highlighting. * * Adds `language` data context to denote the passed data as source code. - * In this case, Buggragator will perform code highlighting. + * In this case, Buggregator will perform code highlighting. * * Note: it equals to `trap()->context(language: $syntax);` * + * ```php + * trap( + * index: $indexCode, + * controller: $controllerCode, + * )->code('php'); + * ``` + * * @param non-empty-string $syntax The name of the programming language */ public function code(string $syntax): self From cd02befbe1b229d623b26b09b97b30e121e1bcfc Mon Sep 17 00:00:00 2001 From: roxblnfk Date: Tue, 28 May 2024 13:21:28 +0400 Subject: [PATCH 16/25] test: cover `tr()` function --- composer.lock | 12 ++-- psalm-baseline.xml | 2 +- tests/Unit/Client/FunctionTrapTest.php | 9 ++- tests/Unit/Client/TrTest.php | 77 ++++++++++++++++++++++++++ 4 files changed, 88 insertions(+), 12 deletions(-) create mode 100644 tests/Unit/Client/TrTest.php diff --git a/composer.lock b/composer.lock index 46fd5f80..44e686df 100644 --- a/composer.lock +++ b/composer.lock @@ -1592,16 +1592,16 @@ }, { "name": "composer/pcre", - "version": "3.1.3", + "version": "3.1.4", "source": { "type": "git", "url": "https://github.com/composer/pcre.git", - "reference": "5b16e25a5355f1f3afdfc2f954a0a80aec4826a8" + "reference": "04229f163664973f68f38f6f73d917799168ef24" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/pcre/zipball/5b16e25a5355f1f3afdfc2f954a0a80aec4826a8", - "reference": "5b16e25a5355f1f3afdfc2f954a0a80aec4826a8", + "url": "https://api.github.com/repos/composer/pcre/zipball/04229f163664973f68f38f6f73d917799168ef24", + "reference": "04229f163664973f68f38f6f73d917799168ef24", "shasum": "" }, "require": { @@ -1643,7 +1643,7 @@ ], "support": { "issues": "https://github.com/composer/pcre/issues", - "source": "https://github.com/composer/pcre/tree/3.1.3" + "source": "https://github.com/composer/pcre/tree/3.1.4" }, "funding": [ { @@ -1659,7 +1659,7 @@ "type": "tidelift" } ], - "time": "2024-03-19T10:26:25+00:00" + "time": "2024-05-27T13:40:54+00:00" }, { "name": "composer/semver", diff --git a/psalm-baseline.xml b/psalm-baseline.xml index 5e64aac1..8a54c96c 100644 --- a/psalm-baseline.xml +++ b/psalm-baseline.xml @@ -204,7 +204,7 @@ - + getClass()]]> diff --git a/tests/Unit/Client/FunctionTrapTest.php b/tests/Unit/Client/FunctionTrapTest.php index 1a471215..e3cd7399 100644 --- a/tests/Unit/Client/FunctionTrapTest.php +++ b/tests/Unit/Client/FunctionTrapTest.php @@ -4,15 +4,14 @@ namespace Buggregator\Trap\Tests\Unit\Client; +use PHPUnit\Framework\Attributes\Group; +use PHPUnit\Framework\Attributes\RunInSeparateProcess; use PHPUnit\Framework\TestCase; final class FunctionTrapTest extends TestCase { - /** - * @runInSeparateProcess - * - * @group phpunit-only - */ + #[RunInSeparateProcess] + #[Group('phpunit-only')] public function testLeak(): void { $object = new \stdClass(); diff --git a/tests/Unit/Client/TrTest.php b/tests/Unit/Client/TrTest.php new file mode 100644 index 00000000..5bb22e03 --- /dev/null +++ b/tests/Unit/Client/TrTest.php @@ -0,0 +1,77 @@ +getContext()['label']); + } + + /** + * Check the stacktrace contains three items and it begins with the right function name. + */ + #[RunInSeparateProcess] + #[Group('phpunit-only')] + public function testTrAsStackTrace(): void + { + tr(); + + // 3 Stack Trace items + self::assertCount(3, self::$lastData->getValue()); + self::assertStringMatchesFormat('Trace #0 -.--- %fM', self::$lastData->getType()); + $firstLineKey = \array_key_first(self::$lastData->getValue()); + self::assertStringContainsString('tr()', $firstLineKey); + + tr(); + + self::assertCount(3, self::$lastData->getValue()); + self::assertStringMatchesFormat('Trace #1 +%fms %fM', self::$lastData->getType()); + $firstLineKey = \array_key_first(self::$lastData->getValue()); + self::assertStringContainsString('tr()', $firstLineKey); + } + + /** + * After calling {@see tr()} the dumped data isn't stored in the memory. + */ + public function testLeak(): void + { + $object = new \stdClass(); + $ref = \WeakReference::create($object); + + tr($object, $object); + unset($object); + + $this->assertNull($ref->get()); + } + + public function testReturn(): void + { + $this->assertSame(42, tr(42)); + $this->assertSame(42, tr(named: 42)); + $this->assertSame(42, tr(42, 43)); + $this->assertSame('foo', tr(...['0' => 'foo', 42 => 90])); + $this->assertNull(tr(null)); + } + + public function testReturnSendsDumpOnce(): void + { + $dumper = $this->getMockBuilder(DataDumperInterface::class) + ->getMock(); + $dumper->expects($this->once()) + ->method('dump') + ->willReturnArgument(1); + Dumper::setDumper($dumper); + + $this->assertSame(42, tr(42)); + } +} From 14142610778cf30efebf07cf3cbe2ee7f8cb702c Mon Sep 17 00:00:00 2001 From: roxblnfk Date: Tue, 28 May 2024 13:33:23 +0400 Subject: [PATCH 17/25] chore: move data casters into Client namespace --- psalm-baseline.xml | 2 +- src/{Support => Client}/Caster/EnumValue.php | 2 +- src/{Support => Client}/Caster/ProtobufCaster.php | 2 +- src/{Support => Client}/Caster/Trace.php | 2 +- .../Caster/TraceCaster.php} | 4 ++-- src/{Support => Client}/Caster/TraceFile.php | 2 +- src/Client/TrapHandle.php | 2 +- src/functions.php | 14 +++++++------- 8 files changed, 15 insertions(+), 15 deletions(-) rename src/{Support => Client}/Caster/EnumValue.php (84%) rename src/{Support => Client}/Caster/ProtobufCaster.php (99%) rename src/{Support => Client}/Caster/Trace.php (97%) rename src/{Support/Caster/TickerCaster.php => Client/Caster/TraceCaster.php} (95%) rename src/{Support => Client}/Caster/TraceFile.php (93%) diff --git a/psalm-baseline.xml b/psalm-baseline.xml index 8a54c96c..c2612d42 100644 --- a/psalm-baseline.xml +++ b/psalm-baseline.xml @@ -204,7 +204,7 @@ - + getClass()]]> diff --git a/src/Support/Caster/EnumValue.php b/src/Client/Caster/EnumValue.php similarity index 84% rename from src/Support/Caster/EnumValue.php rename to src/Client/Caster/EnumValue.php index ad6a6f89..c3c4a109 100644 --- a/src/Support/Caster/EnumValue.php +++ b/src/Client/Caster/EnumValue.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace Buggregator\Trap\Support\Caster; +namespace Buggregator\Trap\Client\Caster; /** * @internal diff --git a/src/Support/Caster/ProtobufCaster.php b/src/Client/Caster/ProtobufCaster.php similarity index 99% rename from src/Support/Caster/ProtobufCaster.php rename to src/Client/Caster/ProtobufCaster.php index 26f4225d..05dd8f4b 100644 --- a/src/Support/Caster/ProtobufCaster.php +++ b/src/Client/Caster/ProtobufCaster.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace Buggregator\Trap\Support\Caster; +namespace Buggregator\Trap\Client\Caster; use Google\Protobuf\Descriptor as PublicDescriptor; use Google\Protobuf\Internal\Descriptor as InternalDescriptor; diff --git a/src/Support/Caster/Trace.php b/src/Client/Caster/Trace.php similarity index 97% rename from src/Support/Caster/Trace.php rename to src/Client/Caster/Trace.php index e3475ed0..7b936bd2 100644 --- a/src/Support/Caster/Trace.php +++ b/src/Client/Caster/Trace.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace Buggregator\Trap\Support\Caster; +namespace Buggregator\Trap\Client\Caster; /** * Data object representing a trace. diff --git a/src/Support/Caster/TickerCaster.php b/src/Client/Caster/TraceCaster.php similarity index 95% rename from src/Support/Caster/TickerCaster.php rename to src/Client/Caster/TraceCaster.php index f59e76af..377da934 100644 --- a/src/Support/Caster/TickerCaster.php +++ b/src/Client/Caster/TraceCaster.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace Buggregator\Trap\Support\Caster; +namespace Buggregator\Trap\Client\Caster; use Symfony\Component\VarDumper\Caster\Caster; use Symfony\Component\VarDumper\Cloner\Stub; @@ -10,7 +10,7 @@ /** * @internal */ -final class TickerCaster +final class TraceCaster { public static function cast(Trace $tick, array $a, Stub $stub, bool $isNested): array { diff --git a/src/Support/Caster/TraceFile.php b/src/Client/Caster/TraceFile.php similarity index 93% rename from src/Support/Caster/TraceFile.php rename to src/Client/Caster/TraceFile.php index 9240e153..0447750c 100644 --- a/src/Support/Caster/TraceFile.php +++ b/src/Client/Caster/TraceFile.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace Buggregator\Trap\Support\Caster; +namespace Buggregator\Trap\Client\Caster; /** * @internal diff --git a/src/Client/TrapHandle.php b/src/Client/TrapHandle.php index 310c00a5..1676bf1e 100644 --- a/src/Client/TrapHandle.php +++ b/src/Client/TrapHandle.php @@ -4,10 +4,10 @@ namespace Buggregator\Trap\Client; +use Buggregator\Trap\Client\Caster\Trace; use Buggregator\Trap\Client\TrapHandle\Counter; use Buggregator\Trap\Client\TrapHandle\Dumper as VarDumper; use Buggregator\Trap\Client\TrapHandle\StaticState; -use Buggregator\Trap\Support\Caster\Trace; use Symfony\Component\VarDumper\Caster\TraceStub; /** diff --git a/src/functions.php b/src/functions.php index 7c3e7ec0..0bb74ce9 100644 --- a/src/functions.php +++ b/src/functions.php @@ -2,13 +2,13 @@ declare(strict_types=1); +use Buggregator\Trap\Client\Caster\EnumValue; +use Buggregator\Trap\Client\Caster\ProtobufCaster; +use Buggregator\Trap\Client\Caster\Trace; +use Buggregator\Trap\Client\Caster\TraceCaster; +use Buggregator\Trap\Client\Caster\TraceFile; use Buggregator\Trap\Client\TrapHandle; use Buggregator\Trap\Client\TrapHandle\StackTrace; -use Buggregator\Trap\Support\Caster\EnumValue; -use Buggregator\Trap\Support\Caster\ProtobufCaster; -use Buggregator\Trap\Support\Caster\Trace; -use Buggregator\Trap\Support\Caster\TickerCaster; -use Buggregator\Trap\Support\Caster\TraceFile; use Google\Protobuf\Internal\MapField; use Google\Protobuf\Internal\Message; use Google\Protobuf\Internal\RepeatedField; @@ -102,7 +102,7 @@ function td(mixed ...$values): never /** @psalm-suppress MixedAssignment */ AbstractCloner::$defaultCasters[EnumValue::class] ??= [ProtobufCaster::class, 'castEnum']; /** @psalm-suppress MixedAssignment */ - AbstractCloner::$defaultCasters[Trace::class] = [TickerCaster::class, 'cast']; + AbstractCloner::$defaultCasters[Trace::class] = [TraceCaster::class, 'cast']; /** @psalm-suppress MixedAssignment */ - AbstractCloner::$defaultCasters[TraceFile::class] = [TickerCaster::class, 'castLine']; + AbstractCloner::$defaultCasters[TraceFile::class] = [TraceCaster::class, 'castLine']; } From 5ca4f9c361f1fd68395a8e5ff108130bf65ba424 Mon Sep 17 00:00:00 2001 From: roxblnfk Date: Tue, 28 May 2024 13:47:33 +0400 Subject: [PATCH 18/25] test: cover Trace and TraceFile --- src/Client/Caster/Trace.php | 4 +- src/functions.php | 2 + tests/Unit/Client/Caster/TraceFileTest.php | 43 ++++++++++++++++ tests/Unit/Client/Caster/TraceTest.php | 58 ++++++++++++++++++++++ 4 files changed, 105 insertions(+), 2 deletions(-) create mode 100644 tests/Unit/Client/Caster/TraceFileTest.php create mode 100644 tests/Unit/Client/Caster/TraceTest.php diff --git a/src/Client/Caster/Trace.php b/src/Client/Caster/Trace.php index 7b936bd2..9be5c575 100644 --- a/src/Client/Caster/Trace.php +++ b/src/Client/Caster/Trace.php @@ -15,7 +15,7 @@ final class Trace /** * @param int<0, max> $number The tick number. * @param float $delta The time delta between the current and previous tick. - * @param int $memory The memory usage. + * @param int<0, max> $memory The memory usage. * @param list \sprintf('+%.2fms', $delta * 1000), $delta < 1 => \sprintf('+%.1fms', ($delta * 1000)), $delta < 10 => \sprintf('+%.2fs', $delta), - $delta < 60 => \sprintf('+%.3fs', $delta), + $delta < 60 => \sprintf('+%.1fs', $delta), default => \sprintf('+%dm %ds', (int) $delta % 60, (int) $delta % 60), }; diff --git a/src/functions.php b/src/functions.php index 0bb74ce9..2776bf89 100644 --- a/src/functions.php +++ b/src/functions.php @@ -77,6 +77,8 @@ function tr(mixed ...$values): mixed * When no arguments passed, it works like {@see tr()}. * * @param mixed ...$values + * + * @codeCoverageIgnore */ function td(mixed ...$values): never { diff --git a/tests/Unit/Client/Caster/TraceFileTest.php b/tests/Unit/Client/Caster/TraceFileTest.php new file mode 100644 index 00000000..14012a0f --- /dev/null +++ b/tests/Unit/Client/Caster/TraceFileTest.php @@ -0,0 +1,43 @@ + 'foo', + 'line' => 42, + 'file' => '/path/to/file.php', + 'class' => 'Foo', + 'type' => '->', + 'args' => ['bar'], + ]); + + self::assertSame('file.php:42', (string) $traceFile); + } + + public function testToStringWithoutFile(): void + { + $traceFile = new \Buggregator\Trap\Client\Caster\TraceFile([ + 'function' => 'foo', + ]); + + self::assertSame('', (string) $traceFile); + } + + public function testToStringWithoutLine(): void + { + $traceFile = new \Buggregator\Trap\Client\Caster\TraceFile([ + 'function' => 'foo', + 'file' => '/path/to/file.php', + ]); + + self::assertSame('', (string) $traceFile); + } +} diff --git a/tests/Unit/Client/Caster/TraceTest.php b/tests/Unit/Client/Caster/TraceTest.php new file mode 100644 index 00000000..1b822684 --- /dev/null +++ b/tests/Unit/Client/Caster/TraceTest.php @@ -0,0 +1,58 @@ + $number + * @param int<0, max> $memory + * @param non-empty-string $result + */ + #[DataProvider('provideToString')] + public function testToString(int $number, float $delta, int $memory, string $result): void + { + $trace = new Trace( + number: $number, + delta: $delta, + memory: $memory, + stack: [ + [ + 'function' => 'foo', + 'line' => 42, + 'file' => '/path/to/file.php', + 'class' => 'Foo', + 'type' => '->', + 'args' => ['bar'], + ], + [ + 'function' => 'bar', + 'line' => 23, + 'file' => '/path/to/file.php', + 'class' => 'Bar', + 'type' => '::', + 'args' => ['baz'], + ], + ], + ); + + self::assertSame($result, (string) $trace); + } +} From 8ef864a531949b674a325f8e43a2e8c840211963 Mon Sep 17 00:00:00 2001 From: roxblnfk Date: Tue, 28 May 2024 14:50:28 +0400 Subject: [PATCH 19/25] docs: update readme about `tr()` and `td()` --- README.md | 24 ++++++++++++++++++++++++ src/Client/TrapHandle.php | 2 ++ 2 files changed, 26 insertions(+) diff --git a/README.md b/README.md index b04f4254..cf5745da 100644 --- a/README.md +++ b/README.md @@ -131,10 +131,13 @@ Then just call the `trap()` function in your code: ```php // dump the current stack trace trap()->stackTrace(); + // dump a variable with a depth limit trap($var)->depth(4); + // dump a named variables sequence trap($var, foo: $far, bar: $bar); + // dump a variable and return it $responder->respond(trap($response)->return()); ``` @@ -143,6 +146,27 @@ $responder->respond(trap($response)->return()); > The `trap()` function configures `$_SERVER['REMOTE_ADDR']` and `$_SERVER['REMOTE_PORT']` automatically, > if they are not set. +Also, there are a couple of shortcuts here: +- +- `tr(...)` - equivalent to `trap(...)->return()` +- `td(...)` - equivalent to `trap(...); die;` + +If called without arguments, they will display a short stack trace, used memory, and time between shortcut calls. + +```php +function handle($input) { + tr(); // Trace #0 -.--- 3.42M + + $data = $this->prepareData($input); + + tr(); // Trace #1 0.015ms 6.58M + + $this->processor->process(tr(data: $data)); + + td(); // exit with output: Trace #2 1.15ms 7.73M +} +``` + ### Default port Trap automatically recognizes the type of traffic. diff --git a/src/Client/TrapHandle.php b/src/Client/TrapHandle.php index 1676bf1e..a2423b7c 100644 --- a/src/Client/TrapHandle.php +++ b/src/Client/TrapHandle.php @@ -41,6 +41,8 @@ public static function fromArray(array $array): self * * @param int<0, max> $number The tick number. * @param float $delta The time delta between the current and previous tick. + * + * @internal */ public static function fromTicker(int $number, float $delta, int $memory): self { From 01dfe170b22297f038b6d1d5fe53c329d756d805 Mon Sep 17 00:00:00 2001 From: roxblnfk Date: Tue, 28 May 2024 17:43:43 +0400 Subject: [PATCH 20/25] chore: update and apply CS fixer --- composer.lock | 10 +++++----- src/functions.php | 8 ++++---- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/composer.lock b/composer.lock index 44e686df..8bd01d12 100644 --- a/composer.lock +++ b/composer.lock @@ -6379,16 +6379,16 @@ }, { "name": "wayofdev/cs-fixer-config", - "version": "v1.4.4", + "version": "v1.4.5", "source": { "type": "git", "url": "https://github.com/wayofdev/php-cs-fixer-config.git", - "reference": "8d0578a412be010919a0109cf484f95742cf5291" + "reference": "d38222297a12344cb968b85213878534ffffbefc" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/wayofdev/php-cs-fixer-config/zipball/8d0578a412be010919a0109cf484f95742cf5291", - "reference": "8d0578a412be010919a0109cf484f95742cf5291", + "url": "https://api.github.com/repos/wayofdev/php-cs-fixer-config/zipball/d38222297a12344cb968b85213878534ffffbefc", + "reference": "d38222297a12344cb968b85213878534ffffbefc", "shasum": "" }, "require": { @@ -6453,7 +6453,7 @@ "type": "github" } ], - "time": "2024-05-23T14:54:07+00:00" + "time": "2024-05-28T13:37:07+00:00" }, { "name": "webmozart/assert", diff --git a/src/functions.php b/src/functions.php index 2776bf89..88f0f5fa 100644 --- a/src/functions.php +++ b/src/functions.php @@ -51,21 +51,21 @@ function tr(mixed ...$values): mixed ++$counter; $previous = $time; - $mem = $time = microtime(true); + $mem = $time = \microtime(true); try { if ($values === []) { /** @psalm-suppress InternalMethod */ return TrapHandle::fromTicker( $counter, $counter === 0 ? 0 : $mem - $previous, - memory_get_usage(), + \memory_get_usage(), )->return(); } /** @psalm-suppress InternalMethod */ return TrapHandle::fromArray($values)->return(); } finally { - $mem === $time and $time = microtime(true); + $mem === $time and $time = \microtime(true); } } @@ -94,7 +94,7 @@ function td(mixed ...$values): never /** * Register the var-dump caster for protobuf messages */ -if (class_exists(AbstractCloner::class)) { +if (\class_exists(AbstractCloner::class)) { /** @psalm-suppress MixedAssignment */ AbstractCloner::$defaultCasters[Message::class] ??= [ProtobufCaster::class, 'cast']; /** @psalm-suppress MixedAssignment */ From 5c6e473d1369401fe3dacb8f6b69701fb8c88637 Mon Sep 17 00:00:00 2001 From: roxblnfk Date: Tue, 28 May 2024 18:41:37 +0400 Subject: [PATCH 21/25] chore: fix markdown --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index cf5745da..1f293b09 100644 --- a/README.md +++ b/README.md @@ -147,7 +147,7 @@ $responder->respond(trap($response)->return()); > if they are not set. Also, there are a couple of shortcuts here: -- + - `tr(...)` - equivalent to `trap(...)->return()` - `td(...)` - equivalent to `trap(...); die;` From f4d68d8b8c40a812bb1b82aed15c93d357424a50 Mon Sep 17 00:00:00 2001 From: Andrij Orlenko <94047334+lotyp@users.noreply.github.com> Date: Wed, 29 May 2024 21:04:46 +0300 Subject: [PATCH 22/25] Change release generation type to Github API (#106) --- .github/.release-please-config.json | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/.release-please-config.json b/.github/.release-please-config.json index afcbefa3..dad71187 100644 --- a/.github/.release-please-config.json +++ b/.github/.release-please-config.json @@ -1,4 +1,5 @@ { + "$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json", "release-type": "php", "packages": { ".": { @@ -7,6 +8,7 @@ } }, "include-component-in-tag": false, + "changelog-type": "github", "changelog-sections": [ { "type": "feat", From 3ec674ad19ce2ee55ec4c972aafb71180621df12 Mon Sep 17 00:00:00 2001 From: Aleksei Gagarin Date: Wed, 29 May 2024 22:07:38 +0400 Subject: [PATCH 23/25] chore(master): release 1.8.0 (#104) --- CHANGELOG.md | 12 ++++++++++++ resources/version.json | 2 +- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 16cbb66a..c7a3c3dc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,17 @@ # Changelog +## 1.8.0 (2024-05-29) + +## What's Changed +* Add tr() and td() functions by @roxblnfk in https://github.com/buggregator/trap/pull/102 +* Add `trap()->code()` sugar by @lee-to in https://github.com/buggregator/trap/pull/103 +* Change release generation type to Github API by @lotyp in https://github.com/buggregator/trap/pull/106 + +## New Contributors +* @lee-to made their first contribution in https://github.com/buggregator/trap/pull/103 + +**Full Changelog**: https://github.com/buggregator/trap/compare/v1.7.5...v1.8.0 + ## [1.7.5](https://github.com/buggregator/trap/compare/v1.7.4...v1.7.5) (2024-05-24) diff --git a/resources/version.json b/resources/version.json index 78036ac1..3800c069 100644 --- a/resources/version.json +++ b/resources/version.json @@ -1,3 +1,3 @@ { - ".": "1.7.5" + ".": "1.8.0" } From 0a40196b12b4a63962fb44c13ccb845058521915 Mon Sep 17 00:00:00 2001 From: Andrij Orlenko <94047334+lotyp@users.noreply.github.com> Date: Wed, 29 May 2024 21:41:52 +0300 Subject: [PATCH 24/25] ci: to not include version prefix (#107) --- .github/.release-please-config.json | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/.release-please-config.json b/.github/.release-please-config.json index dad71187..e7ce35ac 100644 --- a/.github/.release-please-config.json +++ b/.github/.release-please-config.json @@ -8,6 +8,7 @@ } }, "include-component-in-tag": false, + "include-v-in-tag": false, "changelog-type": "github", "changelog-sections": [ { From 3aedbe71c3c7aaeea4051d4116dacff494e0a2d6 Mon Sep 17 00:00:00 2001 From: roxblnfk Date: Fri, 31 May 2024 18:49:09 +0400 Subject: [PATCH 25/25] maintenance: update GPG --- .github/phar/keys.asc.gpg | Bin 1129 -> 773 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/.github/phar/keys.asc.gpg b/.github/phar/keys.asc.gpg index c05bb6713ee3950a9eec6ea50481866b80875dea..dbe42e96fd9f68c4ad3f66d6d661b36d37c2a625 100644 GIT binary patch literal 773 zcmV+g1N!`o4Fm}T2yH)S%X6umMD5b)0fc?Yiq5Q+*_1Mke?tqW*^517V^Ua#wDBs& zJ32w~b!gDzWbwAZYD~fD9X(`>NusR;G0Tc@w{Du+qJPXd45(2eWI%AMUWSH|A?mMl zKWCzimE3LVqx_L5bGrGnTML?Xu+!31xXOPTh9h(Sp@{;kClG~4uoXae+ZGVx9@Sm4 zwSXZJb*f@{kAQ2P1mGV@YlHk15lQ*uk+x|fESdRpYp_!M^$ zN}fN9nYX@_cI>U#53XBmDpxC{S)M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