horat1us/detect-caller

用于检测当前方法/函数的调用者。

1.0.0 2020-07-03 11:03 UTC

This package is auto-updated.

Last update: 2024-09-29 05:49:33 UTC


README

Latest Stable Version Total Downloads Build Status codecov

用于检测当前方法/函数的调用者。

安装

使用 composer

composer require horat1us/detect-caller

*需要 PHP 7.4 以刺激语言版本升级

用法

<?php declare(strict_types=1);

use Horat1us\DetectCaller;

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

echo ReturnOwnName(); // ReturnOwnName

更多示例请参考 测试用例

贡献者

许可证

MIT