You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This PR consolidates span error capture into finish(?string $level = null, ?Throwable $error = null), removes the Span::error() static helper, and changes level to always be written at finish time rather than only when not already set. The README and tests are updated accordingly, and declare(strict_types=1) is added across all source and test files.
Confidence Score: 5/5
Safe to merge — no logic bugs found; all behavioural changes are intentional and well-tested.
No P0 or P1 issues found. The two breaking changes (removal of Span::error() and finish() now always overwriting level) are deliberately introduced, covered by tests, and documented in the README. All other changes are additive or housekeeping.
No files require special attention.
Important Files Changed
Filename
Overview
src/Span/Span.php
Removes Span::error(), extends finish() with $level/$error params, and changes level to always be set at finish time (no longer preserving pre-set values).
tests/SpanTest.php
Replaces old Span::error() tests with finish(error:) equivalents; adds testFinishOwnsLevelAttribute confirming the new always-overwrite level behaviour.
README.md
Updated error-handling guidance to use finish(error: $e), removed Span::error() from static-method table, and added prose about setError() for pre-finish error recording.
src/Span/Exporter/Exporter.php
Added declare(strict_types=1) only; no logic change.
src/Span/Exporter/Stdout.php
Added declare(strict_types=1) only; no logic change.
src/Span/Storage/Memory.php
Added declare(strict_types=1) only; no logic change.
src/Span/Storage/Coroutine.php
Added declare(strict_types=1) only; no logic change.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Span::finish(?Throwable $error = null)Span::error()helperTesting
composer testcomposer formatvendor/bin/phpstan analyze --memory-limit=512M