lucid/phlist 问题修复 & 功能扩展

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

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

lucid/phlist

Composer 安装命令:

composer require lucid/phlist

包简介

collection modelled after python's list data type.

README 文档

README

Author Source Code Software License

Build Status Code Coverage

Requirements

php >= 7.0master

Installation

$ composer require lucid/phlist

Phlist class

The Phlist class implements a ListInterface and is modelled after pythons list.

<?php

use Lucid\Phlist\Phlist;

$list = new Phlist('foo', 'bar', ...);

ListInterface API

ListInterface ListInterface::push(mixed $value)

<?php
$list = new Phlist('foo');
$list->push('bar'); 
$list->toArray(); // => ['foo', 'bar']

ListInterface ListInterface::insert(int $index, mixed $value)

<?php
$list = new Phlist(1, 2, 3);
$list->insert(1, 1.5); 
$list->toArray(); // => [1, 1.5, 2]

mixed ListInterface::pop(void)

<?php
$list = new Phlist(1, 2, 3);
$list->pop(); // => 3

ListInterface ListInterface::remove(mixed $value)

<?php
$list = new Phlist(1, 2, 3);
$list->remove(2); 
$list->toArray(); // [1, 3]

ListInterface ListInterface::sort(callable $sort|null)

<?php
$list = new Phlist(1, 4, 3, 2);
$list->sort(); 
$list->toArray(); // [1, 2, 3, 4]

$list = new Phlist(1, 4, 3, 2);
$list->sort(function ($a, $b) {
    return $a > $b ? 1 : -1;
}); 
$list->toArray(); // [1, 2, 3, 4]

ListInterface ListInterface::reverse(void)

<?php
$list = new Phlist(1, 2, 3);
$list->reverse();
$list->toArray(); // =>[3, 2, 1]

ListInterface ListInterface::countValue(mixed $value)

<?php
$list = new Phlist(1, 2, 3, 4, 2, 5);
$list->countValue(5); // => 1
$list->countValue(2); // => 2

ListInterface ListInterface::extend(ListInterface $list)

<?php
$listA = new Phlist('a', 'b');
$listB = new Phlist('c', 'd');
$listA->extend($listB);
$listA->toArray() // => ['a', 'b', 'c', 'd'];

统计信息

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

GitHub 信息

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

其他信息

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

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固