johnpbloch/invade
最新稳定版本:v1.0.0
Composer 安装命令:
composer require johnpbloch/invade
包简介
A copy of the invade function from Livewire
README 文档
README
Invade is a utility library shamelessly stolen from Livewire for Laravel. Using invade(), you can easily access all private and protected properties and methods of a class. This is nothing revolutionary or complicated, but it is terribly convenient. I created this as its own package for two reasons:
- I wanted to be able to require this function as a dev dependency, since I don't love the idea of this function being available in non-dev installations
- I wanted to use it in non-Laravel codebases
Installation
composer require --dev johnpbloch/invade
Usage
# supposing there is a class like this: class StateManager { private $dataYouAreDebugging = []; /* ... */ } # and supposing you have an instance of StateManager and you need to see that data: /** @var StateManager $instance */ \var_dump(\invade($instance)->dataYouAreDebugging);
invade() will also give you the ability to set non-public properties and to call non-public methods.
统计信息
- 总下载量: 19.31k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2022-02-11