francalek/datatype 问题修复 & 功能扩展

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

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

francalek/datatype

最新稳定版本:v0.1

Composer 安装命令:

composer require francalek/datatype

包简介

Useful data types for PHP.

README 文档

README

Requirements

This package works with PHP >= 7.1

Installation

The best way to install this package is using Composer:

$ composer require francalek/datatype

Usage

CountableIterator

This abstract class implements only \Countable and \Iterator interfaces and has own storage.

Data for iterating and counting must be in protected property $this->countableIterator.

use Francalek\DataType\CountableIterator;

class Sheeps extends CountableIterator
{
	public function __construct(int $sheeps = 5)
	{
		$herd = array_fill(0, $sheeps, 'Sheep');
		$this->countableIterator = $herd;
	}
}

And now you can iterating through your class:

echo "I can't sleep :(\n";

$sheeps = new Sheeps();
foreach ($sheeps as $nr => $sheep) {
	echo $sheep.' '.(++$nr)."\n";
}

exit("Chrrr...\n");

Or counting:

echo "I can't sleep :(\n";

$sheeps = new Sheeps();
echo "I have ".count($sheeps)." sheeps in total.\n";

exit("Chrrr...\n");

Run tests

To run tests:

$ git clone https://github.com/francalek/DataType.git
$ cd DataType/
$ ./tests/run.sh

# Or over Composer
$ composer tests

Contribute

  • If you found a bug or have an idea for a new feature, you can create new Issue.
  • Fork this repository to start adding new features, fixing bugs or creating more tests.
  • Don't forget send a pull request to get your changes in this package.
  • Read full text of Contributing.

License

This package is licensed under the MIT License.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2022-07-06

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固