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
2 changes: 1 addition & 1 deletion .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
fail-fast: true
matrix:
os: [ubuntu-latest, windows-latest]
php: [7.3, 7.4, 8.0, 8.1, 8.2]
php: [7.3, 7.4, 8.0, 8.1, 8.2, 8.3, 8.4]
stability: [prefer-lowest, prefer-stable]

name: P${{ matrix.php }} - ${{ matrix.stability }} - ${{ matrix.os }}
Expand Down
50 changes: 25 additions & 25 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
{
"name": "spatie/backtrace",
"description": "A better backtrace",
"license": "MIT",
"keywords": [
"spatie",
"backtrace"
],
"homepage": "https://github.com/spatie/backtrace",
"license": "MIT",
"authors": [
{
"name": "Freek Van de Herten",
Expand All @@ -15,16 +14,29 @@
"role": "Developer"
}
],
"homepage": "https://github.com/spatie/backtrace",
"funding": [
{
"type": "github",
"url": "https://github.com/sponsors/spatie"
},
{
"type": "other",
"url": "https://spatie.be/open-source/support-us"
}
],
"require": {
"php": "^7.3|^8.0"
"php": "^7.3 || ^8.0"
},
"require-dev": {
"ext-json": "*",
"phpunit/phpunit": "^9.3",
"laravel/serializable-closure": "^1.3",
"spatie/phpunit-snapshot-assertions": "^4.2",
"symfony/var-dumper": "^5.1"
"laravel/serializable-closure": "^1.3 || ^2.0",
"phpunit/phpunit": "^9.3 || ^11.4.3",
"spatie/phpunit-snapshot-assertions": "^4.2 || ^5.1.6",
"symfony/var-dumper": "^5.1 || ^6.0 || ^7.0"
},
"minimum-stability": "dev",
"prefer-stable": true,
"autoload": {
"psr-4": {
"Spatie\\Backtrace\\": "src"
Expand All @@ -35,25 +47,13 @@
"Spatie\\Backtrace\\Tests\\": "tests"
}
},
"scripts": {
"psalm": "vendor/bin/psalm",
"test": "vendor/bin/phpunit",
"test-coverage": "vendor/bin/phpunit --coverage-html coverage",
"format": "vendor/bin/php-cs-fixer fix --allow-risky=yes"
},
"config": {
"sort-packages": true
},
"minimum-stability": "dev",
"prefer-stable": true,
"funding": [
{
"type": "github",
"url": "https://github.com/sponsors/spatie"
},
{
"type": "other",
"url": "https://spatie.be/open-source/support-us"
}
]
"scripts": {
"format": "vendor/bin/php-cs-fixer fix --allow-risky=yes",
"psalm": "vendor/bin/psalm",
"test": "vendor/bin/phpunit",
"test-coverage": "vendor/bin/phpunit --coverage-html coverage"
}
}
2 changes: 1 addition & 1 deletion src/Backtrace.php
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ protected function getRawFrames(): array
return $this->throwable->getTrace();
}

$options = null;
$options = DEBUG_BACKTRACE_PROVIDE_OBJECT;

if (! $this->withArguments) {
$options = $options | DEBUG_BACKTRACE_IGNORE_ARGS;
Expand Down
4 changes: 2 additions & 2 deletions src/Frame.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ public function __construct(
string $file,
int $lineNumber,
?array $arguments,
string $method = null,
string $class = null,
?string $method = null,
?string $class = null,
bool $isApplicationFrame = false,
?string $textSnippet = null,
?string $trimmedFilePath = null
Expand Down
30 changes: 28 additions & 2 deletions tests/BacktraceTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,20 @@ public function it_can_handle_a_laravel_serializable_closure_via_throwable()
$firstFrame = $frames[0];

$this->assertEquals(2, $firstFrame->lineNumber);
$this->assertEquals('{closure}', $firstFrame->method);

if (version_compare(PHP_VERSION, '8.4', '>=')) {
$this->assertEquals(
<<<'EOT'
{closure:laravel-serializable-closure://function () {
throw new \Exception('This is a test exception from a serialized closure');
}:2}
EOT,
$firstFrame->method
);
} else {
$this->assertEquals('{closure}', $firstFrame->method);
}

$this->assertEquals(LaravelSerializableClosureThrow::class, $firstFrame->class);
$this->assertTrue($firstFrame->applicationFrame);

Expand Down Expand Up @@ -280,7 +293,20 @@ public function it_can_handle_a_laravel_serializable_closure_via_call_throwable(
$secondFrame = $frames[1];

$this->assertEquals(2, $secondFrame->lineNumber);
$this->assertEquals('{closure}', $secondFrame->method);

if (version_compare(PHP_VERSION, '8.4', '>=')) {
$this->assertEquals(
<<<'EOT'
{closure:laravel-serializable-closure://function () {
self::throw();
}:2}
EOT,
$secondFrame->method
);
} else {
$this->assertEquals('{closure}', $secondFrame->method);
}

$this->assertEquals(LaravelSerializableClosureCallThrow::class, $secondFrame->class);
$this->assertTrue($secondFrame->applicationFrame);

Expand Down
4 changes: 2 additions & 2 deletions tests/ReduceArgumentsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public function it_can_reduce_frames_with_arguments(
);
}

public function reduceableFramesDataSet()
public static function reduceableFramesDataSet()
{
yield 'without arguments' => [
TraceArguments::create()->withoutArguments(),
Expand Down Expand Up @@ -566,7 +566,7 @@ public function it_will_transform_an_ProvidedArgument_to_array(
$this->assertEquals($expected, $argument->toArray());
}

public function providedArgumentsDataSet()
public static function providedArgumentsDataSet()
{
yield 'base' => [
ProvidedArgumentFactory::create('string')
Expand Down