diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e06ad74..1ccb5af 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -29,6 +29,9 @@ jobs: - name: Validate composer.json and composer.lock run: composer validate --strict + - name: Unset local path repositories + run: composer config --unset repositories + - name: Cache Composer packages id: composer-cache uses: actions/cache@v4 @@ -39,15 +42,19 @@ jobs: ${{ runner.os }}-php-${{ matrix.php }}- - name: Install dependencies - run: composer install --prefer-dist --no-progress + run: composer update --prefer-dist --no-progress - name: Run test suite run: composer test lint: - name: Code Style (PHP-CS-Fixer) + name: PHP ${{ matrix.php }} Code Style (PHP-CS-Fixer) runs-on: ubuntu-latest - + strategy: + fail-fast: false + matrix: + php: ['8.2', '8.3', '8.4'] + steps: - name: Checkout code uses: actions/checkout@v4 @@ -55,26 +62,33 @@ jobs: - name: Setup PHP uses: shivammathur/setup-php@v2 with: - php-version: 8.3 + php-version: ${{ matrix.php }} extensions: mbstring, json coverage: none tools: php-cs-fixer - name: Run PHP-CS-Fixer - run: php-cs-fixer fix --dry-run --diff --verbose + run: php-cs-fixer fix --dry-run --diff --verbose --allow-risky=yes static-analysis: - name: Static Analysis (PHPStan) + name: PHP ${{ matrix.php }} Static Analysis (PHPStan) runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + php: ['8.2', '8.3', '8.4'] steps: - name: Checkout code uses: actions/checkout@v4 + - name: Unset local path repositories + run: composer config --unset repositories + - name: Setup PHP uses: shivammathur/setup-php@v2 with: - php-version: 8.3 + php-version: ${{ matrix.php }} extensions: mbstring, json, pcntl, posix, zlib, sockets coverage: none @@ -83,12 +97,12 @@ jobs: uses: actions/cache@v4 with: path: vendor - key: ${{ runner.os }}-php-8.3-${{ hashFiles('**/composer.lock') }} + key: ${{ runner.os }}-php-${{ matrix.php }}-${{ hashFiles('**/composer.lock') }} restore-keys: | - ${{ runner.os }}-php-8.3- + ${{ runner.os }}-php-${{ matrix.php }}- - name: Install dependencies - run: composer install --prefer-dist --no-progress + run: composer update --prefer-dist --no-progress - name: Run PHPStan run: composer phpstan diff --git a/README.md b/README.md index e7101d5..2dfae28 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,6 @@ # Phunkie Streams # +[![CI](https://github.com/phunkie/streams/actions/workflows/ci.yml/badge.svg)](https://github.com/phunkie/streams/actions) [![Latest Stable Version](https://poser.pugx.org/phunkie/streams/v/stable)](https://packagist.org/packages/phunkie/streams) [![Total Downloads](https://poser.pugx.org/phunkie/streams/downloads)](https://packagist.org/packages/phunkie/streams) [![License](https://poser.pugx.org/phunkie/streams/license)](https://packagist.org/packages/phunkie/streams) diff --git a/composer.json b/composer.json index 94efa6d..0ec0010 100644 --- a/composer.json +++ b/composer.json @@ -3,10 +3,22 @@ "description": "Functional Streams for PHP", "type": "library", "license": "MIT", + "authors": [ + { + "name": "Marcello Duarte", + "email": "marcello.duarte@gmail.com" + } + ], "require": { - "php": ">=8.2", - "phunkie/phunkie": "^0.11.3", - "phunkie/effect": "^0.4.1" + "php": "^8.2 || ^8.3 || ^8.4", + "phunkie/phunkie": "^1.0", + "phunkie/effect": "^1.0" + }, + "require-dev": { + "pestphp/pest": "^2.35", + "phpstan/phpstan": "^2.0", + "friendsofphp/php-cs-fixer": "^3.90", + "phunkie/phpstan": "^1.0" }, "autoload": { "psr-4": { @@ -17,12 +29,6 @@ "src/Functions/common.php" ] }, - "authors": [ - { - "name": "Marcello Duarte", - "email": "marcello.duarte@gmail.com" - } - ], "suggest": { "ext-parallel": "Required for parallel processing capabilities", "ext-mbstring": "Required for encoding and decoding text in various encodings", @@ -32,16 +38,20 @@ "ext-zlib": "Required for stream compression and decompression", "ext-sockets": "Required for socket communication in networking applications" }, - "require-dev": { - "pestphp/pest": "^2.35", - "phpstan/phpstan": "^1.10", - "friendsofphp/php-cs-fixer": "^3.0" - }, "scripts": { "test": "pest", - "phpstan": "phpstan analyse", - "cs-fix": "php-cs-fixer fix", - "cs-check": "php-cs-fixer fix --dry-run --diff" + "phpstan": "phpstan analyse --memory-limit=512M", + "cs-fix": "php-cs-fixer fix --allow-risky=yes", + "cs-check": "php-cs-fixer fix --dry-run --diff --allow-risky=yes", + "lint": [ + "@cs-check", + "@phpstan" + ], + "test-all": "scripts/test-all-versions.sh", + "check": [ + "@lint", + "@test" + ] }, "config": { "bin-dir": "bin", diff --git a/composer.lock b/composer.lock index 3a76962..19d7cf5 100644 --- a/composer.lock +++ b/composer.lock @@ -4,31 +4,31 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "e89ff0b48d382f3f61139f773e1871d6", + "content-hash": "b5d55d05f73a184a5d5338f7f7149610", "packages": [ { "name": "phunkie/effect", - "version": "v0.4.1", + "version": "1.0.0", "source": { "type": "git", "url": "https://github.com/phunkie/effect.git", - "reference": "cfadc91c2b67931d078a12c49abf9a04f60d9568" + "reference": "fd90513682eb3a5a76a4e9f43ec89d1a9785458e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phunkie/effect/zipball/cfadc91c2b67931d078a12c49abf9a04f60d9568", - "reference": "cfadc91c2b67931d078a12c49abf9a04f60d9568", + "url": "https://api.github.com/repos/phunkie/effect/zipball/fd90513682eb3a5a76a4e9f43ec89d1a9785458e", + "reference": "fd90513682eb3a5a76a4e9f43ec89d1a9785458e", "shasum": "" }, "require": { - "php": ">=8.2", - "phunkie/phunkie": "^0.11" + "php": "^8.2 || ^8.3 || ^8.4", + "phunkie/phunkie": "^1.0" }, "require-dev": { - "friendsofphp/php-cs-fixer": "^3.75", + "friendsofphp/php-cs-fixer": "^3.90", "phpstan/phpstan": "^2.1", "phpunit/phpunit": "^10.5", - "phunkie/phunkie-console": "dev-master" + "phunkie/phpstan": "^1.0" }, "suggest": { "ext-parallel": "Required for parallel execution using threads. PHP must be compiled with ZTS support." @@ -55,32 +55,34 @@ "description": "A functional effects library for PHP inspired by Scala's cats-effect", "support": { "issues": "https://github.com/phunkie/effect/issues", - "source": "https://github.com/phunkie/effect/tree/v0.4.1" + "source": "https://github.com/phunkie/effect/tree/1.0.0" }, - "time": "2025-10-14T20:51:52+00:00" + "time": "2025-12-08T19:02:35+00:00" }, { "name": "phunkie/phunkie", - "version": "0.11.7", + "version": "1.0.0", "source": { "type": "git", "url": "https://github.com/phunkie/phunkie.git", - "reference": "1d7620e41062c86e3f1d3dbf22f7035b4675667e" + "reference": "edfe0c5e3b382d8827bdaef5c0ef027840eceaf5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phunkie/phunkie/zipball/1d7620e41062c86e3f1d3dbf22f7035b4675667e", - "reference": "1d7620e41062c86e3f1d3dbf22f7035b4675667e", + "url": "https://api.github.com/repos/phunkie/phunkie/zipball/edfe0c5e3b382d8827bdaef5c0ef027840eceaf5", + "reference": "edfe0c5e3b382d8827bdaef5c0ef027840eceaf5", "shasum": "" }, "require": { - "php": ">=8.1" + "php": "^8.2 || ^8.3 || ^8.4" }, "require-dev": { "ergebnis/composer-normalize": "^2", - "friendsofphp/php-cs-fixer": "^3", + "friendsofphp/php-cs-fixer": "^3.90", "giorgiosironi/eris": "^0", - "phpunit/phpunit": "^9" + "phpstan/phpstan": "^2.0", + "phpunit/phpunit": "^9", + "phunkie/phpstan": "@dev" }, "type": "library", "autoload": { @@ -106,9 +108,9 @@ "description": "Functional structures library for PHP", "support": { "issues": "https://github.com/phunkie/phunkie/issues", - "source": "https://github.com/phunkie/phunkie/tree/0.11.7" + "source": "https://github.com/phunkie/phunkie/tree/1.0.0" }, - "time": "2025-02-22T21:55:21+00:00" + "time": "2025-12-08T18:48:37+00:00" } ], "packages-dev": [ @@ -720,16 +722,16 @@ }, { "name": "friendsofphp/php-cs-fixer", - "version": "v3.88.2", + "version": "v3.91.3", "source": { "type": "git", "url": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer.git", - "reference": "a8d15584bafb0f0d9d938827840060fd4a3ebc99" + "reference": "9f10aa6390cea91da175ea608880e942d7c0226e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHP-CS-Fixer/PHP-CS-Fixer/zipball/a8d15584bafb0f0d9d938827840060fd4a3ebc99", - "reference": "a8d15584bafb0f0d9d938827840060fd4a3ebc99", + "url": "https://api.github.com/repos/PHP-CS-Fixer/PHP-CS-Fixer/zipball/9f10aa6390cea91da175ea608880e942d7c0226e", + "reference": "9f10aa6390cea91da175ea608880e942d7c0226e", "shasum": "" }, "require": { @@ -744,21 +746,20 @@ "php": "^7.4 || ^8.0", "react/child-process": "^0.6.6", "react/event-loop": "^1.5", - "react/promise": "^3.3", "react/socket": "^1.16", "react/stream": "^1.4", "sebastian/diff": "^4.0.6 || ^5.1.1 || ^6.0.2 || ^7.0", - "symfony/console": "^5.4.47 || ^6.4.24 || ^7.0", - "symfony/event-dispatcher": "^5.4.45 || ^6.4.24 || ^7.0", - "symfony/filesystem": "^5.4.45 || ^6.4.24 || ^7.0", - "symfony/finder": "^5.4.45 || ^6.4.24 || ^7.0", - "symfony/options-resolver": "^5.4.45 || ^6.4.24 || ^7.0", + "symfony/console": "^5.4.47 || ^6.4.24 || ^7.0 || ^8.0", + "symfony/event-dispatcher": "^5.4.45 || ^6.4.24 || ^7.0 || ^8.0", + "symfony/filesystem": "^5.4.45 || ^6.4.24 || ^7.0 || ^8.0", + "symfony/finder": "^5.4.45 || ^6.4.24 || ^7.0 || ^8.0", + "symfony/options-resolver": "^5.4.45 || ^6.4.24 || ^7.0 || ^8.0", "symfony/polyfill-mbstring": "^1.33", "symfony/polyfill-php80": "^1.33", "symfony/polyfill-php81": "^1.33", "symfony/polyfill-php84": "^1.33", - "symfony/process": "^5.4.47 || ^6.4.24 || ^7.2", - "symfony/stopwatch": "^5.4.45 || ^6.4.24 || ^7.0" + "symfony/process": "^5.4.47 || ^6.4.24 || ^7.2 || ^8.0", + "symfony/stopwatch": "^5.4.45 || ^6.4.24 || ^7.0 || ^8.0" }, "require-dev": { "facile-it/paraunit": "^1.3.1 || ^2.7", @@ -766,12 +767,12 @@ "justinrainbow/json-schema": "^6.5", "keradus/cli-executor": "^2.2", "mikey179/vfsstream": "^1.6.12", - "php-coveralls/php-coveralls": "^2.8", + "php-coveralls/php-coveralls": "^2.9", "php-cs-fixer/phpunit-constraint-isidenticalstring": "^1.6", "php-cs-fixer/phpunit-constraint-xmlmatchesxsd": "^1.6", "phpunit/phpunit": "^9.6.25 || ^10.5.53 || ^11.5.34", - "symfony/var-dumper": "^5.4.48 || ^6.4.24 || ^7.3.2", - "symfony/yaml": "^5.4.45 || ^6.4.24 || ^7.3.2" + "symfony/var-dumper": "^5.4.48 || ^6.4.24 || ^7.3.2 || ^8.0", + "symfony/yaml": "^5.4.45 || ^6.4.24 || ^7.3.2 || ^8.0" }, "suggest": { "ext-dom": "For handling output formats in XML", @@ -786,7 +787,7 @@ "PhpCsFixer\\": "src/" }, "exclude-from-classmap": [ - "src/Fixer/Internal/*" + "src/**/Internal/" ] }, "notification-url": "https://packagist.org/downloads/", @@ -812,7 +813,7 @@ ], "support": { "issues": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues", - "source": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/tree/v3.88.2" + "source": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/tree/v3.91.3" }, "funding": [ { @@ -820,7 +821,7 @@ "type": "github" } ], - "time": "2025-09-27T00:24:15+00:00" + "time": "2025-12-05T19:45:37+00:00" }, { "name": "jean85/pretty-package-versions", @@ -944,16 +945,16 @@ }, { "name": "nikic/php-parser", - "version": "v5.6.1", + "version": "v5.7.0", "source": { "type": "git", "url": "https://github.com/nikic/PHP-Parser.git", - "reference": "f103601b29efebd7ff4a1ca7b3eeea9e3336a2a2" + "reference": "dca41cd15c2ac9d055ad70dbfd011130757d1f82" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/f103601b29efebd7ff4a1ca7b3eeea9e3336a2a2", - "reference": "f103601b29efebd7ff4a1ca7b3eeea9e3336a2a2", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/dca41cd15c2ac9d055ad70dbfd011130757d1f82", + "reference": "dca41cd15c2ac9d055ad70dbfd011130757d1f82", "shasum": "" }, "require": { @@ -996,9 +997,9 @@ ], "support": { "issues": "https://github.com/nikic/PHP-Parser/issues", - "source": "https://github.com/nikic/PHP-Parser/tree/v5.6.1" + "source": "https://github.com/nikic/PHP-Parser/tree/v5.7.0" }, - "time": "2025-08-13T20:13:15+00:00" + "time": "2025-12-06T11:56:16+00:00" }, { "name": "nunomaduro/collision", @@ -1099,31 +1100,31 @@ }, { "name": "nunomaduro/termwind", - "version": "v2.3.1", + "version": "v2.3.3", "source": { "type": "git", "url": "https://github.com/nunomaduro/termwind.git", - "reference": "dfa08f390e509967a15c22493dc0bac5733d9123" + "reference": "6fb2a640ff502caace8e05fd7be3b503a7e1c017" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nunomaduro/termwind/zipball/dfa08f390e509967a15c22493dc0bac5733d9123", - "reference": "dfa08f390e509967a15c22493dc0bac5733d9123", + "url": "https://api.github.com/repos/nunomaduro/termwind/zipball/6fb2a640ff502caace8e05fd7be3b503a7e1c017", + "reference": "6fb2a640ff502caace8e05fd7be3b503a7e1c017", "shasum": "" }, "require": { "ext-mbstring": "*", "php": "^8.2", - "symfony/console": "^7.2.6" + "symfony/console": "^7.3.6" }, "require-dev": { - "illuminate/console": "^11.44.7", - "laravel/pint": "^1.22.0", + "illuminate/console": "^11.46.1", + "laravel/pint": "^1.25.1", "mockery/mockery": "^1.6.12", - "pestphp/pest": "^2.36.0 || ^3.8.2", - "phpstan/phpstan": "^1.12.25", + "pestphp/pest": "^2.36.0 || ^3.8.4 || ^4.1.3", + "phpstan/phpstan": "^1.12.32", "phpstan/phpstan-strict-rules": "^1.6.2", - "symfony/var-dumper": "^7.2.6", + "symfony/var-dumper": "^7.3.5", "thecodingmachine/phpstan-strict-rules": "^1.0.0" }, "type": "library", @@ -1166,7 +1167,7 @@ ], "support": { "issues": "https://github.com/nunomaduro/termwind/issues", - "source": "https://github.com/nunomaduro/termwind/tree/v2.3.1" + "source": "https://github.com/nunomaduro/termwind/tree/v2.3.3" }, "funding": [ { @@ -1182,7 +1183,7 @@ "type": "github" } ], - "time": "2025-05-08T08:14:37+00:00" + "time": "2025-11-20T02:34:59+00:00" }, { "name": "pestphp/pest", @@ -1607,16 +1608,16 @@ }, { "name": "phpdocumentor/reflection-docblock", - "version": "5.6.3", + "version": "5.6.5", "source": { "type": "git", "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", - "reference": "94f8051919d1b0369a6bcc7931d679a511c03fe9" + "reference": "90614c73d3800e187615e2dd236ad0e2a01bf761" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/94f8051919d1b0369a6bcc7931d679a511c03fe9", - "reference": "94f8051919d1b0369a6bcc7931d679a511c03fe9", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/90614c73d3800e187615e2dd236ad0e2a01bf761", + "reference": "90614c73d3800e187615e2dd236ad0e2a01bf761", "shasum": "" }, "require": { @@ -1665,22 +1666,22 @@ "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.", "support": { "issues": "https://github.com/phpDocumentor/ReflectionDocBlock/issues", - "source": "https://github.com/phpDocumentor/ReflectionDocBlock/tree/5.6.3" + "source": "https://github.com/phpDocumentor/ReflectionDocBlock/tree/5.6.5" }, - "time": "2025-08-01T19:43:32+00:00" + "time": "2025-11-27T19:50:05+00:00" }, { "name": "phpdocumentor/type-resolver", - "version": "1.10.0", + "version": "1.12.0", "source": { "type": "git", "url": "https://github.com/phpDocumentor/TypeResolver.git", - "reference": "679e3ce485b99e84c775d28e2e96fade9a7fb50a" + "reference": "92a98ada2b93d9b201a613cb5a33584dde25f195" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/679e3ce485b99e84c775d28e2e96fade9a7fb50a", - "reference": "679e3ce485b99e84c775d28e2e96fade9a7fb50a", + "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/92a98ada2b93d9b201a613cb5a33584dde25f195", + "reference": "92a98ada2b93d9b201a613cb5a33584dde25f195", "shasum": "" }, "require": { @@ -1723,9 +1724,9 @@ "description": "A PSR-5 based resolver of Class names, Types and Structural Element Names", "support": { "issues": "https://github.com/phpDocumentor/TypeResolver/issues", - "source": "https://github.com/phpDocumentor/TypeResolver/tree/1.10.0" + "source": "https://github.com/phpDocumentor/TypeResolver/tree/1.12.0" }, - "time": "2024-11-09T15:12:26+00:00" + "time": "2025-11-21T15:09:14+00:00" }, { "name": "phpstan/phpdoc-parser", @@ -1776,15 +1777,15 @@ }, { "name": "phpstan/phpstan", - "version": "1.12.32", + "version": "2.1.33", "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan/zipball/2770dcdf5078d0b0d53f94317e06affe88419aa8", - "reference": "2770dcdf5078d0b0d53f94317e06affe88419aa8", + "url": "https://api.github.com/repos/phpstan/phpstan/zipball/9e800e6bee7d5bd02784d4c6069b48032d16224f", + "reference": "9e800e6bee7d5bd02784d4c6069b48032d16224f", "shasum": "" }, "require": { - "php": "^7.2|^8.0" + "php": "^7.4|^8.0" }, "conflict": { "phpstan/phpstan-shim": "*" @@ -1825,7 +1826,7 @@ "type": "github" } ], - "time": "2025-09-30T10:16:31+00:00" + "time": "2025-12-05T10:24:31+00:00" }, { "name": "phpunit/php-code-coverage", @@ -2249,6 +2250,59 @@ ], "time": "2024-10-08T15:36:51+00:00" }, + { + "name": "phunkie/phpstan", + "version": "1.0.0", + "source": { + "type": "git", + "url": "https://github.com/phunkie/phpstan.git", + "reference": "91dd9931edc1fb81d5a5d5eb61179a87e77f8bc6" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phunkie/phpstan/zipball/91dd9931edc1fb81d5a5d5eb61179a87e77f8bc6", + "reference": "91dd9931edc1fb81d5a5d5eb61179a87e77f8bc6", + "shasum": "" + }, + "require": { + "php": "^8.2 || ^8.3 || ^8.4", + "phpstan/phpstan": "^2.0" + }, + "require-dev": { + "phpunit/phpunit": "^11", + "phunkie/effect": "dev-developing-1.0.0 as 1.0.0", + "phunkie/phunkie": "dev-developing-1.0.0 as 1.0.0" + }, + "type": "phpstan-extension", + "extra": { + "phpstan": { + "includes": [ + "extension.neon" + ] + } + }, + "autoload": { + "psr-4": { + "Phunkie\\PHPStan\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Marcello Duarte", + "email": "marcello.duarte@gmail.com" + } + ], + "description": "PHPStan extensions for Phunkie functional programming library", + "support": { + "issues": "https://github.com/phunkie/phpstan/issues", + "source": "https://github.com/phunkie/phpstan/tree/1.0.0" + }, + "time": "2025-12-08T18:01:33+00:00" + }, { "name": "psr/container", "version": "2.0.2", @@ -2551,16 +2605,16 @@ }, { "name": "react/dns", - "version": "v1.13.0", + "version": "v1.14.0", "source": { "type": "git", "url": "https://github.com/reactphp/dns.git", - "reference": "eb8ae001b5a455665c89c1df97f6fb682f8fb0f5" + "reference": "7562c05391f42701c1fccf189c8225fece1cd7c3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/reactphp/dns/zipball/eb8ae001b5a455665c89c1df97f6fb682f8fb0f5", - "reference": "eb8ae001b5a455665c89c1df97f6fb682f8fb0f5", + "url": "https://api.github.com/repos/reactphp/dns/zipball/7562c05391f42701c1fccf189c8225fece1cd7c3", + "reference": "7562c05391f42701c1fccf189c8225fece1cd7c3", "shasum": "" }, "require": { @@ -2615,7 +2669,7 @@ ], "support": { "issues": "https://github.com/reactphp/dns/issues", - "source": "https://github.com/reactphp/dns/tree/v1.13.0" + "source": "https://github.com/reactphp/dns/tree/v1.14.0" }, "funding": [ { @@ -2623,20 +2677,20 @@ "type": "open_collective" } ], - "time": "2024-06-13T14:18:03+00:00" + "time": "2025-11-18T19:34:28+00:00" }, { "name": "react/event-loop", - "version": "v1.5.0", + "version": "v1.6.0", "source": { "type": "git", "url": "https://github.com/reactphp/event-loop.git", - "reference": "bbe0bd8c51ffc05ee43f1729087ed3bdf7d53354" + "reference": "ba276bda6083df7e0050fd9b33f66ad7a4ac747a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/reactphp/event-loop/zipball/bbe0bd8c51ffc05ee43f1729087ed3bdf7d53354", - "reference": "bbe0bd8c51ffc05ee43f1729087ed3bdf7d53354", + "url": "https://api.github.com/repos/reactphp/event-loop/zipball/ba276bda6083df7e0050fd9b33f66ad7a4ac747a", + "reference": "ba276bda6083df7e0050fd9b33f66ad7a4ac747a", "shasum": "" }, "require": { @@ -2687,7 +2741,7 @@ ], "support": { "issues": "https://github.com/reactphp/event-loop/issues", - "source": "https://github.com/reactphp/event-loop/tree/v1.5.0" + "source": "https://github.com/reactphp/event-loop/tree/v1.6.0" }, "funding": [ { @@ -2695,7 +2749,7 @@ "type": "open_collective" } ], - "time": "2023-11-13T13:48:05+00:00" + "time": "2025-11-17T20:46:25+00:00" }, { "name": "react/promise", @@ -2772,16 +2826,16 @@ }, { "name": "react/socket", - "version": "v1.16.0", + "version": "v1.17.0", "source": { "type": "git", "url": "https://github.com/reactphp/socket.git", - "reference": "23e4ff33ea3e160d2d1f59a0e6050e4b0fb0eac1" + "reference": "ef5b17b81f6f60504c539313f94f2d826c5faa08" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/reactphp/socket/zipball/23e4ff33ea3e160d2d1f59a0e6050e4b0fb0eac1", - "reference": "23e4ff33ea3e160d2d1f59a0e6050e4b0fb0eac1", + "url": "https://api.github.com/repos/reactphp/socket/zipball/ef5b17b81f6f60504c539313f94f2d826c5faa08", + "reference": "ef5b17b81f6f60504c539313f94f2d826c5faa08", "shasum": "" }, "require": { @@ -2840,7 +2894,7 @@ ], "support": { "issues": "https://github.com/reactphp/socket/issues", - "source": "https://github.com/reactphp/socket/tree/v1.16.0" + "source": "https://github.com/reactphp/socket/tree/v1.17.0" }, "funding": [ { @@ -2848,7 +2902,7 @@ "type": "open_collective" } ], - "time": "2024-07-26T10:38:09+00:00" + "time": "2025-11-19T20:47:34+00:00" }, { "name": "react/stream", @@ -3883,16 +3937,16 @@ }, { "name": "symfony/console", - "version": "v7.3.4", + "version": "v7.4.1", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "2b9c5fafbac0399a20a2e82429e2bd735dcfb7db" + "reference": "6d9f0fbf2ec2e9785880096e3abd0ca0c88b506e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/2b9c5fafbac0399a20a2e82429e2bd735dcfb7db", - "reference": "2b9c5fafbac0399a20a2e82429e2bd735dcfb7db", + "url": "https://api.github.com/repos/symfony/console/zipball/6d9f0fbf2ec2e9785880096e3abd0ca0c88b506e", + "reference": "6d9f0fbf2ec2e9785880096e3abd0ca0c88b506e", "shasum": "" }, "require": { @@ -3900,7 +3954,7 @@ "symfony/deprecation-contracts": "^2.5|^3", "symfony/polyfill-mbstring": "~1.0", "symfony/service-contracts": "^2.5|^3", - "symfony/string": "^7.2" + "symfony/string": "^7.2|^8.0" }, "conflict": { "symfony/dependency-injection": "<6.4", @@ -3914,16 +3968,16 @@ }, "require-dev": { "psr/log": "^1|^2|^3", - "symfony/config": "^6.4|^7.0", - "symfony/dependency-injection": "^6.4|^7.0", - "symfony/event-dispatcher": "^6.4|^7.0", - "symfony/http-foundation": "^6.4|^7.0", - "symfony/http-kernel": "^6.4|^7.0", - "symfony/lock": "^6.4|^7.0", - "symfony/messenger": "^6.4|^7.0", - "symfony/process": "^6.4|^7.0", - "symfony/stopwatch": "^6.4|^7.0", - "symfony/var-dumper": "^6.4|^7.0" + "symfony/config": "^6.4|^7.0|^8.0", + "symfony/dependency-injection": "^6.4|^7.0|^8.0", + "symfony/event-dispatcher": "^6.4|^7.0|^8.0", + "symfony/http-foundation": "^6.4|^7.0|^8.0", + "symfony/http-kernel": "^6.4|^7.0|^8.0", + "symfony/lock": "^6.4|^7.0|^8.0", + "symfony/messenger": "^6.4|^7.0|^8.0", + "symfony/process": "^6.4|^7.0|^8.0", + "symfony/stopwatch": "^6.4|^7.0|^8.0", + "symfony/var-dumper": "^6.4|^7.0|^8.0" }, "type": "library", "autoload": { @@ -3957,7 +4011,7 @@ "terminal" ], "support": { - "source": "https://github.com/symfony/console/tree/v7.3.4" + "source": "https://github.com/symfony/console/tree/v7.4.1" }, "funding": [ { @@ -3977,7 +4031,7 @@ "type": "tidelift" } ], - "time": "2025-09-22T15:31:00+00:00" + "time": "2025-12-05T15:23:39+00:00" }, { "name": "symfony/deprecation-contracts", @@ -4048,24 +4102,24 @@ }, { "name": "symfony/event-dispatcher", - "version": "v7.3.3", + "version": "v8.0.0", "source": { "type": "git", "url": "https://github.com/symfony/event-dispatcher.git", - "reference": "b7dc69e71de420ac04bc9ab830cf3ffebba48191" + "reference": "573f95783a2ec6e38752979db139f09fec033f03" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/b7dc69e71de420ac04bc9ab830cf3ffebba48191", - "reference": "b7dc69e71de420ac04bc9ab830cf3ffebba48191", + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/573f95783a2ec6e38752979db139f09fec033f03", + "reference": "573f95783a2ec6e38752979db139f09fec033f03", "shasum": "" }, "require": { - "php": ">=8.2", + "php": ">=8.4", "symfony/event-dispatcher-contracts": "^2.5|^3" }, "conflict": { - "symfony/dependency-injection": "<6.4", + "symfony/security-http": "<7.4", "symfony/service-contracts": "<2.5" }, "provide": { @@ -4074,13 +4128,14 @@ }, "require-dev": { "psr/log": "^1|^2|^3", - "symfony/config": "^6.4|^7.0", - "symfony/dependency-injection": "^6.4|^7.0", - "symfony/error-handler": "^6.4|^7.0", - "symfony/expression-language": "^6.4|^7.0", - "symfony/http-foundation": "^6.4|^7.0", + "symfony/config": "^7.4|^8.0", + "symfony/dependency-injection": "^7.4|^8.0", + "symfony/error-handler": "^7.4|^8.0", + "symfony/expression-language": "^7.4|^8.0", + "symfony/framework-bundle": "^7.4|^8.0", + "symfony/http-foundation": "^7.4|^8.0", "symfony/service-contracts": "^2.5|^3", - "symfony/stopwatch": "^6.4|^7.0" + "symfony/stopwatch": "^7.4|^8.0" }, "type": "library", "autoload": { @@ -4108,7 +4163,7 @@ "description": "Provides tools that allow your application components to communicate with each other by dispatching events and listening to them", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/event-dispatcher/tree/v7.3.3" + "source": "https://github.com/symfony/event-dispatcher/tree/v8.0.0" }, "funding": [ { @@ -4128,7 +4183,7 @@ "type": "tidelift" } ], - "time": "2025-08-13T11:49:31+00:00" + "time": "2025-10-30T14:17:19+00:00" }, { "name": "symfony/event-dispatcher-contracts", @@ -4208,25 +4263,25 @@ }, { "name": "symfony/filesystem", - "version": "v7.3.2", + "version": "v8.0.1", "source": { "type": "git", "url": "https://github.com/symfony/filesystem.git", - "reference": "edcbb768a186b5c3f25d0643159a787d3e63b7fd" + "reference": "d937d400b980523dc9ee946bb69972b5e619058d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/filesystem/zipball/edcbb768a186b5c3f25d0643159a787d3e63b7fd", - "reference": "edcbb768a186b5c3f25d0643159a787d3e63b7fd", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/d937d400b980523dc9ee946bb69972b5e619058d", + "reference": "d937d400b980523dc9ee946bb69972b5e619058d", "shasum": "" }, "require": { - "php": ">=8.2", + "php": ">=8.4", "symfony/polyfill-ctype": "~1.8", "symfony/polyfill-mbstring": "~1.8" }, "require-dev": { - "symfony/process": "^6.4|^7.0" + "symfony/process": "^7.4|^8.0" }, "type": "library", "autoload": { @@ -4254,7 +4309,7 @@ "description": "Provides basic utilities for the filesystem", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/filesystem/tree/v7.3.2" + "source": "https://github.com/symfony/filesystem/tree/v8.0.1" }, "funding": [ { @@ -4274,27 +4329,27 @@ "type": "tidelift" } ], - "time": "2025-07-07T08:17:47+00:00" + "time": "2025-12-01T09:13:36+00:00" }, { "name": "symfony/finder", - "version": "v7.3.2", + "version": "v7.4.0", "source": { "type": "git", "url": "https://github.com/symfony/finder.git", - "reference": "2a6614966ba1074fa93dae0bc804227422df4dfe" + "reference": "340b9ed7320570f319028a2cbec46d40535e94bd" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/2a6614966ba1074fa93dae0bc804227422df4dfe", - "reference": "2a6614966ba1074fa93dae0bc804227422df4dfe", + "url": "https://api.github.com/repos/symfony/finder/zipball/340b9ed7320570f319028a2cbec46d40535e94bd", + "reference": "340b9ed7320570f319028a2cbec46d40535e94bd", "shasum": "" }, "require": { "php": ">=8.2" }, "require-dev": { - "symfony/filesystem": "^6.4|^7.0" + "symfony/filesystem": "^6.4|^7.0|^8.0" }, "type": "library", "autoload": { @@ -4322,7 +4377,7 @@ "description": "Finds files and directories via an intuitive fluent interface", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/finder/tree/v7.3.2" + "source": "https://github.com/symfony/finder/tree/v7.4.0" }, "funding": [ { @@ -4342,24 +4397,24 @@ "type": "tidelift" } ], - "time": "2025-07-15T13:41:35+00:00" + "time": "2025-11-05T05:42:40+00:00" }, { "name": "symfony/options-resolver", - "version": "v7.3.3", + "version": "v8.0.0", "source": { "type": "git", "url": "https://github.com/symfony/options-resolver.git", - "reference": "0ff2f5c3df08a395232bbc3c2eb7e84912df911d" + "reference": "d2b592535ffa6600c265a3893a7f7fd2bad82dd7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/options-resolver/zipball/0ff2f5c3df08a395232bbc3c2eb7e84912df911d", - "reference": "0ff2f5c3df08a395232bbc3c2eb7e84912df911d", + "url": "https://api.github.com/repos/symfony/options-resolver/zipball/d2b592535ffa6600c265a3893a7f7fd2bad82dd7", + "reference": "d2b592535ffa6600c265a3893a7f7fd2bad82dd7", "shasum": "" }, "require": { - "php": ">=8.2", + "php": ">=8.4", "symfony/deprecation-contracts": "^2.5|^3" }, "type": "library", @@ -4393,7 +4448,7 @@ "options" ], "support": { - "source": "https://github.com/symfony/options-resolver/tree/v7.3.3" + "source": "https://github.com/symfony/options-resolver/tree/v8.0.0" }, "funding": [ { @@ -4413,7 +4468,7 @@ "type": "tidelift" } ], - "time": "2025-08-05T10:16:07+00:00" + "time": "2025-11-12T15:55:31+00:00" }, { "name": "symfony/polyfill-ctype", @@ -4996,16 +5051,16 @@ }, { "name": "symfony/process", - "version": "v7.3.4", + "version": "v7.4.0", "source": { "type": "git", "url": "https://github.com/symfony/process.git", - "reference": "f24f8f316367b30810810d4eb30c543d7003ff3b" + "reference": "7ca8dc2d0dcf4882658313aba8be5d9fd01026c8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/f24f8f316367b30810810d4eb30c543d7003ff3b", - "reference": "f24f8f316367b30810810d4eb30c543d7003ff3b", + "url": "https://api.github.com/repos/symfony/process/zipball/7ca8dc2d0dcf4882658313aba8be5d9fd01026c8", + "reference": "7ca8dc2d0dcf4882658313aba8be5d9fd01026c8", "shasum": "" }, "require": { @@ -5037,7 +5092,7 @@ "description": "Executes commands in sub-processes", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/process/tree/v7.3.4" + "source": "https://github.com/symfony/process/tree/v7.4.0" }, "funding": [ { @@ -5057,20 +5112,20 @@ "type": "tidelift" } ], - "time": "2025-09-11T10:12:26+00:00" + "time": "2025-10-16T11:21:06+00:00" }, { "name": "symfony/service-contracts", - "version": "v3.6.0", + "version": "v3.6.1", "source": { "type": "git", "url": "https://github.com/symfony/service-contracts.git", - "reference": "f021b05a130d35510bd6b25fe9053c2a8a15d5d4" + "reference": "45112560a3ba2d715666a509a0bc9521d10b6c43" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/service-contracts/zipball/f021b05a130d35510bd6b25fe9053c2a8a15d5d4", - "reference": "f021b05a130d35510bd6b25fe9053c2a8a15d5d4", + "url": "https://api.github.com/repos/symfony/service-contracts/zipball/45112560a3ba2d715666a509a0bc9521d10b6c43", + "reference": "45112560a3ba2d715666a509a0bc9521d10b6c43", "shasum": "" }, "require": { @@ -5124,7 +5179,7 @@ "standards" ], "support": { - "source": "https://github.com/symfony/service-contracts/tree/v3.6.0" + "source": "https://github.com/symfony/service-contracts/tree/v3.6.1" }, "funding": [ { @@ -5135,29 +5190,33 @@ "url": "https://github.com/fabpot", "type": "github" }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, { "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", "type": "tidelift" } ], - "time": "2025-04-25T09:37:31+00:00" + "time": "2025-07-15T11:30:57+00:00" }, { "name": "symfony/stopwatch", - "version": "v7.3.0", + "version": "v8.0.0", "source": { "type": "git", "url": "https://github.com/symfony/stopwatch.git", - "reference": "5a49289e2b308214c8b9c2fda4ea454d8b8ad7cd" + "reference": "67df1914c6ccd2d7b52f70d40cf2aea02159d942" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/stopwatch/zipball/5a49289e2b308214c8b9c2fda4ea454d8b8ad7cd", - "reference": "5a49289e2b308214c8b9c2fda4ea454d8b8ad7cd", + "url": "https://api.github.com/repos/symfony/stopwatch/zipball/67df1914c6ccd2d7b52f70d40cf2aea02159d942", + "reference": "67df1914c6ccd2d7b52f70d40cf2aea02159d942", "shasum": "" }, "require": { - "php": ">=8.2", + "php": ">=8.4", "symfony/service-contracts": "^2.5|^3" }, "type": "library", @@ -5186,7 +5245,7 @@ "description": "Provides a way to profile code", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/stopwatch/tree/v7.3.0" + "source": "https://github.com/symfony/stopwatch/tree/v8.0.0" }, "funding": [ { @@ -5197,43 +5256,47 @@ "url": "https://github.com/fabpot", "type": "github" }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, { "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", "type": "tidelift" } ], - "time": "2025-02-24T10:49:57+00:00" + "time": "2025-08-04T07:36:47+00:00" }, { "name": "symfony/string", - "version": "v7.3.4", + "version": "v8.0.1", "source": { "type": "git", "url": "https://github.com/symfony/string.git", - "reference": "f96476035142921000338bad71e5247fbc138872" + "reference": "ba65a969ac918ce0cc3edfac6cdde847eba231dc" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/string/zipball/f96476035142921000338bad71e5247fbc138872", - "reference": "f96476035142921000338bad71e5247fbc138872", + "url": "https://api.github.com/repos/symfony/string/zipball/ba65a969ac918ce0cc3edfac6cdde847eba231dc", + "reference": "ba65a969ac918ce0cc3edfac6cdde847eba231dc", "shasum": "" }, "require": { - "php": ">=8.2", - "symfony/polyfill-ctype": "~1.8", - "symfony/polyfill-intl-grapheme": "~1.0", - "symfony/polyfill-intl-normalizer": "~1.0", - "symfony/polyfill-mbstring": "~1.0" + "php": ">=8.4", + "symfony/polyfill-ctype": "^1.8", + "symfony/polyfill-intl-grapheme": "^1.33", + "symfony/polyfill-intl-normalizer": "^1.0", + "symfony/polyfill-mbstring": "^1.0" }, "conflict": { "symfony/translation-contracts": "<2.5" }, "require-dev": { - "symfony/emoji": "^7.1", - "symfony/http-client": "^6.4|^7.0", - "symfony/intl": "^6.4|^7.0", + "symfony/emoji": "^7.4|^8.0", + "symfony/http-client": "^7.4|^8.0", + "symfony/intl": "^7.4|^8.0", "symfony/translation-contracts": "^2.5|^3.0", - "symfony/var-exporter": "^6.4|^7.0" + "symfony/var-exporter": "^7.4|^8.0" }, "type": "library", "autoload": { @@ -5272,7 +5335,7 @@ "utf8" ], "support": { - "source": "https://github.com/symfony/string/tree/v7.3.4" + "source": "https://github.com/symfony/string/tree/v8.0.1" }, "funding": [ { @@ -5292,7 +5355,7 @@ "type": "tidelift" } ], - "time": "2025-09-11T14:36:48+00:00" + "time": "2025-12-01T09:13:36+00:00" }, { "name": "ta-tikoma/phpunit-architecture-test", @@ -5355,16 +5418,16 @@ }, { "name": "theseer/tokenizer", - "version": "1.2.3", + "version": "1.3.1", "source": { "type": "git", "url": "https://github.com/theseer/tokenizer.git", - "reference": "737eda637ed5e28c3413cb1ebe8bb52cbf1ca7a2" + "reference": "b7489ce515e168639d17feec34b8847c326b0b3c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/theseer/tokenizer/zipball/737eda637ed5e28c3413cb1ebe8bb52cbf1ca7a2", - "reference": "737eda637ed5e28c3413cb1ebe8bb52cbf1ca7a2", + "url": "https://api.github.com/repos/theseer/tokenizer/zipball/b7489ce515e168639d17feec34b8847c326b0b3c", + "reference": "b7489ce515e168639d17feec34b8847c326b0b3c", "shasum": "" }, "require": { @@ -5393,7 +5456,7 @@ "description": "A small library for converting tokenized PHP source code into XML and potentially other formats", "support": { "issues": "https://github.com/theseer/tokenizer/issues", - "source": "https://github.com/theseer/tokenizer/tree/1.2.3" + "source": "https://github.com/theseer/tokenizer/tree/1.3.1" }, "funding": [ { @@ -5401,32 +5464,32 @@ "type": "github" } ], - "time": "2024-03-03T12:36:25+00:00" + "time": "2025-11-17T20:03:58+00:00" }, { "name": "webmozart/assert", - "version": "1.11.0", + "version": "1.12.1", "source": { "type": "git", "url": "https://github.com/webmozarts/assert.git", - "reference": "11cb2199493b2f8a3b53e7f19068fc6aac760991" + "reference": "9be6926d8b485f55b9229203f962b51ed377ba68" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/webmozarts/assert/zipball/11cb2199493b2f8a3b53e7f19068fc6aac760991", - "reference": "11cb2199493b2f8a3b53e7f19068fc6aac760991", + "url": "https://api.github.com/repos/webmozarts/assert/zipball/9be6926d8b485f55b9229203f962b51ed377ba68", + "reference": "9be6926d8b485f55b9229203f962b51ed377ba68", "shasum": "" }, "require": { "ext-ctype": "*", + "ext-date": "*", + "ext-filter": "*", "php": "^7.2 || ^8.0" }, - "conflict": { - "phpstan/phpstan": "<0.12.20", - "vimeo/psalm": "<4.6.1 || 4.6.2" - }, - "require-dev": { - "phpunit/phpunit": "^8.5.13" + "suggest": { + "ext-intl": "", + "ext-simplexml": "", + "ext-spl": "" }, "type": "library", "extra": { @@ -5457,9 +5520,9 @@ ], "support": { "issues": "https://github.com/webmozarts/assert/issues", - "source": "https://github.com/webmozarts/assert/tree/1.11.0" + "source": "https://github.com/webmozarts/assert/tree/1.12.1" }, - "time": "2022-06-03T18:03:27+00:00" + "time": "2025-10-29T15:56:20+00:00" } ], "aliases": [], @@ -5468,7 +5531,7 @@ "prefer-stable": false, "prefer-lowest": false, "platform": { - "php": ">=8.2" + "php": "^8.2 || ^8.3 || ^8.4" }, "platform-dev": {}, "plugin-api-version": "2.6.0" diff --git a/doc/working-with-streams.md b/doc/working-with-streams.md index 211b796..716ba67 100644 --- a/doc/working-with-streams.md +++ b/doc/working-with-streams.md @@ -63,9 +63,7 @@ Phunkie Streams provides functions for creating potentially infinite streams: ```php but class Phunkie\\Streams\\Type\\Stream is not generic\.$#' + identifier: generics.notGeneric count: 1 - path: src/Infinite/Timer.php - - - - message: "#^PHPDoc tag @method has invalid value \\(getScope\\)\\: Unexpected token \"\\\\n \", expected '\\(' at offset 23$#" - count: 1 - path: src/Ops/Pull/InfinitePull/FunctorOps.php - - - - message: "#^PHPDoc tag @method has invalid value \\(getInfinite\\)\\: Unexpected token \"\\\\n \", expected '\\(' at offset 26$#" - count: 1 - path: src/Ops/Pull/InfinitePull/IteratorOps.php - - - - message: "#^PHPDoc tag @method has invalid value \\(getScope\\)\\: Unexpected token \"\\\\n \", expected '\\(' at offset 23$#" - count: 1 - path: src/Ops/Pull/ResourcePull/FunctorOps.php + path: src/Functions/file.php - - message: "#^PHPDoc tag @method has invalid value \\(getScope\\)\\: Unexpected token \"\\\\n \", expected '\\(' at offset 23$#" + message: '#^Property Phunkie\\Streams\\Infinite\\Timer\:\:\$limit \(int\|null\) does not accept float\|null\.$#' + identifier: assign.propertyType count: 1 - path: src/Ops/Pull/ResourcePullConcat/FunctorOps.php - - - - message: "#^PHPDoc tag @method has invalid value \\(getPull1\\)\\: Unexpected token \"\\\\n \\* \", expected '\\(' at offset 23$#" - count: 1 - path: src/Ops/Pull/ResourcePullConcat/ShowOps.php - - - - message: "#^PHPDoc tag @method has invalid value \\(getPull2\\)\\: Unexpected token \"\\\\n \", expected '\\(' at offset 43$#" - count: 1 - path: src/Ops/Pull/ResourcePullConcat/ShowOps.php - - - - message: "#^PHPDoc tag @method has invalid value \\(\\(\\)\\: Phunkie\\\\Streams\\\\Type\\\\Scope\\)\\: Unexpected token \"\\\\n \", expected type at offset 53$#" - count: 1 - path: src/Ops/Pull/TransformationOps.php - - - - message: "#^PHPDoc tag @method has invalid value \\(getScope\\)\\: Unexpected token \"\\\\n \", expected '\\(' at offset 23$#" - count: 1 - path: src/Ops/Pull/ValuesPull/FunctorOps.php - - - - message: "#^PHPDoc tag @method has invalid value \\(getScope\\)\\: Unexpected token \"\\\\n \", expected '\\(' at offset 23$#" - count: 1 - path: src/Ops/Pull/ValuesPull/MonadOps.php - - - - message: "#^PHPDoc tag @method has invalid value \\(\\(\\)\\: Phunkie\\\\Streams\\\\Type\\\\Pull\\)\\: Unexpected token \"\\\\n \", expected type at offset 51$#" - count: 1 - path: src/Ops/Stream/CompileOps.php - - - - message: "#^PHPDoc tag @method has invalid value \\(\\(\\)\\: Pull\\)\\: Unexpected token \"\\\\n \", expected type at offset 30$#" - count: 1 - path: src/Ops/Stream/ImmListOps.php - - - - message: "#^PHPDoc tag @method has invalid value \\(\\(\\)\\: Phunkie\\\\Streams\\\\Pull\\)\\: Unexpected token \"\\\\n \", expected type at offset 46$#" - count: 1 - path: src/Ops/Stream/ShowOps.php + path: src/Infinite/Timer.php - - message: "#^Class Phunkie\\\\Streams\\\\Type\\\\Scope does not have a constructor and must be instantiated without any parameters\\.$#" + message: '#^Class Phunkie\\Streams\\Type\\Scope does not have a constructor and must be instantiated without any parameters\.$#' + identifier: new.noConstructor count: 1 path: src/Pull/InfinitePull.php - - message: "#^Method Phunkie\\\\Streams\\\\Pull\\\\InfinitePull\\:\\:toArray\\(\\) should return array but returns Generator\\.$#" + message: '#^Method Phunkie\\Streams\\Pull\\InfinitePull\:\:toArray\(\) should return array but returns Generator\.$#' + identifier: return.type count: 1 path: src/Pull/InfinitePull.php - - message: "#^Call to an undefined method Phunkie\\\\Streams\\\\IO\\\\Resource\\:\\:pull\\(\\)\\.$#" + message: '#^Call to an undefined method Phunkie\\Streams\\IO\\Resource\:\:pull\(\)\.$#' + identifier: method.notFound count: 1 path: src/Pull/ResourceObjectPull.php - - message: "#^Call to an undefined method Phunkie\\\\Streams\\\\Type\\\\Pull\\:\\:drain\\(\\)\\.$#" + message: '#^Call to an undefined method Phunkie\\Streams\\Type\\Pull\:\:drain\(\)\.$#' + identifier: method.notFound count: 1 path: src/Stream/Compiler.php - - message: "#^Call to an undefined method Phunkie\\\\Streams\\\\Type\\\\Pull\\:\\:runLog\\(\\)\\.$#" + message: '#^Call to an undefined method Phunkie\\Streams\\Type\\Pull\:\:runLog\(\)\.$#' + identifier: method.notFound count: 1 path: src/Stream/Compiler.php - - message: "#^Access to an undefined property Phunkie\\\\Streams\\\\Stream\\\\Compiler\\:\\:\\$drain\\.$#" + message: '#^Access to an undefined property Phunkie\\Streams\\Stream\\Compiler\:\:\$drain\.$#' + identifier: property.notFound count: 1 path: src/Type/Stream.php - - message: "#^Anonymous function has an unused use \\$bytes\\.$#" + message: '#^Anonymous function has an unused use \$bytes\.$#' + identifier: closure.unusedUse count: 1 path: src/Type/Stream.php - - message: "#^Call to an undefined method Phunkie\\\\Types\\\\Kind\\:\\:flatMap\\(\\)\\.$#" + message: '#^Call to an undefined method Phunkie\\Types\\Kind\:\:flatMap\(\)\.$#' + identifier: method.notFound count: 1 path: src/Type/Stream.php - - message: "#^PHPDoc tag @param references unknown parameter\\: \\$context$#" + message: '#^PHPDoc tag @param references unknown parameter\: \$context$#' + identifier: parameter.notFound count: 1 path: src/Type/Stream.php - - message: "#^PHPDoc tag @return contains generic type Phunkie\\\\Streams\\\\Type\\\\Stream\\ but class Phunkie\\\\Streams\\\\Type\\\\Stream is not generic\\.$#" + message: '#^PHPDoc tag @return contains generic type Phunkie\\Streams\\Type\\Stream\ but class Phunkie\\Streams\\Type\\Stream is not generic\.$#' + identifier: generics.notGeneric count: 1 path: src/Type/Stream.php diff --git a/phpstan.neon b/phpstan.neon index 7656fb6..b5a0cc0 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -1,5 +1,6 @@ includes: - phpstan-baseline.neon + - vendor/phunkie/phpstan/extension.neon parameters: level: 3 diff --git a/scripts/pre-commit b/scripts/pre-commit new file mode 100755 index 0000000..3f8a882 --- /dev/null +++ b/scripts/pre-commit @@ -0,0 +1,30 @@ +#!/bin/bash + +# Pre-commit hook for Phunkie projects +# Runs lint and tests before allowing commit + +set -e + +echo "๐Ÿ” Running pre-commit checks..." + +# Run lint (cs-check + phpstan) +echo "" +echo "๐Ÿ“‹ Running lint checks..." +if ! composer lint; then + echo "" + echo "โŒ Lint checks failed. Please fix the issues before committing." + echo " Run 'composer cs-fix' to auto-fix code style issues." + exit 1 +fi + +# Run tests +echo "" +echo "๐Ÿงช Running tests..." +if ! composer test; then + echo "" + echo "โŒ Tests failed. Please fix the issues before committing." + exit 1 +fi + +echo "" +echo "โœ… All pre-commit checks passed!" diff --git a/scripts/setup.sh b/scripts/setup.sh new file mode 100755 index 0000000..298d99c --- /dev/null +++ b/scripts/setup.sh @@ -0,0 +1,32 @@ +#!/bin/bash + +# Setup script for development environment +# Installs git hooks and dependencies + +set -e + +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +PROJECT_ROOT="$(dirname "$SCRIPT_DIR")" + +echo "๐Ÿ”ง Setting up development environment..." + +# Install composer dependencies +echo "" +echo "๐Ÿ“ฆ Installing dependencies..." +composer install + +# Install pre-commit hook +echo "" +echo "๐Ÿช Installing git hooks..." +cp "$SCRIPT_DIR/pre-commit" "$PROJECT_ROOT/.git/hooks/pre-commit" +chmod +x "$PROJECT_ROOT/.git/hooks/pre-commit" + +echo "" +echo "โœ… Development environment setup complete!" +echo "" +echo "Available commands:" +echo " composer test - Run tests" +echo " composer lint - Run code style and static analysis" +echo " composer cs-fix - Auto-fix code style issues" +echo " composer check - Run lint + tests" +echo " composer test-all - Run tests on all PHP versions (requires Docker)" diff --git a/scripts/test-all-versions.sh b/scripts/test-all-versions.sh new file mode 100755 index 0000000..e7faf68 --- /dev/null +++ b/scripts/test-all-versions.sh @@ -0,0 +1,40 @@ +#!/bin/bash + +# Test against all supported PHP versions using Docker +# Requires Docker to be installed and running + +set -e + +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +PROJECT_ROOT="$(dirname "$SCRIPT_DIR")" + +PHP_VERSIONS=("8.2" "8.3" "8.4") + +echo "==========================================" +echo "Running lint + tests on PHP versions: ${PHP_VERSIONS[*]}" +echo "==========================================" + +for version in "${PHP_VERSIONS[@]}"; do + echo "" + echo "==========================================" + echo "PHP $version - Installing dependencies..." + echo "==========================================" + + docker run --rm -v "$PROJECT_ROOT:/app" -w /app \ + "php:${version}-cli" \ + sh -c "apt-get update -qq && apt-get install -y -qq git unzip > /dev/null && \ + curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer > /dev/null && \ + composer install --no-interaction --prefer-dist --quiet && \ + echo '--- Running lint (cs-check + phpstan) ---' && \ + composer lint && \ + echo '--- Running tests ---' && \ + composer test" + + echo "โœ… PHP $version passed (lint + tests)" +done + +echo "" +echo "==========================================" +echo "โœ… All PHP versions passed!" +echo "==========================================" + diff --git a/src/Functions/file.php b/src/Functions/file.php index fd0d591..ba08352 100644 --- a/src/Functions/file.php +++ b/src/Functions/file.php @@ -9,7 +9,23 @@ * file that was distributed with this source code. */ -namespace Phunkie\Streams\IO\File { +namespace { + + use Phunkie\Streams\IO\File\Path as PathClass; + + /** + * Creates a Path from a string + * + * @param string $pathname The path string + * @return PathClass The Path object + */ + function Path(string $pathname): PathClass + { + return new PathClass($pathname); + } +} + +namespace Phunkie\Streams\Functions\file { use function Phunkie\Effect\Functions\io\io; @@ -17,9 +33,17 @@ use function Phunkie\Streams\Functions\resource\bracket; + use Phunkie\Streams\IO\File\Path; use Phunkie\Streams\IO\Read; use Phunkie\Streams\Type\Stream; + /** + * Read all contents from a file as a Stream + * + * @param Path $path The file path to read from + * @param int $chunk The chunk size in bytes for reading + * @return Stream A stream of file contents + */ function readAll($path, $chunk): Stream { return Read::readAll($path, $chunk); diff --git a/src/Functions/infinite.php b/src/Functions/infinite.php index aa4b3e8..047a973 100644 --- a/src/Functions/infinite.php +++ b/src/Functions/infinite.php @@ -19,7 +19,7 @@ use Phunkie\Streams\Infinite\Timer; use Phunkie\Streams\Infinite\Unfold; - function fromRange(int $start, int $end, int $step = 1): Infinite + function fromRange(int $start, int $end = PHP_INT_MAX, int $step = 1): Infinite { return new Range($start, $end, $step); } diff --git a/src/Ops/Pull/EffectfulOps.php b/src/Ops/Pull/EffectfulOps.php index e2a3267..e2ef550 100644 --- a/src/Ops/Pull/EffectfulOps.php +++ b/src/Ops/Pull/EffectfulOps.php @@ -18,10 +18,12 @@ use function Phunkie\Streams\Functions\transformation\evalMap; use function Phunkie\Streams\Functions\transformation\evalTap; +use Phunkie\Streams\Type\Scope; + /** * This trait allows you to add operations with side effects to the scope of the stream. * - * @method getScope() + * @method Scope getScope() */ trait EffectfulOps { diff --git a/src/Ops/Pull/InfinitePull/FunctorOps.php b/src/Ops/Pull/InfinitePull/FunctorOps.php index 44c04f3..616d2e2 100644 --- a/src/Ops/Pull/InfinitePull/FunctorOps.php +++ b/src/Ops/Pull/InfinitePull/FunctorOps.php @@ -13,8 +13,10 @@ use function Phunkie\Streams\Functions\transformation\map; +use Phunkie\Streams\Type\Scope; + /** - * @method getScope + * @method Scope getScope() */ trait FunctorOps { diff --git a/src/Ops/Pull/InfinitePull/IteratorOps.php b/src/Ops/Pull/InfinitePull/IteratorOps.php index 0a0a0f6..57109c2 100644 --- a/src/Ops/Pull/InfinitePull/IteratorOps.php +++ b/src/Ops/Pull/InfinitePull/IteratorOps.php @@ -11,8 +11,10 @@ namespace Phunkie\Streams\Ops\Pull\InfinitePull; +use Phunkie\Streams\Infinite\Infinite; + /** - * @method getInfinite + * @method Infinite getInfinite() */ trait IteratorOps { diff --git a/src/Ops/Pull/ResourcePull/FunctorOps.php b/src/Ops/Pull/ResourcePull/FunctorOps.php index 083b36d..6469674 100644 --- a/src/Ops/Pull/ResourcePull/FunctorOps.php +++ b/src/Ops/Pull/ResourcePull/FunctorOps.php @@ -11,8 +11,10 @@ namespace Phunkie\Streams\Ops\Pull\ResourcePull; +use Phunkie\Streams\Type\Scope; + /** - * @method getScope + * @method Scope getScope() */ trait FunctorOps { diff --git a/src/Ops/Pull/ResourcePullConcat/CompileOps.php b/src/Ops/Pull/ResourcePullConcat/CompileOps.php index 8022548..5d7c1a2 100644 --- a/src/Ops/Pull/ResourcePullConcat/CompileOps.php +++ b/src/Ops/Pull/ResourcePullConcat/CompileOps.php @@ -13,10 +13,11 @@ use Phunkie\Effect\IO\IO; use Phunkie\Streams\IO\Resource; +use Phunkie\Streams\Type\Pull; use Phunkie\Types\ImmList; /** - * @method pull() + * @method Pull pull() */ trait CompileOps { diff --git a/src/Ops/Pull/ResourcePullConcat/FunctorOps.php b/src/Ops/Pull/ResourcePullConcat/FunctorOps.php index eaa8103..e608cc6 100644 --- a/src/Ops/Pull/ResourcePullConcat/FunctorOps.php +++ b/src/Ops/Pull/ResourcePullConcat/FunctorOps.php @@ -11,8 +11,10 @@ namespace Phunkie\Streams\Ops\Pull\ResourcePullConcat; +use Phunkie\Streams\Type\Scope; + /** - * @method getScope + * @method Scope getScope() */ trait FunctorOps { diff --git a/src/Ops/Pull/ResourcePullConcat/ShowOps.php b/src/Ops/Pull/ResourcePullConcat/ShowOps.php index b5a7fa2..e02cc25 100644 --- a/src/Ops/Pull/ResourcePullConcat/ShowOps.php +++ b/src/Ops/Pull/ResourcePullConcat/ShowOps.php @@ -11,9 +11,11 @@ namespace Phunkie\Streams\Ops\Pull\ResourcePullConcat; +use Phunkie\Streams\Type\Pull; + /** - * @method getPull1 - * @method getPull2 + * @method Pull getPull1() + * @method Pull getPull2() */ trait ShowOps { diff --git a/src/Ops/Pull/TransformationOps.php b/src/Ops/Pull/TransformationOps.php index d9176b8..9f5f73a 100644 --- a/src/Ops/Pull/TransformationOps.php +++ b/src/Ops/Pull/TransformationOps.php @@ -12,10 +12,11 @@ namespace Phunkie\Streams\Ops\Pull; use Phunkie\Effect\IO\IO; +use Phunkie\Streams\Type\Scope; use Phunkie\Streams\Type\Transformation; /** - * @method getScope(): Phunkie\Streams\Type\Scope + * @method Scope getScope() */ trait TransformationOps { diff --git a/src/Ops/Pull/ValuesPull/FunctorOps.php b/src/Ops/Pull/ValuesPull/FunctorOps.php index 0e97cd3..55a98cd 100644 --- a/src/Ops/Pull/ValuesPull/FunctorOps.php +++ b/src/Ops/Pull/ValuesPull/FunctorOps.php @@ -13,8 +13,10 @@ use function Phunkie\Streams\Functions\transformation\map; +use Phunkie\Streams\Type\Scope; + /** - * @method getScope + * @method Scope getScope() */ trait FunctorOps { diff --git a/src/Ops/Pull/ValuesPull/MonadOps.php b/src/Ops/Pull/ValuesPull/MonadOps.php index ea12967..c453b5e 100644 --- a/src/Ops/Pull/ValuesPull/MonadOps.php +++ b/src/Ops/Pull/ValuesPull/MonadOps.php @@ -14,8 +14,10 @@ use function Phunkie\Streams\Functions\transformation\flatMap; use function Phunkie\Streams\Functions\transformation\flatten; +use Phunkie\Streams\Type\Scope; + /** - * @method getScope + * @method Scope getScope() */ trait MonadOps { diff --git a/src/Ops/Stream/CompileOps.php b/src/Ops/Stream/CompileOps.php index 6093f42..fe7d25d 100644 --- a/src/Ops/Stream/CompileOps.php +++ b/src/Ops/Stream/CompileOps.php @@ -12,10 +12,11 @@ namespace Phunkie\Streams\Ops\Stream; use Phunkie\Effect\IO\IO; +use Phunkie\Streams\Type\Pull; use Phunkie\Types\ImmList; /** - * @method getPull(): Phunkie\Streams\Type\Pull + * @method Pull getPull() */ trait CompileOps { diff --git a/src/Ops/Stream/ImmListOps.php b/src/Ops/Stream/ImmListOps.php index 8175aa1..df75629 100644 --- a/src/Ops/Stream/ImmListOps.php +++ b/src/Ops/Stream/ImmListOps.php @@ -14,10 +14,11 @@ use Phunkie\Streams\Pull\ResourcePull; use Phunkie\Streams\Pull\ResourcePullConcat; use Phunkie\Streams\Pull\ValuesPull; +use Phunkie\Streams\Type\Pull; use Phunkie\Streams\Type\Stream; /** - * @method getPull(): Pull + * @method Pull getPull() */ trait ImmListOps { diff --git a/src/Ops/Stream/ShowOps.php b/src/Ops/Stream/ShowOps.php index c9b9094..567f288 100644 --- a/src/Ops/Stream/ShowOps.php +++ b/src/Ops/Stream/ShowOps.php @@ -11,8 +11,10 @@ namespace Phunkie\Streams\Ops\Stream; +use Phunkie\Streams\Type\Pull; + /** - * @method getPull(): Phunkie\Streams\Pull + * @method Pull getPull() */ trait ShowOps { diff --git a/src/Type/Pull.php b/src/Type/Pull.php index 3c224d7..963f195 100644 --- a/src/Type/Pull.php +++ b/src/Type/Pull.php @@ -14,6 +14,25 @@ use Phunkie\Streams\Compilable; use Phunkie\Streams\Showable; +/** + * Pull represents a pull-based stream that can be compiled to produce values. + * + * @method static map(callable $f) + * @method static flatMap(callable $f) + * @method static flatten() + * @method static evalMap(callable $f) + * @method static evalTap(callable $f) + * @method static evalFilter(callable $f) + * @method static evalFlatMap(callable $f) + * @method static interleave(Pull ...$pulls) + * @method static take(int $n) + * @method static filter(callable $f) + * @method static takeWhile(callable $predicate) + * @method static dropWhile(callable $predicate) + * @method static chunk(int $size) + * @method array getValues() + * @method void setScope(Scope $scope) + */ interface Pull extends Showable, Compilable, \Iterator { public function pull(); diff --git a/tests/Feature/Streams/BracketSpec.php b/tests/Feature/Streams/BracketSpec.php index d8753ed..b29f283 100644 --- a/tests/Feature/Streams/BracketSpec.php +++ b/tests/Feature/Streams/BracketSpec.php @@ -1,18 +1,17 @@ toBe([2, 4, 6, 8]); // With concurrency of 2, should take ~200ms (2 batches of 100ms each) // Without concurrency, would take ~400ms (4 sequential operations) - expect($duration)->toBeLessThan(0.5); // Allow overhead for PHP Fibers + expect($duration)->toBeLessThan(0.7); // Allow overhead for PHP Fibers and CI }); it('auto-detects CPU cores when maxConcurrent is 0', function () { diff --git a/tests/Feature/Streams/ErrorHandlingSpec.php b/tests/Feature/Streams/ErrorHandlingSpec.php index 9874573..c178fb4 100644 --- a/tests/Feature/Streams/ErrorHandlingSpec.php +++ b/tests/Feature/Streams/ErrorHandlingSpec.php @@ -1,14 +1,13 @@