awesomite/stack-trace

The wrapper for debug_backtrace() function

v0.10.2 2017-08-30 21:13 UTC

README

Codacy Badge Coverage Status Build Status

Abstract layer for debug_backtrace() function.

Usage

See documentation.

use Awesomite\StackTrace\StackTraceFactory;

$factory = new StackTraceFactory();
$stackTrace = $factory->create();
foreach ($stackTrace as $step) {
    $placeInCode = $step->getPlaceInCode();
    $line = $placeInCode->getLineNumber();
    $fileName = $placeInCode->getFileName();
    $function = $step->getCalledFunction()->getName();
    echo "Function {$function} is called from {$fileName}:{$line}\n";
}

Installation

composer require awesomite/stack-trace

Versioning

The version numbers follow the Semantic Versioning 2.0.0 scheme. Read more about backward compatibility.

Running tests

See documentation for tests.