Iterators - The missing PHP iterators.

Overview

Latest Stable Version GitHub stars Total Downloads GitHub Workflow Status Scrutinizer code quality Type Coverage Code Coverage Mutation testing badge License Donate!

PHP Iterators

Description

The missing PHP iterators.

Features

  • CachingIteratorAggregate
  • ClosureIterator: ClosureIterator(callable $callable, array $arguments = [])
  • ClosureIteratorAggregate: ClosureIteratorAggregate(callable $callable, array $arguments = [])
  • IterableIterator: IterableIterator(iterable $iterable)
  • IterableIteratorAggregate: IterableIteratorAggregate(iterable $iterable)
  • PackIterableAggregate
  • UnpackIterableAggregate
  • PausableIteratorAggregate
  • RandomIterableAggregate

Installation

composer require loophp/iterators

Usage

CachingIteratorAggregate

Let you cache any iterator. You then get \Generators 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.

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.

<?php

// Generator
$generator = static function (): \Generator {
    yield true => 'foo';
    yield false => 'bar';
    yield ['foo', 'bar'] => 'foobar';
};

$iterator = new CachingIteratorAggregate($generator());

foreach ($iterator as $key => $value); // This will work.
foreach ($iterator as $key => $value); // This will also work.

PackIterableAggregate

<?php

// Generator
$generator = static function (): \Generator {
    yield true => 'foo';
    yield false => 'bar';
    yield ['foo', 'bar'] => 'foobar';
};

$iterator = new PackIterableAggregate($generator());

foreach ($iterator as $value);
/*
$value will yield the following values:

- [true, 'foo']
- [false, 'bar']
- [['foo', 'bar'], 'foobar']
*/

UnpackIterableAggregate

<?php

// Generator
$generator = static function (): \Generator {
    yield [true, 'foo'];
    yield [false, 'bar'];
    yield [['foo', 'bar'], 'foobar'];
};

$iterator = new UnpackIterableAggregate($generator());

foreach ($iterator as $key => $value);
/*
$key and $value will yield the following values:

- true => 'foo'
- false => 'bar'
- ['foo', 'bar'] => 'foobar'
*/

ClosureIterator

<?php

$callable = static fn (int $from, int $to) => yield from range($from, $to);

$iterator = new ClosureIterator($callable(10, 20));

IterableIterator

<?php

$iterator = new IterableIterator(range(1, 10));

PausableIteratorAggregate

<?php

$inputIterator = new ArrayIterator(range('a', 'e'));
$iteratorAggregate = new PausableIteratorAggregate($inputIterator);

$i = 0;
foreach ($iteratorAggregate as $v) {
    var_dump($v) // Print: 'a', 'b', 'c'
    if (++$i === 2) {
        break;
    }
}

foreach ($iteratorAggregate->rest() as $v) {
    var_dump($v) // Print: 'd', 'e'
}

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.

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.

If you're willing to iterate multiple times on this, use the CachingIteratorAggregate to cache the results.

This iterator works on keys and values, of any type.

<?php

$seed = random_int(0, 1000);
$inputIterator = new ArrayIterator(range('a', 'e'));
$iterator = new RandomIterableAggregate($inputIterator, $seed);

foreach ($iterator as $v) {
    var_dump($v);
}

$iterator = new CachingIteratorAggregate(
    (new RandomIterableAggregate($inputIterator, $seed))->getIterator()
);

foreach ($iterator as $v) {
    var_dump($v);
}
foreach ($iterator as $v) {
    var_dump($v);
}

Code quality, tests, benchmarks

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

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

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

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

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

Contributing

Feel free to contribute by sending Github pull requests. I'm quite responsive :-)

If you can't contribute to the code, you can also sponsor me on Github.

Changelog

See CHANGELOG.md for a changelog based on git commits.

For more detailed changelogs, please check the release changelogs.

