Skip to content

Commit

Permalink
chore: Update static files.
Browse files Browse the repository at this point in the history
  • Loading branch information
drupol committed Aug 29, 2022
1 parent 1bafe72 commit 5037520
Show file tree
Hide file tree
Showing 10 changed files with 131 additions and 106 deletions.
14 changes: 7 additions & 7 deletions .auto-changelog
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"output": "CHANGELOG.md",
"template": "keepachangelog",
"unreleased": true,
"commitLimit": false,
"hideCredit": true,
"sortCommits": "date-desc",
"breakingPattern": "BREAKING CHANGE: yes"
"output": "CHANGELOG.md",
"template": "keepachangelog",
"unreleased": true,
"commitLimit": false,
"hideCredit": true,
"sortCommits": "date-desc",
"breakingPattern": "BREAKING CHANGE: yes"
}
19 changes: 6 additions & 13 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -1,24 +1,17 @@
# This file is for unifying the coding style for different editors and IDEs
# editorconfig.org

# PHP PSR-2 Coding Standards
# http://www.php-fig.org/psr/psr-2/

root = true

[*.{php,inc,module}]
[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
indent_style = space
indent_size = 4
max_line_length = 120

[*.{json,json.dist,yml,yaml,yml.dist,yaml.dist}]
indent_size = 4
indent_style = space
insert_final_newline = true
max_line_length = 120
trim_trailing_whitespace = true

[*.{md}]
[**.md]
indent_size = 2
max_line_length = 80
max_line_length = 80
51 changes: 40 additions & 11 deletions .github/CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,17 @@

## Our Pledge

In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation.
In the interest of fostering an open and welcoming environment, we as
contributors and maintainers pledge to making participation in our project and
our community a harassment-free experience for everyone, regardless of age, body
size, disability, ethnicity, gender identity and expression, level of
experience, nationality, personal appearance, race, religion, or sexual identity
and orientation.

## Our Standards

Examples of behavior that contributes to creating a positive environment include:
Examples of behavior that contributes to creating a positive environment
include:

- Using welcoming and inclusive language
- Being respectful of differing viewpoints and experiences
Expand All @@ -16,31 +22,54 @@ Examples of behavior that contributes to creating a positive environment include

Examples of unacceptable behavior by participants include:

- The use of sexualized language or imagery and unwelcome sexual attention or advances
- The use of sexualized language or imagery and unwelcome sexual attention or
advances
- Trolling, insulting/derogatory comments, and personal or political attacks
- Public or private harassment
- Publishing others' private information, such as a physical or electronic address, without explicit permission
- Other conduct which could reasonably be considered inappropriate in a professional setting
- Publishing others' private information, such as a physical or electronic
address, without explicit permission
- Other conduct which could reasonably be considered inappropriate in a
professional setting

## Our Responsibilities

Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior.
Project maintainers are responsible for clarifying the standards of acceptable
behavior and are expected to take appropriate and fair corrective action in
response to any instances of unacceptable behavior.

Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.
Project maintainers have the right and responsibility to remove, edit, or reject
comments, commits, code, wiki edits, issues, and other contributions that are
not aligned to this Code of Conduct, or to ban temporarily or permanently any
contributor for other behaviors that they deem inappropriate, threatening,
offensive, or harmful.

## Scope

This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers.
This Code of Conduct applies both within project spaces and in public spaces
when an individual is representing the project or its community. Examples of
representing a project or community include using an official project e-mail
address, posting via an official social media account, or acting as an appointed
representative at an online or offline event. Representation of a project may be
further defined and clarified by project maintainers.

## Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at [email protected]. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.
Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported by contacting the project team at [email protected]. The
project team will review and investigate all complaints, and will respond in a
way that it deems appropriate to the circumstances. The project team is
obligated to maintain confidentiality with regard to the reporter of an
incident. Further details of specific enforcement policies may be posted
separately.

Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership.
Project maintainers who do not follow or enforce the Code of Conduct in good
faith may face temporary or permanent repercussions as determined by other
members of the project's leadership.

## Attribution

This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version]
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
version 1.4, available at [http://contributor-covenant.org/version/1/4][version]

[homepage]: http://contributor-covenant.org
[version]: http://contributor-covenant.org/version/1/4/
10 changes: 7 additions & 3 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
# CONTRIBUTING

We're using [GitHub Actions](https://docs.github.com/en/actions) as a continuous integration system.
We're using [GitHub Actions](https://docs.github.com/en/actions) as a continuous
integration system.

For details, see the workflows in [.github/workflows](../.github/workflows).

## Tests

We're using [`grumphp/grumphp`](https://github.com/phpro/grumphp) to drive the development.
We're using [`grumphp/grumphp`](https://github.com/phpro/grumphp) to drive the
development.

Run

Expand All @@ -18,7 +20,9 @@ to run all the tests.

## Coding Standards

We are using [`drupol/php-conventions`](https://github.com/drupol/php-conventions) to enforce coding standards.
We are using
[`drupol/php-conventions`](https://github.com/drupol/php-conventions) to enforce
coding standards.

Run

Expand Down
4 changes: 1 addition & 3 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,4 @@ This PR:
- [ ] Has documentation
- [ ] Is an experimental thing

Follows #.
Related to #.
Fixes #.
Follows #. Related to #. Fixes #.
2 changes: 1 addition & 1 deletion .github/settings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ branches:
- "Mutation Testing (ubuntu-latest, 8.1)"
- "Code Style (ubuntu-latest, 7.4)"
- "Code Style (ubuntu-latest, 8.1)"

- "prettier"
restrictions: null
required_linear_history: true

Expand Down
5 changes: 2 additions & 3 deletions .github/stale.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,5 @@ daysUntilClose: 7
staleLabel: stale

markComment: >
This issue has been automatically marked as stale because it has not had
recent activity. It will be closed if no further activity occurs. Thank you
for your contributions.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no
further activity occurs. Thank you for your contributions.
3 changes: 3 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"proseWrap": "always"
}
15 changes: 4 additions & 11 deletions .scrutinizer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,12 @@ build:
environment:
php:
version: 8.1
dependencies:
before:
- pecl install pcov
tests:
override:
- php-scrutinizer-run
coverage:
dependencies:
before:
- pecl install pcov
pecl_extensions:
- pcov

filter:
paths:
- 'src/*'
- "src/*"

tools:
external_code_coverage:
Expand Down
114 changes: 60 additions & 54 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
[![Latest Stable Version][latest stable version]][1]
[![GitHub stars][github stars]][1]
[![Total Downloads][total downloads]][1]
[![GitHub stars][github stars]][1] [![Total Downloads][total downloads]][1]
[![GitHub Workflow Status][github workflow status]][2]
[![Scrutinizer code quality][code quality]][3]
[![Type Coverage][type coverage]][4]
[![Code Coverage][code coverage]][3]
[![Type Coverage][type coverage]][4] [![Code Coverage][code coverage]][3]
[![Mutation testing badge][mutation badge image]][mutation badge link]
[![License][license]][1]
[![Donate!][donate github]][5]
[![License][license]][1] [![Donate!][donate github]][5]

# PHP Iterators

Expand All @@ -19,11 +16,14 @@ The missing PHP iterators.

- `CachingIteratorAggregate`
- `ChunkIterableAggregate`
- `ClosureIterator`: `ClosureIterator(callable $callable, array $arguments = [])`
- `ClosureIteratorAggregate`: `ClosureIteratorAggregate(callable $callable, array $arguments = [])`
- `ClosureIterator`:
`ClosureIterator(callable $callable, array $arguments = [])`
- `ClosureIteratorAggregate`:
`ClosureIteratorAggregate(callable $callable, array $arguments = [])`
- `ConcatIterableAggregate`
- `FilterIterableAggregate`
- `InterruptableIterableIteratorAggregate`: `InterruptableIterableIteratorAggregate(iterable $iterable)`
- `InterruptableIterableIteratorAggregate`:
`InterruptableIterableIteratorAggregate(iterable $iterable)`
- `IterableIterator`: `IterableIterator(iterable $iterable)`
- `IterableIteratorAggregate`: `IterableIteratorAggregate(iterable $iterable)`
- `MapIterableAggregate`
Expand All @@ -48,15 +48,14 @@ The missing PHP iterators.

### CachingIteratorAggregate

Let you cache any iterator. You then get [\Generators][49]
rewindable for free.
Let you cache any iterator. You then get [\Generators][49] rewindable for free.

This implementation does not use internal state to keep track
of the current position of the iterator.
The underlying mechanism is based on [SPL \CachingIterator][48].
This implementation does not use internal state to keep track of the current
position of the iterator. The underlying mechanism is based on [SPL
\CachingIterator][48].

The pros of using that iterator is **performance**. It's blazing fast,
it cannot compare to any other stateful custom implementations.
The pros of using that iterator is **performance**. It's blazing fast, it cannot
compare to any other stateful custom implementations.

This iterator will cache keys and values, of any type.

Expand Down Expand Up @@ -269,21 +268,18 @@ foreach ($iteratorAggregate->rest() as $v) {

### RandomIterableAggregate

In order to properly use this iterator, the user need to
provide an extra parameter `seed`. By default, this parameter
is set to zero and thus, the resulting iterator will be
identical to the original one.
In order to properly use this iterator, the user need to provide an extra
parameter `seed`. By default, this parameter is set to zero and thus, the
resulting iterator will be identical to the original one.

Random items are selected by choosing a random integer between
zero and the value of `seed`. If that value is zero, then the
iterator will yield else it will skip the value and start
again with the next one.
Random items are selected by choosing a random integer between zero and the
value of `seed`. If that value is zero, then the iterator will yield else it
will skip the value and start again with the next one.

The bigger the `seed` is, the bigger the entropy will be and
the longer it will take to yield random items.
It's then up to the user to choose an appropriate value.
Usually a good value is twice the approximate amount of items
the decorated iterator has.
The bigger the `seed` is, the bigger the entropy will be and the longer it will
take to yield random items. It's then up to the user to choose an appropriate
value. Usually a good value is twice the approximate amount of items the
decorated iterator has.

If you're willing to iterate multiple times on this, use the
`CachingIteratorAggregate` to cache the results.
Expand Down Expand Up @@ -329,31 +325,29 @@ foreach ($iterator as $reduction) {} // [0, 1, 3, 6, 10, 15, 21, 28, 36, 45, 55]

## Code quality, tests, benchmarks

Every time changes are introduced into the library, [Github][2] runs the
tests.
Every time changes are introduced into the library, [Github][2] runs the tests.

The library has tests written with [PHPUnit][35].
Feel free to check them out in the `tests` directory.
The library has tests written with [PHPUnit][35]. Feel free to check them out in
the `tests` directory.

Before each commit, some inspections are executed with [GrumPHP][36]; run
`composer grumphp` to check manually.

The quality of the tests is tested with [Infection][37] a PHP Mutation testing
framework - run `composer infection` to try it.

Static analyzers are also controlling the code. [PHPStan][38] and
[PSalm][39] are enabled to their maximum level.
Static analyzers are also controlling the code. [PHPStan][38] and [PSalm][39]
are enabled to their maximum level.

## Contributing

Feel free to contribute by sending pull requests. We are a
usually very responsive team and we will help you going
through your pull request from the beginning to the end.
Feel free to contribute by sending pull requests. We are a usually very
responsive team and we will help you going through your pull request from the
beginning to the end.

For some reasons, if you can't contribute to the code and
willing to help, sponsoring is a good, sound and safe way
to show us some gratitude for the hours we invested in this
package.
For some reasons, if you can't contribute to the code and willing to help,
sponsoring is a good, sound and safe way to show us some gratitude for the hours
we invested in this package.

Sponsor me on [Github][5] and/or any of [the contributors][6].

Expand All @@ -369,18 +363,30 @@ For more detailed changelogs, please check [the release changelogs][45].
[4]: https://shepherd.dev/github/loophp/iterators
[5]: https://github.com/sponsors/drupol
[6]: https://github.com/loophp/iterators/graphs/contributors
[latest stable version]: https://img.shields.io/packagist/v/loophp/iterators.svg?style=flat-square
[github stars]: https://img.shields.io/github/stars/loophp/iterators.svg?style=flat-square
[total downloads]: https://img.shields.io/packagist/dt/loophp/iterators.svg?style=flat-square
[github workflow status]: https://img.shields.io/github/workflow/status/loophp/iterators/Unit%20tests?style=flat-square
[code quality]: https://img.shields.io/scrutinizer/quality/g/loophp/iterators/main.svg?style=flat-square
[type coverage]: https://img.shields.io/badge/dynamic/json?style=flat-square&color=color&label=Type%20coverage&query=message&url=https%3A%2F%2Fshepherd.dev%2Fgithub%2Floophp%2Fiterators%2Fcoverage
[code coverage]: https://img.shields.io/scrutinizer/coverage/g/loophp/iterators/main.svg?style=flat-square
[license]: https://img.shields.io/packagist/l/loophp/iterators.svg?style=flat-square
[donate github]: https://img.shields.io/badge/Sponsor-Github-brightgreen.svg?style=flat-square
[donate paypal]: https://img.shields.io/badge/Sponsor-Paypal-brightgreen.svg?style=flat-square
[mutation badge image]: https://img.shields.io/endpoint?style=flat-square&url=https%3A%2F%2Fbadge-api.stryker-mutator.io%2Fgithub.com%2Floophp%2Fiterators%2Fmain
[mutation badge link]: https://dashboard.stryker-mutator.io/reports/github.com/loophp/iterators/main
[latest stable version]:
https://img.shields.io/packagist/v/loophp/iterators.svg?style=flat-square
[github stars]:
https://img.shields.io/github/stars/loophp/iterators.svg?style=flat-square
[total downloads]:
https://img.shields.io/packagist/dt/loophp/iterators.svg?style=flat-square
[github workflow status]:
https://img.shields.io/github/workflow/status/loophp/iterators/Unit%20tests?style=flat-square
[code quality]:
https://img.shields.io/scrutinizer/quality/g/loophp/iterators/main.svg?style=flat-square
[type coverage]:
https://img.shields.io/badge/dynamic/json?style=flat-square&color=color&label=Type%20coverage&query=message&url=https%3A%2F%2Fshepherd.dev%2Fgithub%2Floophp%2Fiterators%2Fcoverage
[code coverage]:
https://img.shields.io/scrutinizer/coverage/g/loophp/iterators/main.svg?style=flat-square
[license]:
https://img.shields.io/packagist/l/loophp/iterators.svg?style=flat-square
[donate github]:
https://img.shields.io/badge/Sponsor-Github-brightgreen.svg?style=flat-square
[donate paypal]:
https://img.shields.io/badge/Sponsor-Paypal-brightgreen.svg?style=flat-square
[mutation badge image]:
https://img.shields.io/endpoint?style=flat-square&url=https%3A%2F%2Fbadge-api.stryker-mutator.io%2Fgithub.com%2Floophp%2Fiterators%2Fmain
[mutation badge link]:
https://dashboard.stryker-mutator.io/reports/github.com/loophp/iterators/main
[34]: https://github.com/loophp/iterators/issues
[35]: https://www.phpunit.de/
[36]: https://github.com/phpro/grumphp
Expand Down

0 comments on commit 5037520

Please sign in to comment.