承接 cemerson/trespass 相关项目开发

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

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

cemerson/trespass

Composer 安装命令:

composer require cemerson/trespass

包简介

A library for modifying private properties of PHP 7 classes from an external context

README 文档

README

A library for modifying private properties of PHP 7 classes from an external context.

Whether it's a good idea to trample all over private properties or not, I don't know, but there may be several reasons you would want to. My use case was providing a database layer with the opportunity to inject insert IDs, current dates etc into an entity class without providing setters which user-land code could abuse or misuse.

Usage is very simple - simply call the static method Trespass::setProperties() and pass in the object and an array of property values you want to set.

Future versions of this library may offer more options such as the ability to not overwrite non-empty properties, or checking for the existence of them before setting. Suggestions, Issues & Pull Requests all welcome!

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2016-10-11

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固