cyril-verloop/iterator 问题修复 & 功能扩展

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

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

cyril-verloop/iterator

最新稳定版本:3.1.1

Composer 安装命令:

composer require cyril-verloop/iterator

包简介

An iterator utility.

README 文档

README

A simple PHP iterator abstract class requiring PHP 8.0+.

License Type coverage Minimum PHP version

Installation

As a Composer depedency

In your project directory run

user@host project$ composer require "cyril-verloop/iterator"

For development purposes

user@host ~$ cd [PATH_WHERE_TO_PUT_THE_PROJECT] # E.g. ~/projects/
user@host projects$ git clone https://github.com/cyrilverloop/iterator.git
user@host projects$ cd iterator
user@host iterator$ composer install -o
user@host datatables$ phive install --trust-gpg-keys 4AA394086372C20A,99BF4D9A33D65E1E,31C7E470E2138192,8AC0BAA79732DD42,C5095986493B4AA0

Usage

You need to extend the abstract class and you can add parameter and return types.

<?php

declare(strict_types=1);

namespace MyNamespace;

use MyNamespace\Item;

class Items extends IntPosition
{
    public function add(Item $item): void
    {
        $this->list[count($this->list)] = $item;
    }

    public function current(): Item
    {
        return parent::current();
    }
}

Then, you can use it in a foreach loop :

$items->add($item1);
$items->add($item2);

foreach($items as $item) {
    // Do something.
}

Continuous integration

Tests

To run the tests :

user@host iterator$ ./tools/phpunit -c ./ci/phpunit.xml

The generated outputs will be in ./ci/phpunit/. Look at ./ci/phpunit/html/index.html for code coverage and ./ci/phpunit/testdox.html for a verbose list of passing / failing tests.

To run mutation testing, you must run PHPUnit first, then :

user@host doctrine-entities$ ./tools/infection -c./ci/infection.json

The generated outputs will be in ./ci/infection/.

Static analysis

To do a static analysis :

user@host iterator$ ./tools/psalm -c ./ci/psalm.xml [--report=./psalm/psalm.txt --output-format=text]

Use "--report=./psalm/psalm.txt --output-format=text" if you want the output in a file instead of on screen.

PHPDoc

To generate the PHPDoc :

user@host iterator$ ./tools/phpdocumentor --config ./ci/phpdoc.xml

The generated HTML documentation will be in ./ci/phpdoc/.

Standard

All PHP files in this project follows PSR-12. To indent the code :

user@host doctrine-entities$ ./tools/phpcbf --standard=PSR12 --extensions=php -p ./src/ ./tests/

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2020-11-04

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固