PHPackages                             mortenscheel/tracer - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Debugging &amp; Profiling](/categories/debugging)
4. /
5. mortenscheel/tracer

ActiveLibrary[Debugging &amp; Profiling](/categories/debugging)

mortenscheel/tracer
===================

A PHP library for advanced stack trace handling and debugging.

0.2.0(1y ago)08.0k↓40.5%1MITPHPPHP ^8.2.0CI passing

Since Mar 15Pushed 1y ago1 watchersCompare

[ Source](https://github.com/mortenscheel/tracer)[ Packagist](https://packagist.org/packages/mortenscheel/tracer)[ RSS](/packages/mortenscheel-tracer/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (2)Dependencies (13)Versions (3)Used By (1)

 [![GitHub Workflow Status (master)](https://github.com/mortenscheel/tracer/actions/workflows/tests.yml/badge.svg)](https://github.com/mortenscheel/tracer/actions) [![Total Downloads](https://camo.githubusercontent.com/f8399f3a43ffb5e14f6080d4efc725ab4b9dd19394c4acc399113afad1c785ff/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6d6f7274656e73636865656c2f747261636572)](https://packagist.org/packages/mortenscheel/tracer) [![Latest Version](https://camo.githubusercontent.com/e0a6f022ba89175b243707896c2ed98f5e7da08aa41d44e32da0ebf9a4b90674/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6d6f7274656e73636865656c2f747261636572)](https://packagist.org/packages/mortenscheel/tracer) [![License](https://camo.githubusercontent.com/7119cb7c0a0b07b971966260a102dbe6b9797dba20767d3c18a8bd7803ec0ea1/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f6d6f7274656e73636865656c2f747261636572)](https://packagist.org/packages/mortenscheel/tracer)

\# Tracer A PHP library for advanced stack trace handling and debugging.

Installation
------------

[](#installation)

```
composer require mortenscheel/tracer
```

Features
--------

[](#features)

- Get detailed stack traces with clean filtering options
- Easily ignore vendor frames, specific classes, methods, files, or lines
- StackTrace is a Laravel Collection
- Format stack frames for debugging and display
- Generate editor links (see [mortenscheel/editor-links](https://github.com/mortenscheel/editor-links))
- Serializable frames for logging or error reporting

Usage
-----

[](#usage)

### Basic Usage

[](#basic-usage)

```
use Scheel\Tracer\StackTrace;

// Get a full stack trace
$trace = StackTrace::getTrace();

// Access the first frame
$firstFrame = $trace->first();

// Convert to array for inspection
$frames = $trace->toArray();
```

### Filtering Frames

[](#filtering-frames)

```
use Scheel\Tracer\StackTrace;
use Scheel\Tracer\Frame;

// Ignore vendor frames
$trace = StackTrace::getTrace()->ignoreVendor();

// Ignore specific classes
$trace = StackTrace::getTrace()->ignoreClass(SomeClass::class);

// Ignore specific class methods
$trace = StackTrace::getTrace()->ignoreClass(SomeClass::class, 'methodName');

// Ignore specific files
$trace = StackTrace::getTrace()->ignoreFile('/path/to/file.php');

// Ignore specific lines in files
$trace = StackTrace::getTrace()->ignoreFile('/path/to/file.php', 123);

// Custom filtering using the filter method
$trace = StackTrace::getTrace()->filter(function (Frame $frame): bool {
    return $frame->class !== 'ClassToIgnore';
});
```

### Working with Frames

[](#working-with-frames)

```
use Scheel\Tracer\StackTrace;

$frame = StackTrace::getTrace()->first();

// Get frame location as string
echo $frame->location(); // "/path/to/file.php:123"

// Convert frame to array
$frameData = $frame->toArray();
/*
[
    'file' => '/path/to/file.php',
    'line' => 123,
    'function' => 'methodName',
    'class' => 'ClassName',
    'type' => '::',
]
*/

// Generate editor links
echo $frame->editorLink(); // "phpstorm://open?file=/path/to/file.php&line=123"
```

Running Tests
-------------

[](#running-tests)

```
composer test
```

License
-------

[](#license)

MIT

Author
------

[](#author)

Morten Scheel

###  Health Score

32

—

LowBetter than 72% of packages

Maintenance45

Moderate activity, may be stable

Popularity24

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

2

Last Release

429d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/6514342?v=4)[Morten Scheel](/maintainers/mortenscheel)[@mortenscheel](https://github.com/mortenscheel)

---

Top Contributors

[![mortenscheel](https://avatars.githubusercontent.com/u/6514342?v=4)](https://github.com/mortenscheel "mortenscheel (8 commits)")

---

Tags

phppackageSkeleton

###  Code Quality

TestsPest

Static AnalysisPHPStan, Rector

Code StyleLaravel Pint

Type Coverage Yes

### Embed Badge

![Health badge](/badges/mortenscheel-tracer/health.svg)

```
[![Health](https://phpackages.com/badges/mortenscheel-tracer/health.svg)](https://phpackages.com/packages/mortenscheel-tracer)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