Comments
  • [WIP] Introduce PaginatingIterator

    [WIP] Introduce PaginatingIterator

    This PR:

    • [x] Provides a new iterator to help paginate through paginated API results
    • [x] Has unit tests (phpunit)
    • [ ] Has static analysis tests (psalm, phpstan)
    • [ ] Has documentation
    stale 
    opened by AlexandruGG 3
  • chore(deps): Bump actions/stale from 5 to 6

    chore(deps): Bump actions/stale from 5 to 6

    Bumps actions/stale from 5 to 6.

    Release notes

    Sourced from actions/stale's releases.

    v6.0.0

    :warning: Breaking change :warning:

    Issues/PRs default close-issue-reason is now not_planned(#789)

    V5.2.0

    Features: New option include-only-assigned enables users to process only issues/PRs that are already assigned. If there is no assignees and this option is set, issue will not be processed per: issue/596

    Fixes: Fix date comparison edge case PR/816

    Dependency Updates: PR/812

    Fix issue when days-before-close is more than days-before-stale

    fixes a bug introduced in #717

    fixed in #775

    v5.1.0

    [5.1.0]

    Don't process stale issues right after they're marked stale Add close-issue-reason option #764#772 Various dependabot/dependency updates

    Changelog

    Sourced from actions/stale's changelog.

    Changelog

    [6.0.0]

    :warning: Breaking change :warning:

    Issues/PRs default close-issue-reason is now not_planned(#789)

    [5.1.0]

    Don't process stale issues right after they're marked stale [Add close-issue-reason option]#764#772 Various dependabot/dependency updates

    4.1.0 (2021-07-14)

    Features

    4.0.0 (2021-07-14)

    Features

    Bug Fixes

    • dry-run: forbid mutations in dry-run (#500) (f1017f3), closes #499
    • logs: coloured logs (#465) (5fbbfba)
    • operations: fail fast the current batch to respect the operations limit (#474) (5f6f311), closes #466
    • label comparison: make label comparison case insensitive #517, closes #516
    • filtering comments by actor could have strange behavior: "stale" comments are now detected based on if the message is the stale message not who made the comment(#519), fixes #441, #509, #518

    Breaking Changes

    • The options skip-stale-issue-message and skip-stale-pr-message were removed. Instead, setting the options stale-issue-message and stale-pr-message will be enough to let the stale workflow add a comment. If the options are unset, a comment will not be added which was the equivalent of setting skip-stale-issue-message to true.
    • The operations-per-run option will be more effective. After migrating, you could face a failed-fast process workflow if you let the default value (30) or set it to a small number. In that case, you will see a warning at the end of the logs (if enabled) indicating that the workflow was stopped sooner to avoid consuming too much API calls. In most cases, you can just increase this limit to make sure to process everything in a single run.
    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependencies stale github_actions 
    opened by dependabot[bot] 2
  • chore(deps): Bump shivammathur/setup-php from 2.18.1 to 2.21.2

    chore(deps): Bump shivammathur/setup-php from 2.18.1 to 2.21.2

    Bumps shivammathur/setup-php from 2.18.1 to 2.21.2.

    Release notes

    Sourced from shivammathur/setup-php's releases.

    2.21.2

    Support Ukraine


    • Added support for rector in tools input. #627
    - name: Setup PHP
      uses: shivammathur/setup-php@v2
      with:
        php-version: `8.1`
        tools: rector
    
    • Added support for ast extension on macOS using shivammathur/extensions tap.
    - name: Setup PHP
      uses: shivammathur/setup-php@v2
      with:
        php-version: `8.1`
        extensions: ast
    
    • Fixed support for symfony-cli on Linux #632
    - name: Setup PHP
      uses: shivammathur/setup-php@v2
      with:
        php-version: `8.1`
        tools: symfony
    
    • Fixed installing unstable extensions from PECL. #625
    • Updated Node.js dependencies.

    2.21.1

    Support Ukraine

    ... (truncated)

    Commits
    • e04e1d9 Bump Node.js dependencies
    • 52685a3 Add support to install rector in tools input
    • 44d81f9 Fix symfony support
    • 401bdec Add support for ast from shivammathur/extensions on macOS
    • aa82ffc Fix logs in add_pecl_extension
    • 7e03c76 Fix extension setup using PECL on Linux and macOS
    • 16011a7 Upgrade Node.js dependencies
    • 66f2447 Fix reading composer package type for older versions
    • e57ea71 Fix scoped tool setup on Windows
    • e8ba27f Fail on npm audit again
    • Additional commits viewable in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependencies stale 
    opened by dependabot[bot] 2
  • chore(deps): Bump shivammathur/setup-php from 2.18.1 to 2.21.1

    chore(deps): Bump shivammathur/setup-php from 2.18.1 to 2.21.1

    Bumps shivammathur/setup-php from 2.18.1 to 2.21.1.

    Release notes

    Sourced from shivammathur/setup-php's releases.

    2.21.1

    Support Ukraine


    • Fixed installing tools' old versions which are composer plugins.

    • Updated Node.js dependencies.


    2.21.0

    Support Ukraine


    • Added support for Laravel Pint #613, #614
    - name: Setup PHP
      uses: shivammathur/setup-php@v2
      with:
        php-version: `8.1`
        tools: pint
    
    - name: Setup PHP
      uses: shivammathur/setup-php@v2
      with:
        php-version: `8.1`
        extensions: phalcon5
    
    • Added support for Private Packagist authentication for composer. Docs

    ... (truncated)

    Commits
    • 16011a7 Upgrade Node.js dependencies
    • 66f2447 Fix reading composer package type for older versions
    • e57ea71 Fix scoped tool setup on Windows
    • e8ba27f Fail on npm audit again
    • 945c34c Update README
    • c8c64c6 Bump version to 2.21.0
    • 0d3f92f Add support for phalcon5 on Windows
    • 4979d5b Add workaround for missing phalcon packages on Ubuntu 22.04
    • 0d9a1ba Add support for phalcon5 on Linux and macOS
    • 3ede765 Add check for gd in php.yml
    • Additional commits viewable in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependencies stale 
    opened by dependabot[bot] 2
  • chore(deps): Bump shivammathur/setup-php from 2.18.1 to 2.21.0

    chore(deps): Bump shivammathur/setup-php from 2.18.1 to 2.21.0

    Bumps shivammathur/setup-php from 2.18.1 to 2.21.0.

    Release notes

    Sourced from shivammathur/setup-php's releases.

    2.21.0

    Support Ukraine


    • Added support for Laravel Pint #613, #614
    - name: Setup PHP
      uses: shivammathur/setup-php@v2
      with:
        php-version: `8.1`
        tools: pint
    
    - name: Setup PHP
      uses: shivammathur/setup-php@v2
      with:
        php-version: `8.1`
        extensions: phalcon5
    
    • Added support for Private Packagist authentication for composer. Docs
    - name: Setup PHP
      uses: shivammathur/setup-php@v2
      with:
        php-version: '8.1'
      env:
        PACKAGIST_TOKEN: ${{ secrets.PACKAGIST_TOKEN }}
    
    • Added support for manual JSON-based authentication for composer Docs
    - name: Setup PHP
      uses: shivammathur/setup-php@v2
      with:
        php-version: '8.1'
      env:
        COMPOSER_AUTH_JSON: |
          {
            "http-basic": {
              "example.org": {
    </tr></table> 
    

    ... (truncated)

    Commits
    • 945c34c Update README
    • c8c64c6 Bump version to 2.21.0
    • 0d3f92f Add support for phalcon5 on Windows
    • 4979d5b Add workaround for missing phalcon packages on Ubuntu 22.04
    • 0d9a1ba Add support for phalcon5 on Linux and macOS
    • 3ede765 Add check for gd in php.yml
    • f3cdc07 Merge pull request #617 from ChristophWurst/demo/php82-gd
    • 109db64 Demo PHP8.2+gd failure
    • 3ccc00e Merge pull request #614 from d8vjork/master
    • 0f688a1 Add support for tool Laravel Pint
    • Additional commits viewable in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependencies stale 
    opened by dependabot[bot] 2
  • chore(deps): Bump shivammathur/setup-php from 2.18.1 to 2.20.1

    chore(deps): Bump shivammathur/setup-php from 2.18.1 to 2.20.1

    Bumps shivammathur/setup-php from 2.18.1 to 2.20.1.

    Release notes

    Sourced from shivammathur/setup-php's releases.

    2.20.1

    Support Ukraine



    2.20.0

    Support Ukraine


    • Improved support for event extension on Linux and macOS for PHP 5.4 and above. #604

    • Fixed support for composer plugins in tools input. Since composer 2.2, the plugins are required to be marked as allowed in the composer config. This will now be done by default. #611

    • Added support to show code coverage driver's (Xdebug/PCOV) version in the logs when setup using the coverage input. #610

    • Fixed a bug where PHP was not added to PATH during the action run on self-hosted Windows environments. #609

    • Fixed a bug where the tool cache path was not set on self-hosted environments. #606

    • Updated Node.js dependencies.


    Thanks! @​jrfnl, @​dino182 and @​markseuffert for the contributions 🚀

    ... (truncated)

    Commits
    • 3312ea6 Bump version to 2.20.1
    • ce49f82 Do not add composer plugins to allow list for composer v1
    • cf5cd90 Improve support for composer authenticating private respositories
    • cdb037c Bump version to 2.20.0
    • 261f13a Add composer plugins to allow list before installing
    • 9eaa66d Add support for event extension on unix
    • da9dfe4 Set RUNNER_TOOL_CACHE on self-hosted environments
    • a863ab6 Add support to allow composer plugins
    • 050cb80 Add coverage driver version in logs
    • 3fda17f Merge pull request #609 from dino182/develop
    • Additional commits viewable in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependencies stale 
    opened by dependabot[bot] 2
  • chore(deps): Bump shivammathur/setup-php from 2.18.1 to 2.19.1

    chore(deps): Bump shivammathur/setup-php from 2.18.1 to 2.19.1

    Bumps shivammathur/setup-php from 2.18.1 to 2.19.1.

    Release notes

    Sourced from shivammathur/setup-php's releases.

    2.19.1

    Support Ukraine


    • Fixed support for deployer.

    • Updated Node.js dependencies.


    2.19.0

    Support Ukraine


    • Added support for ubuntu-22.04 runner. Docs

    • Added support for Couchbase extension 4.x for PHP 7.4 and above. Also added support to specify the extension version you need. shivammathur/setup-php#593

      Note: Please use the extensions cache if using the latest Couchbase version on Linux as it can take 10+ minutes to build along with its library.

      To install the latest version of couchbase extension

      - name: Setup PHP
        uses: shivammathur@setup-php@v2
        with:
          php-version: '8.1'
          extensions: couchbase
      

      To install a specific version - suffix couchbase with exact version you want in the extensions input.

      - name: Setup PHP
        uses: shivammathur@setup-php@v2
        with:
          php-version: '7.4'
      

    ... (truncated)

    Commits
    • 3eda583 Bump version to 2.19.1
    • 74d43be Fix support for deployer
    • aa1fe47 Bump version to 2.19.0
    • a92acf1 Remove years from LICENSE
    • 0533892 Fix jsdoc in fetch.ts
    • 43fb4ad Bump ES version to 2021
    • b88a8c8 Fix protoc support
    • 36d7f6c Set target-branch to develop in dependabot.yml
    • a1a52db Merge pull request #598 from shivammathur/dependabot/github_actions/codecov/c...
    • 88e54b1 Merge pull request #599 from shivammathur/dependabot/github_actions/github/co...
    • Additional commits viewable in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependencies stale 
    opened by dependabot[bot] 2
  • chore(deps): Bump shivammathur/setup-php from 2.18.1 to 2.19.0

    chore(deps): Bump shivammathur/setup-php from 2.18.1 to 2.19.0

    Bumps shivammathur/setup-php from 2.18.1 to 2.19.0.

    Release notes

    Sourced from shivammathur/setup-php's releases.

    2.19.0

    Support Ukraine


    • Added support for ubuntu-22.04 runner. Docs

    • Added support for Couchbase extension 4.x for PHP 7.4 and above. Also added support to specify the extension version you need. shivammathur/setup-php#593

      Note: Please use the extensions cache if using the latest Couchbase version on Linux as it can take 10+ minutes to build along with its library.

      To install the latest version of couchbase extension

      - name: Setup PHP
        uses: shivammathur@setup-php@v2
        with:
          php-version: '8.1'
          extensions: couchbase
      

      To install a specific version - suffix couchbase with exact version you want in the extensions input.

      - name: Setup PHP
        uses: shivammathur@setup-php@v2
        with:
          php-version: '7.4'
          extensions: couchbase-2.6.2
      
    • Improved fallback support upon cache failure in composer setup. This fixes an error when the latest composer version was installed on older PHP versions when fetching composer from shivammathur/composer-cache failed.

    • Bumped Node.js version required to 16.x. Also bumped build target version to ES2021.

    • Removed support for Debian 9 and Ubuntu 21.04 for self-hosted runners. Docs

    • Fixed tools setup with older composer versions which do not create composer.json if missing in the directory.

    • Fixed support for extensions on macOS where the extension package name might conflict with package names in homebrew-core repo. This fixes support for redis extension on macOS on PHP 7.0.

    • Fixed enabling cached extensions which depend on other extensions on PHP 7.1 and lower.

    • Fixed setting default INI values so that it is possible to override those using php -c. shivammathur/setup-php#595

    ... (truncated)

    Commits
    • aa1fe47 Bump version to 2.19.0
    • a92acf1 Remove years from LICENSE
    • 0533892 Fix jsdoc in fetch.ts
    • 43fb4ad Bump ES version to 2021
    • b88a8c8 Fix protoc support
    • 36d7f6c Set target-branch to develop in dependabot.yml
    • a1a52db Merge pull request #598 from shivammathur/dependabot/github_actions/codecov/c...
    • 88e54b1 Merge pull request #599 from shivammathur/dependabot/github_actions/github/co...
    • 203099e Merge pull request #600 from shivammathur/dependabot/github_actions/actions/s...
    • 4e9ea33 Bump actions/setup-node from 1 to 3
    • Additional commits viewable in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependencies stale 
    opened by dependabot[bot] 2
  • chore(deps): Bump shivammathur/setup-php from 2.18.1 to 2.22.0

    chore(deps): Bump shivammathur/setup-php from 2.18.1 to 2.22.0

    Bumps shivammathur/setup-php from 2.18.1 to 2.22.0.

    Release notes

    Sourced from shivammathur/setup-php's releases.

    2.22.0

    Support Ukraine


    - name: Setup PHP with debugging symbols
      uses: shivammathur/setup-php@v2
      with:
        php-version: '8.1'
      env:
        debug: true 
    
    - name: Setup PHP with intl
      uses: shivammathur/setup-php@v2
      with:
        php-version: '8.1'
        extensions: intl-72.1
    
    • Existing PHP version on GitHub actions Ubuntu images is now updated if ppa:ondrej/php is missing regardless of the updateactions/runner-images#6331

    • Environment variable COMPOSER_NO_AUDIT is now set by default. If you would like to run the composer audit in your workflows, please add a step with composer audit command. (#635, #636)

    - name: Composer audit
      run: composer audit
    
    • Switched to GITHUB_OUTPUT environment file for setting up outputs. If you are using setup-php on self-hosted runners, please update it to 2.297.0 or greater. More Info (#654)

    • Updated sqlsrv and pdo_sqlsrv version to 5.10.1 for PHP 7.0 and above on Linux.

    • Improved support for phalcon5 extension to set up the latest stable version.

    • Improved symfony-cli support to fetch the artifact URL from the brew tap on Linux. (#641, #652, #653)

    • Improved fetching brew taps on Linux to avoid brew's overhead.

    • Fixed installing extension packages on self-hosted Linux runners. (#642)

    • Fixed support for couchbase and firebird extensions after GitHub release page changes.

    ... (truncated)

    Commits
    • 1a18b22 Add note about updating PHP if ppa is missing on Ubuntu
    • e970483 Update Node.js dependencies
    • 5178fac Update PHP if ppa:ondrej/php is missing ref: actions/runner-images#6331
    • 388883d Fix support for firebird and couchbase
    • cae6d06 Improve phalcon support
    • 89f4f7e Run configure_pecl only when ini_files are set
    • d2efbcd Fix debug support on Linux
    • 98e3af0 Configure brew on linux on grpc_php_plugin setup
    • e8836c6 Fix logs on failure in add_pecl_extension
    • 9068f2e Update sqlsrv and pdo_sqlsrv to 5.10.1
    • Additional commits viewable in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependencies github_actions 
    opened by dependabot[bot] 1
  • chore(deps): Bump shivammathur/setup-php from 2.18.1 to 2.20.0

    chore(deps): Bump shivammathur/setup-php from 2.18.1 to 2.20.0

    Bumps shivammathur/setup-php from 2.18.1 to 2.20.0.

    Release notes

    Sourced from shivammathur/setup-php's releases.

    2.20.0

    Support Ukraine


    • Improved support for event extension on Linux and macOS for PHP 5.4 and above. #604

    • Fixed support for composer plugins in tools input. Since composer 2.2, the plugins are required to be marked as allowed in the composer config. This will now be done by default. #611

    • Added support to show code coverage driver's (Xdebug/PCOV) version in the logs when setup using the coverage input. #610

    • Fixed a bug where PHP was not added to PATH during the action run on self-hosted Windows environments. #609

    • Fixed a bug where the tool cache path was not set on self-hosted environments. #606

    • Updated Node.js dependencies.


    Thanks! @​jrfnl, @​dino182 and @​markseuffert for the contributions 🚀

    2.19.1

    Support Ukraine


    • Fixed support for deployer.

    • Updated Node.js dependencies.


    ... (truncated)

    Commits
    • cdb037c Bump version to 2.20.0
    • 261f13a Add composer plugins to allow list before installing
    • 9eaa66d Add support for event extension on unix
    • da9dfe4 Set RUNNER_TOOL_CACHE on self-hosted environments
    • a863ab6 Add support to allow composer plugins
    • 050cb80 Add coverage driver version in logs
    • 3fda17f Merge pull request #609 from dino182/develop
    • 1a2cb4f Fix Add-Path for self-hosted Windows
    • 4969814 Merge pull request #607 from markseuffert/patch-1
    • 07f2ea7 Updated documentation, review
    • Additional commits viewable in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependencies 
    opened by dependabot[bot] 1
  • Optimize `SimpleCachingIterator`

    Optimize `SimpleCachingIterator`

    This PR:

    • [ ] Fix ...
    • [ ] Provide ...
    • [ ] It breaks backward compatibility
    • [ ] Has unit tests (phpspec)
    • [ ] Has static analysis tests (psalm, phpstan)
    • [ ] Has documentation
    • [ ] Is an experimental thing

    Follows #. Related to #. Fixes #.

    opened by drupol 1
  • Dependency Dashboard

    Dependency Dashboard

    This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

    This repository currently has no open or pending branches.

    Detected dependencies

    composer
    composer.json
    • php >= 8.0
    • drupol/php-conventions ^5
    • infection/infection ^0.26
    • phpbench/phpbench ^1.2
    • phpstan/phpstan-strict-rules ^1.0
    • phpunit/php-code-coverage ^9.2
    • phpunit/phpunit ^9.5
    github-actions
    .github/workflows/benchmarks.yml
    • shivammathur/setup-php v2
    • actions/cache v3
    • actions/checkout v3
    • actions/checkout v3
    .github/workflows/code-style.yml
    • actions/checkout v3
    • shivammathur/setup-php v2
    • ramsey/composer-install v2
    .github/workflows/mutation-tests.yml
    • actions/checkout v3
    • shivammathur/setup-php v2
    • ramsey/composer-install v2
    .github/workflows/prettier.yml
    • actions/checkout v3
    • cachix/install-nix-action v18
    .github/workflows/prune.yaml
    • actions/stale v7
    .github/workflows/release.yaml
    • actions/checkout v3
    • mindsers/changelog-reader-action v2
    • actions/create-release v1.1.4
    .github/workflows/static-analysis.yml
    • actions/checkout v3
    • shivammathur/setup-php v2
    • ramsey/composer-install v2
    .github/workflows/tests.yml
    • actions/checkout v3
    • WyriHaximus/github-action-composer-php-versions-in-range v1
    • actions/checkout v3
    • shivammathur/setup-php v2
    • ramsey/composer-install v2

    • [ ] Check this box to trigger a request for Renovate to run again on this repository
    opened by renovate[bot] 4
Releases(2.3.2)
Owner
(infinite) loophp
(infinite) loophp
PHP Integrated Query, a real LINQ library for PHP

PHP Integrated Query - Official site What is PINQ? Based off the .NET's LINQ (Language integrated query), PINQ unifies querying across arrays/iterator

Elliot Levin 465 Dec 30, 2022
True asynchronous PHP I/O and HTTP without frameworks, extensions, or annoying code. Uses the accepted Fibers RFC to be implemented into PHP 8.1

PHP Fibers - Async Examples Without External Dependencies True asynchronous PHP I/O and HTTP without frameworks, extensions, or annoying code behemoth

Cole Green 121 Jan 6, 2023
Map nested JSON structures onto PHP classes

JsonMapper - map nested JSON structures onto PHP classes Takes data retrieved from a JSON web service and converts them into nested object and arrays

Christian Weiske 1.4k Dec 30, 2022
A Collections library for PHP.

A Library of Collections for OO Programming While developing and helping others develop PHP applications I noticed the trend to use PHP's arrays in ne

Levi Morrison 629 Nov 20, 2022
Yet Another LINQ to Objects for PHP [Simplified BSD]

YaLinqo: Yet Another LINQ to Objects for PHP Online documentation GitHub repository Features The most complete port of .NET LINQ to PHP, with many add

Alexander Prokhorov 436 Jan 3, 2023
🗃 Array manipulation library for PHP, called Arrayy!

?? Arrayy A PHP array manipulation library. Compatible with PHP 7+ & PHP 8+ \Arrayy\Type\StringCollection::create(['Array', 'Array'])->unique()->appen

Lars Moelleken 430 Jan 5, 2023
`LINQ to Object` inspired DSL for PHP

Ginq Array handling in PHP? Be happy with Ginq! Ginq is a DSL that can handle arrays and iterators of PHP unified. Ginq is inspired by Linq to Object,

Atsushi Kanehara 191 Dec 19, 2022
Collections Abstraction library for PHP

Collections Collections Abstraction library for PHP The Collection library is one of the most useful things that many modern languages has, but for so

Ítalo Vietro 62 Dec 27, 2021
A repository with implementations of different data structures and algorithms using PHP

PHP Data Structures and Algorithms Data structure and Algorithm is always important for any programming language. PHP, being one of the most popular l

Mizanur Rahman 610 Jan 2, 2023
Leetcode for PHP, five questions a week and weekends are updated irregularly

✏️ Leetcode for PHP why do you have to sleep for a long time ,and naturally sleep after death 联系 说明 由于目前工作主要是 golang,我又新起了一个LeetCode-Go-Week项目,- Leetc

吴亲库里 370 Dec 29, 2022
JsonMapper - map nested JSON structures onto PHP classes

Takes data retrieved from a JSON web service and converts them into nested object and arrays - using your own model classes.

Netresearch 9 Aug 21, 2022
All Algorithms implemented in Php

The Algorithms - PHP All algorithms implemented in Php (for education) These implementations are for learning purposes. They may be less efficient tha

The Algorithms 1k Dec 27, 2022
A community driven collection of sorting algorithms in PHP

algorithms A community driven collection of sorting algorithms This repository includes a comma separated file that includes 10k numbers between 1 and

Andrew S Erwin 0 May 16, 2022
A package that provides `array_*` like functions for iterators.

The doekenorg/iterator-functions package provides a curated set of array_* like functions for iterators in PHP. This package is built to encourage developers to make more use of Iterators by simplifying common tasks.

Doeke Norg 67 Jun 24, 2022
Asynchronous iterators and operators.

pipeline Asynchronous iterators and operators. Installation This package can be installed as a Composer dependency. composer require amphp/pipeline Ve

Amp 16 Nov 18, 2022
The missing PHP 5.3+ calendar management library.

CalendR CalendR is an Object Oriented Calendar management library on top of PHP5.3+ Date objects. You can use it to deal with all your needs about cal

Yohan Giarelli 462 Dec 30, 2022
Missing data types for PHP. Highly extendable.

Neverending data validation can be exhausting. Either you have to validate your data over and over again in every function you use it, or you have to rely it has already been validated somewhere else and risk potential problems.

SmartEmailing 82 Nov 11, 2022
🍺 The missing package manager for macOS (or Linux)

Homebrew Features, usage and installation instructions are summarised on the homepage. Terminology (e.g. the difference between a Cellar, Tap, Cask an

Homebrew 34.4k Jan 1, 2023
Voyager - The Missing Laravel Admin

Voyager - The Missing Laravel Admin Made with ❤️ by The Control Group Website & Documentation: https://voyager.devdojo.com/ Video Tutorial Here: https

The Control Group 11.3k Dec 31, 2022
Voyager - The Missing Laravel Admin

Voyager - The Missing Laravel Admin Made with ❤️ by The Control Group Website & Documentation: https://voyager.devdojo.com/ Video Tutorial Here: https

The Control Group 11.3k Jan 2, 2023