carlosv2/communism 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

carlosv2/communism

Composer 安装命令:

composer require carlosv2/communism

包简介

Little utility to easily extract and inject properties from objects

README 文档

README

Little utility to easily extract and inject properties from objects.

License Build Status SensioLabsInsight

Usage

If you want to extract any object property, use one of the following constructions:

$value = From($object)->property;
// or
$value = From($object)->extract('property');

If you want to inject any object property, use one of the following constructions:

To($object)->property = $value;
// or
To($object)->inject('property', $value);

If you want to replace any object property, use one of the following constructions:

// The `replace` method is avilable for both `From` and `To`
From($object)->property(function ($value) {
    // `$value` will contain the current value for that property
    
    // Whatever is returned will be the new value of the property
    return $newValue;
});
// or
From($object)->replace('property', function ($value) {
    // `$value` will contain the current value for that property
    
    // Whatever is returned will be the new value of the property
    return $newValue;
});

Both functions From and To instantiate a carlosV2\Communism\Communist object which allows the extraction and injection of properties.

Words of wisdom

This project is designed to be used for development environment only. If you find yourself using this project on production code, you should better reconsider your architecture.

Install

Open a command console, enter your project directory and execute the following command to download the latest stable version of this project:

$ composer require --dev carlosv2/communism

This command requires you to have Composer installed globally, as explained in the installation chapter of the Composer documentation.

统计信息

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

GitHub 信息

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

其他信息

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

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固