horat1us/detect-caller

Util to detect caller of current method/function.

1.0.0 2020-07-03 11:03 UTC

This package is auto-updated.

Last update: 2024-11-29 06:22:04 UTC


README

Latest Stable Version Total Downloads Build Status codecov

Util to detect caller of current method/function.

Installation

Using composer:

composer require horat1us/detect-caller

*Requires PHP 7.4 to stimulate language version upgrade

Usage

<?php declare(strict_types=1);

use Horat1us\DetectCaller;

function ReturnOwnName(): string {
    return DetectCaller::function();
}

echo ReturnOwnName(); // ReturnOwnName

See test case for more examples.

Contributors

License

MIT