guglielmopepe/callbackmapiterator 问题修复 & 功能扩展

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

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

guglielmopepe/callbackmapiterator

Composer 安装命令:

composer require guglielmopepe/callbackmapiterator

包简介

This iterator applies the callback to the elements of the given iterator.

README 文档

README

This iterator applies the callback to the elements of the given iterator.

Table of Contents

Installation

Use Composer

$ composer require guglielmopepe/callbackmapiterator

Usage

The callback should accept up to three arguments: the current item, the current key and the iterator, respectively.

<?php

/**
 * Callback for CallbackMapIterator
 *
 * @param $current   Current item's value
 * @param $key       Current item's key
 * @param $iterator  Iterator being filtered
 * @return mixed     The item after it has been applied the callback function
 */
function my_callback($current, $key, $iterator)
{
    // Your code here
}

?>

Any callable may be used; such as a string containing a function name, an array for a method, or an anonymous function.

<?php

$data = ['foo','bar'];

// A callback
function my_callback($current, $key, $iterator)
{
    if ($key % 2 == 0)
    {
        return $current;
    }

    return \strtoupper($current);
}

// Applies callback
$iterator = new \CallbackMapIterator\CallbackMapIterator(new \ArrayIterator($data), 'my_callback');

?>

Support

If you have a request, please create a GitHub issue.

If you discover a security vulnerability, please send an email to Guglielmo Pepe at info@guglielmopepe.com. All security vulnerabilities will be promptly addressed.

Contributing

If you want to say thank you and/or support the active development of CallbackMapIterator:

  1. Add a GitHub Star to the project.
  2. Share the project on social media.
  3. Write a review or tutorial on Medium, Dev.to or personal blog.

Contacts

If you need information please send an email to info@guglielmopepe.com.

Roadmap

See the list of open issues:

Change log

Please see Changelog file for more information on what has changed recently.

License

Distributed under the MIT License. Please see License File for more information.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2022-01-16

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固