承接 johnpbloch/invade 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

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:

  1. 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
  2. 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

GitHub 信息

  • Stars: 1
  • Watchers: 1
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2022-02-11