定制 rodrigodornelles/php-array-lib 二次开发

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

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

rodrigodornelles/php-array-lib

Composer 安装命令:

composer require rodrigodornelles/php-array-lib

包简介

simple libary for functional programing paradigm with arrays

关键字:

README 文档

README

version license quality coverage building

simple libary for functional programing paradigm with arrays

Features

  • Test driven development style (TDD)
  • PHP version compatibility 5.4 at 8.2
  • Make your code cleaner and more readable
  • Adds new methods to manipulate arrays (Inspired by ruby, js and other langs)

How to Use

use ArrayCreate;                                  # if you using namespaces

$myNewArray = ArrayCreate::from($myOriginalArray) # instantiate pipeline class
  ->map(someItemFunction)                         # first function to iterate on each item
  ->map(anotherItemFunction)                      # next function to iterate on each item
  ->filter(anotherItemFunction2)                  # next function to filter on each item
  ->construct();                                  # returns new array

Examples

side by side comparison

Make an algorithm that sorts an array, removes the numbers not divisible by 3, and shows the result of each multiplied by 2 and separated by commas.

Libary
Functional
Native
Functional
Structured
libary functional example native functional example structured example

Installation

With Composer

The preferred way to install this extension is through composer.

Either run

$ composer require rodrigodornelles/php-array-lib "~1.0.0"

or add

"rodrigodornelles/php-array-lib": "~1.0.0"

to the require section of your composer.json file.

Without Composer

Step 1

Download libary in https://github.com/RodrigoDornelles/php-array-lib/releases

Step 2

Extract the file into your libraries folder

Step 3

Import the main class

<?php 

require_once __DIR__.'/path/to/my/libaries/php-array-lib/src/ArrayCreate.php';

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: BSD-3-Clause
  • 更新时间: 2022-03-30

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固