定制 felixdorn/property-accessor 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

felixdorn/property-accessor

Composer 安装命令:

composer require felixdorn/property-accessor

包简介

Read an unaccessible property with a nice helper

README 文档

README

Tests Formats Version Total Downloads License

Installation

Requires PHP 8.0.0+

You can install the package via composer:

composer require felixdorn/property-accessor

Usage

use function \Felix\PropertyAccessor\access;

class Book {
    protected string $name = 'Harry Potter';
    protected int $isbn = 44081224;
}

$object = new Book();
access($object, 'isbn');  // returns 44081224 

// Properties are injected based on the parameter name passed to the function.
access($object, function ($isbn, $name) {
    return $isbn . ' - ' . $name;
}); // returns '44081124 - Harry Potter'

access($object, ['isbn', 'name']); // returns ['isbn' => 44081224, 'name' => 'Harry Potter']

Testing

composer test

Property Accessor was created by Félix Dorn under the MIT license.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2021-03-29

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固