承接 alecrabbit/php-sneaky-peek 相关项目开发

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

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

alecrabbit/php-sneaky-peek

最新稳定版本:0.0.4

Composer 安装命令:

composer require alecrabbit/php-sneaky-peek

包简介

Private and protected properties and methods accessors. NOT FOR PRODUCTION USE.

README 文档

README

PHP Version Tests Status

Latest Stable Version Packagist Pre Release Version Latest Unstable Version

License

A function to get a peek at private parts of an object.

Installation

composer require --dev alecrabbit/php-sneaky-peek

This package is intended for DEVELOPMENT purposes only.

Usage

class Awesome
{
    private $secret = '1234';
    
    protected function protectedMethod() {
        return 'protected';
    }    
    
    protected static function protectedStaticMethod() {
        return 'protected static';
    }    
}

// ...

peek(new Awesome())->secret; // '1234'
peek(new Awesome())->protectedMethod(); // 'protected'

In case you want to access static properties or methods you can pass FQCN as an argument instead of an object.

peek(Awesome::class)->protectedStaticMethod(); // 'protected static'

How it is different from spatie/invade?

The main difference is invade can work with objects only, while peek can work with both objects and FQCN(class-string).

统计信息

  • 总下载量: 7
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 15
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2024-03-05

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固