定制 simones/partial 二次开发

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

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

simones/partial

Composer 安装命令:

composer require simones/partial

包简介

Function partial application

README 文档

README

Build Status

Apply partial arguments to your functions.

Install

$ composer require simones/partial

Usage

Bind a subset of a function's arguments and get a new function back that accepts the remaining arguments. It is most useful if you write functional programming or don't like using use with anonymous functions. You can get a Partial instance via instantiation or with the partial helper.

Here are some examples (for more, head to the spec):

// one-argument binding
$hello = partial('printf', ['Hello, %s']);
$hello('world') // print "Hello, world"
// or
$hello->call('world')


// multiple arguments binding
$countdown = partial('printf', ['%s, %s, %s, go!', 'Three']);
$countdown('Two', 'One'); // print "Three, Two, One, go!"


// you can skip argument, and they will be filled on call time
$countdown = partial('printf', ['%s, %s, %s, go!', Partial::SKIP, 'Two']);
$countdown('Trhee', 'One'); // print "Three, Two, One, go!"

统计信息

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

GitHub 信息

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

其他信息

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

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固