diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..05c69d0 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,66 @@ +name: PHP Test and Coverage +on: + pull_request: + push: + branches: + - master + +jobs: + test: + runs-on: ubuntu-latest + strategy: + matrix: + php: [ 8.3, 8.4 ] + include: + - php: 8.4 + coverage: yes + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php }} + extensions: mbstring, xml + coverage: ${{ matrix.coverage == 'yes' }} + + - name: Cache dependencies + uses: actions/cache@v3 + with: + path: ~/.composer/cache + key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} + restore-keys: ${{ runner.os }}-composer- + + - name: Install dependencies + run: composer install --prefer-source + + - name: Prepare test coverage (if applicable) + if: ${{ matrix.coverage == 'yes' }} + run: | + curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter + chmod +x ./cc-test-reporter + ./cc-test-reporter before-build + + - name: Run tests without coverage + if: ${{ matrix.coverage != 'yes' }} + run: composer test + + - name: Run tests with coverage + if: ${{ matrix.coverage == 'yes' }} + run: composer testc + env: + XDEBUG_MODE: coverage + + - name: Code checks + if: ${{ matrix.coverage == 'yes' }} + run: composer check-code + env: + XDEBUG_MODE: coverage + PHP_CS_FIXER_IGNORE_ENV: true + + - name: Upload test coverage (if applicable) + if: ${{ matrix.coverage == 'yes' }} + run: ./cc-test-reporter after-build --coverage-input-type clover --exit-code 0 + env: + CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }} diff --git a/.gitignore b/.gitignore index 7f2a0b2..cbefc53 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ vendor/ .idea .php_cs.cache +.phpunit.cache diff --git a/.php_cs b/.php-cs-fixer.php similarity index 83% rename from .php_cs rename to .php-cs-fixer.php index 11c7fa5..8380ebf 100644 --- a/.php_cs +++ b/.php-cs-fixer.php @@ -1,8 +1,12 @@ exclude('vendor') ->in(__DIR__); -return PhpCsFixer\Config::create() + +return (new PhpCsFixer\Config()) ->setUsingCache(true) ->setRules([ '@PSR2' => true, @@ -14,7 +18,7 @@ 'indentation_type' => true, 'blank_line_after_namespace' => true, 'line_ending' => true, - 'lowercase_constants' => true, + 'constant_case' => ['case' => 'lower'], // Replaces lowercase_constants 'lowercase_keywords' => true, 'no_closing_tag' => true, 'single_line_after_imports' => true, @@ -23,7 +27,7 @@ 'whitespace_after_comma_in_array' => true, 'blank_line_after_opening_tag' => true, 'no_empty_statement' => true, - 'no_extra_consecutive_blank_lines' => true, + 'no_extra_blank_lines' => true, // Replaces no_extra_consecutive_blank_lines 'function_typehint_space' => true, 'no_leading_namespace_whitespace' => true, 'no_blank_lines_after_class_opening' => true, @@ -31,8 +35,7 @@ 'phpdoc_scalar' => true, 'phpdoc_types' => true, 'no_leading_import_slash' => true, - 'no_extra_consecutive_blank_lines' => ['use'], - 'blank_line_before_return' => true, + 'blank_line_before_statement' => ['statements' => ['return']], // Replaces blank_line_before_return 'self_accessor' => false, 'no_short_bool_cast' => true, 'no_trailing_comma_in_singleline_array' => true, diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index b330e96..0000000 --- a/.travis.yml +++ /dev/null @@ -1,36 +0,0 @@ -language: php - -dist: trusty - -php: - - 7.2 - - 7.3 - -matrix: - include: - - php: 7.2 - env: COVERAGE=yes - -cache: - directories: - - $HOME/.composer/cache - -before_script: - - composer self-update - - if [[ $COVERAGE == yes ]]; then curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter; fi - - if [[ $COVERAGE == yes ]]; then chmod +x ./cc-test-reporter; fi - - if [[ $COVERAGE == yes ]]; then ./cc-test-reporter before-build; fi - -install: - - composer install --prefer-source - -script: - - if [[ $COVERAGE != yes ]]; then composer test; fi - - if [[ $COVERAGE == yes ]]; then composer testc; fi - - if [[ $COVERAGE == yes ]]; then composer check-code; fi - -after_script: - - if [[ $COVERAGE == yes ]]; then ./cc-test-reporter after-build --coverage-input-type clover --exit-code $TRAVIS_TEST_RESULT; fi - -notifications: - email: false diff --git a/README.md b/README.md index 8d66eca..2b4a27a 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ # PHP Functional -[![Build Status](https://travis-ci.org/widmogrod/php-functional.svg)](https://travis-ci.org/widmogrod/php-functional) +![Build Status](https://github.com/widmogrod/php-functional/actions/workflows/ci.yml/badge.svg) [![Test Coverage](https://api.codeclimate.com/v1/badges/895bddc952aefca0d82a/test_coverage)](https://codeclimate.com/github/widmogrod/php-functional/test_coverage) [![Maintainability](https://api.codeclimate.com/v1/badges/895bddc952aefca0d82a/maintainability)](https://codeclimate.com/github/widmogrod/php-functional/maintainability) ## Introduction diff --git a/composer.json b/composer.json index 470005c..6138641 100644 --- a/composer.json +++ b/composer.json @@ -2,13 +2,13 @@ "name": "widmogrod/php-functional", "description": "Functors, Applicative and Monads are fascinating concept. Purpose of this library is to explore them in OOP PHP world.", "require": { - "php": "^7.1|^8.0", + "php": ">=8.3", "functional-php/fantasy-land": "^1" }, "require-dev": { - "phpunit/phpunit": "^6", - "friendsofphp/php-cs-fixer": "^2", - "giorgiosironi/eris": "^0.9" + "phpunit/phpunit": "^11.5.1", + "friendsofphp/php-cs-fixer": "^v3.65.0", + "giorgiosironi/eris": "^1.0.0" }, "license": "MIT", "authors": [ diff --git a/composer.lock b/composer.lock index 3fe43bf..111cb0c 100644 --- a/composer.lock +++ b/composer.lock @@ -4,20 +4,20 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "722371fce21dbeed7ea53b65ff26950a", + "content-hash": "3ae68fe452bff514ea981caf9705df9d", "packages": [ { "name": "functional-php/fantasy-land", - "version": "1.0.0", + "version": "1.0.1", "source": { "type": "git", "url": "https://github.com/functional-php/fantasy-land.git", - "reference": "c855c856e70db81032a8a4fd17bd74a58d26a279" + "reference": "1e2366e68057bbc7a65d58dd663324eb9b299775" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/functional-php/fantasy-land/zipball/c855c856e70db81032a8a4fd17bd74a58d26a279", - "reference": "c855c856e70db81032a8a4fd17bd74a58d26a279", + "url": "https://api.github.com/repos/functional-php/fantasy-land/zipball/1e2366e68057bbc7a65d58dd663324eb9b299775", + "reference": "1e2366e68057bbc7a65d58dd663324eb9b299775", "shasum": "" }, "require": { @@ -30,12 +30,12 @@ }, "type": "library", "autoload": { - "psr-4": { - "FunctionalPHP\\": "./src" - }, "files": [ "src/FantasyLand/functions.php" - ] + ], + "psr-4": { + "FunctionalPHP\\": "./src" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -48,40 +48,40 @@ } ], "description": "Specification for interoperability of common algebraic structures in PHP", - "time": "2018-02-18T14:54:04+00:00" + "support": { + "issues": "https://github.com/functional-php/fantasy-land/issues", + "source": "https://github.com/functional-php/fantasy-land/tree/1.0.1" + }, + "time": "2021-01-19T18:06:19+00:00" } ], "packages-dev": [ { - "name": "composer/semver", - "version": "1.5.0", + "name": "clue/ndjson-react", + "version": "v1.3.0", "source": { "type": "git", - "url": "https://github.com/composer/semver.git", - "reference": "46d9139568ccb8d9e7cdd4539cab7347568a5e2e" + "url": "https://github.com/clue/reactphp-ndjson.git", + "reference": "392dc165fce93b5bb5c637b67e59619223c931b0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/semver/zipball/46d9139568ccb8d9e7cdd4539cab7347568a5e2e", - "reference": "46d9139568ccb8d9e7cdd4539cab7347568a5e2e", + "url": "https://api.github.com/repos/clue/reactphp-ndjson/zipball/392dc165fce93b5bb5c637b67e59619223c931b0", + "reference": "392dc165fce93b5bb5c637b67e59619223c931b0", "shasum": "" }, "require": { - "php": "^5.3.2 || ^7.0" + "php": ">=5.3", + "react/stream": "^1.2" }, "require-dev": { - "phpunit/phpunit": "^4.5 || ^5.0.5", - "phpunit/phpunit-mock-objects": "2.3.0 || ^3.0" + "phpunit/phpunit": "^9.5 || ^5.7 || ^4.8.35", + "react/event-loop": "^1.2" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.x-dev" - } - }, "autoload": { "psr-4": { - "Composer\\Semver\\": "src" + "Clue\\React\\NDJson\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", @@ -90,55 +90,75 @@ ], "authors": [ { - "name": "Nils Adermann", - "email": "naderman@naderman.de", - "homepage": "http://www.naderman.de" - }, + "name": "Christian Lück", + "email": "christian@clue.engineering" + } + ], + "description": "Streaming newline-delimited JSON (NDJSON) parser and encoder for ReactPHP.", + "homepage": "https://github.com/clue/reactphp-ndjson", + "keywords": [ + "NDJSON", + "json", + "jsonlines", + "newline", + "reactphp", + "streaming" + ], + "support": { + "issues": "https://github.com/clue/reactphp-ndjson/issues", + "source": "https://github.com/clue/reactphp-ndjson/tree/v1.3.0" + }, + "funding": [ { - "name": "Jordi Boggiano", - "email": "j.boggiano@seld.be", - "homepage": "http://seld.be" + "url": "https://clue.engineering/support", + "type": "custom" }, { - "name": "Rob Bast", - "email": "rob.bast@gmail.com", - "homepage": "http://robbast.nl" + "url": "https://github.com/clue", + "type": "github" } ], - "description": "Semver library that offers utilities, version constraint parsing and validation.", - "keywords": [ - "semantic", - "semver", - "validation", - "versioning" - ], - "time": "2019-03-19T17:25:45+00:00" + "time": "2022-12-23T10:58:28+00:00" }, { - "name": "composer/xdebug-handler", - "version": "1.3.3", + "name": "composer/pcre", + "version": "3.3.2", "source": { "type": "git", - "url": "https://github.com/composer/xdebug-handler.git", - "reference": "46867cbf8ca9fb8d60c506895449eb799db1184f" + "url": "https://github.com/composer/pcre.git", + "reference": "b2bed4734f0cc156ee1fe9c0da2550420d99a21e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/xdebug-handler/zipball/46867cbf8ca9fb8d60c506895449eb799db1184f", - "reference": "46867cbf8ca9fb8d60c506895449eb799db1184f", + "url": "https://api.github.com/repos/composer/pcre/zipball/b2bed4734f0cc156ee1fe9c0da2550420d99a21e", + "reference": "b2bed4734f0cc156ee1fe9c0da2550420d99a21e", "shasum": "" }, "require": { - "php": "^5.3.2 || ^7.0", - "psr/log": "^1.0" + "php": "^7.4 || ^8.0" + }, + "conflict": { + "phpstan/phpstan": "<1.11.10" }, "require-dev": { - "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.5" + "phpstan/phpstan": "^1.12 || ^2", + "phpstan/phpstan-strict-rules": "^1 || ^2", + "phpunit/phpunit": "^8 || ^9" }, "type": "library", + "extra": { + "branch-alias": { + "dev-main": "3.x-dev" + }, + "phpstan": { + "includes": [ + "extension.neon" + ] + } + }, "autoload": { "psr-4": { - "Composer\\XdebugHandler\\": "src" + "Composer\\Pcre\\": "src" } }, "notification-url": "https://packagist.org/downloads/", @@ -147,48 +167,68 @@ ], "authors": [ { - "name": "John Stevenson", - "email": "john-stevenson@blueyonder.co.uk" + "name": "Jordi Boggiano", + "email": "j.boggiano@seld.be", + "homepage": "http://seld.be" } ], - "description": "Restarts a process without xdebug.", + "description": "PCRE wrapping library that offers type-safe preg_* replacements.", "keywords": [ - "Xdebug", - "performance" + "PCRE", + "preg", + "regex", + "regular expression" + ], + "support": { + "issues": "https://github.com/composer/pcre/issues", + "source": "https://github.com/composer/pcre/tree/3.3.2" + }, + "funding": [ + { + "url": "https://packagist.com", + "type": "custom" + }, + { + "url": "https://github.com/composer", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/composer/composer", + "type": "tidelift" + } ], - "time": "2019-05-27T17:52:04+00:00" + "time": "2024-11-12T16:29:46+00:00" }, { - "name": "doctrine/annotations", - "version": "v1.7.0", + "name": "composer/semver", + "version": "3.4.3", "source": { "type": "git", - "url": "https://github.com/doctrine/annotations.git", - "reference": "fa4c4e861e809d6a1103bd620cce63ed91aedfeb" + "url": "https://github.com/composer/semver.git", + "reference": "4313d26ada5e0c4edfbd1dc481a92ff7bff91f12" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/annotations/zipball/fa4c4e861e809d6a1103bd620cce63ed91aedfeb", - "reference": "fa4c4e861e809d6a1103bd620cce63ed91aedfeb", + "url": "https://api.github.com/repos/composer/semver/zipball/4313d26ada5e0c4edfbd1dc481a92ff7bff91f12", + "reference": "4313d26ada5e0c4edfbd1dc481a92ff7bff91f12", "shasum": "" }, "require": { - "doctrine/lexer": "1.*", - "php": "^7.1" + "php": "^5.3.2 || ^7.0 || ^8.0" }, "require-dev": { - "doctrine/cache": "1.*", - "phpunit/phpunit": "^7.5@dev" + "phpstan/phpstan": "^1.11", + "symfony/phpunit-bridge": "^3 || ^7" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.7.x-dev" + "dev-main": "3.x-dev" } }, "autoload": { "psr-4": { - "Doctrine\\Common\\Annotations\\": "lib/Doctrine/Common/Annotations" + "Composer\\Semver\\": "src" } }, "notification-url": "https://packagist.org/downloads/", @@ -197,70 +237,77 @@ ], "authors": [ { - "name": "Guilherme Blanco", - "email": "guilhermeblanco@gmail.com" + "name": "Nils Adermann", + "email": "naderman@naderman.de", + "homepage": "http://www.naderman.de" }, { - "name": "Roman Borschel", - "email": "roman@code-factory.org" + "name": "Jordi Boggiano", + "email": "j.boggiano@seld.be", + "homepage": "http://seld.be" }, { - "name": "Benjamin Eberlei", - "email": "kontakt@beberlei.de" + "name": "Rob Bast", + "email": "rob.bast@gmail.com", + "homepage": "http://robbast.nl" + } + ], + "description": "Semver library that offers utilities, version constraint parsing and validation.", + "keywords": [ + "semantic", + "semver", + "validation", + "versioning" + ], + "support": { + "irc": "ircs://irc.libera.chat:6697/composer", + "issues": "https://github.com/composer/semver/issues", + "source": "https://github.com/composer/semver/tree/3.4.3" + }, + "funding": [ + { + "url": "https://packagist.com", + "type": "custom" }, { - "name": "Jonathan Wage", - "email": "jonwage@gmail.com" + "url": "https://github.com/composer", + "type": "github" }, { - "name": "Johannes Schmitt", - "email": "schmittjoh@gmail.com" + "url": "https://tidelift.com/funding/github/packagist/composer/composer", + "type": "tidelift" } ], - "description": "Docblock Annotations Parser", - "homepage": "http://www.doctrine-project.org", - "keywords": [ - "annotations", - "docblock", - "parser" - ], - "time": "2019-08-08T18:11:40+00:00" + "time": "2024-09-19T14:15:21+00:00" }, { - "name": "doctrine/instantiator", - "version": "1.2.0", + "name": "composer/xdebug-handler", + "version": "3.0.5", "source": { "type": "git", - "url": "https://github.com/doctrine/instantiator.git", - "reference": "a2c590166b2133a4633738648b6b064edae0814a" + "url": "https://github.com/composer/xdebug-handler.git", + "reference": "6c1925561632e83d60a44492e0b344cf48ab85ef" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/instantiator/zipball/a2c590166b2133a4633738648b6b064edae0814a", - "reference": "a2c590166b2133a4633738648b6b064edae0814a", + "url": "https://api.github.com/repos/composer/xdebug-handler/zipball/6c1925561632e83d60a44492e0b344cf48ab85ef", + "reference": "6c1925561632e83d60a44492e0b344cf48ab85ef", "shasum": "" }, "require": { - "php": "^7.1" + "composer/pcre": "^1 || ^2 || ^3", + "php": "^7.2.5 || ^8.0", + "psr/log": "^1 || ^2 || ^3" }, "require-dev": { - "doctrine/coding-standard": "^6.0", - "ext-pdo": "*", - "ext-phar": "*", - "phpbench/phpbench": "^0.13", - "phpstan/phpstan-phpunit": "^0.11", - "phpstan/phpstan-shim": "^0.11", - "phpunit/phpunit": "^7.0" + "phpstan/phpstan": "^1.0", + "phpstan/phpstan-strict-rules": "^1.1", + "phpunit/phpunit": "^8.5 || ^9.6 || ^10.5" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.2.x-dev" - } - }, "autoload": { "psr-4": { - "Doctrine\\Instantiator\\": "src/Doctrine/Instantiator/" + "Composer\\XdebugHandler\\": "src" } }, "notification-url": "https://packagist.org/downloads/", @@ -269,50 +316,115 @@ ], "authors": [ { - "name": "Marco Pivetta", - "email": "ocramius@gmail.com", - "homepage": "http://ocramius.github.com/" + "name": "John Stevenson", + "email": "john-stevenson@blueyonder.co.uk" } ], - "description": "A small, lightweight utility to instantiate objects in PHP without invoking their constructors", - "homepage": "https://www.doctrine-project.org/projects/instantiator.html", + "description": "Restarts a process without Xdebug.", "keywords": [ - "constructor", - "instantiate" + "Xdebug", + "performance" + ], + "support": { + "irc": "ircs://irc.libera.chat:6697/composer", + "issues": "https://github.com/composer/xdebug-handler/issues", + "source": "https://github.com/composer/xdebug-handler/tree/3.0.5" + }, + "funding": [ + { + "url": "https://packagist.com", + "type": "custom" + }, + { + "url": "https://github.com/composer", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/composer/composer", + "type": "tidelift" + } ], - "time": "2019-03-17T17:37:11+00:00" + "time": "2024-05-06T16:37:16+00:00" }, { - "name": "doctrine/lexer", - "version": "1.1.0", + "name": "evenement/evenement", + "version": "v3.0.2", "source": { "type": "git", - "url": "https://github.com/doctrine/lexer.git", - "reference": "e17f069ede36f7534b95adec71910ed1b49c74ea" + "url": "https://github.com/igorw/evenement.git", + "reference": "0a16b0d71ab13284339abb99d9d2bd813640efbc" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/lexer/zipball/e17f069ede36f7534b95adec71910ed1b49c74ea", - "reference": "e17f069ede36f7534b95adec71910ed1b49c74ea", + "url": "https://api.github.com/repos/igorw/evenement/zipball/0a16b0d71ab13284339abb99d9d2bd813640efbc", + "reference": "0a16b0d71ab13284339abb99d9d2bd813640efbc", "shasum": "" }, "require": { - "php": "^7.2" + "php": ">=7.0" }, "require-dev": { - "doctrine/coding-standard": "^6.0", - "phpstan/phpstan": "^0.11.8", - "phpunit/phpunit": "^8.2" + "phpunit/phpunit": "^9 || ^6" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.1.x-dev" + "autoload": { + "psr-4": { + "Evenement\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Igor Wiedler", + "email": "igor@wiedler.ch" } + ], + "description": "Événement is a very simple event dispatching library for PHP", + "keywords": [ + "event-dispatcher", + "event-emitter" + ], + "support": { + "issues": "https://github.com/igorw/evenement/issues", + "source": "https://github.com/igorw/evenement/tree/v3.0.2" + }, + "time": "2023-08-08T05:53:35+00:00" + }, + { + "name": "fidry/cpu-core-counter", + "version": "1.2.0", + "source": { + "type": "git", + "url": "https://github.com/theofidry/cpu-core-counter.git", + "reference": "8520451a140d3f46ac33042715115e290cf5785f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/theofidry/cpu-core-counter/zipball/8520451a140d3f46ac33042715115e290cf5785f", + "reference": "8520451a140d3f46ac33042715115e290cf5785f", + "shasum": "" }, + "require": { + "php": "^7.2 || ^8.0" + }, + "require-dev": { + "fidry/makefile": "^0.2.0", + "fidry/php-cs-fixer-config": "^1.1.2", + "phpstan/extension-installer": "^1.2.0", + "phpstan/phpstan": "^1.9.2", + "phpstan/phpstan-deprecation-rules": "^1.0.0", + "phpstan/phpstan-phpunit": "^1.2.2", + "phpstan/phpstan-strict-rules": "^1.4.4", + "phpunit/phpunit": "^8.5.31 || ^9.5.26", + "webmozarts/strict-phpunit": "^7.5" + }, + "type": "library", "autoload": { "psr-4": { - "Doctrine\\Common\\Lexer\\": "lib/Doctrine/Common/Lexer" + "Fidry\\CpuCoreCounter\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", @@ -321,79 +433,84 @@ ], "authors": [ { - "name": "Guilherme Blanco", - "email": "guilhermeblanco@gmail.com" - }, - { - "name": "Roman Borschel", - "email": "roman@code-factory.org" - }, - { - "name": "Johannes Schmitt", - "email": "schmittjoh@gmail.com" + "name": "Théo FIDRY", + "email": "theo.fidry@gmail.com" } ], - "description": "PHP Doctrine Lexer parser library that can be used in Top-Down, Recursive Descent Parsers.", - "homepage": "https://www.doctrine-project.org/projects/lexer.html", + "description": "Tiny utility to get the number of CPU cores.", "keywords": [ - "annotations", - "docblock", - "lexer", - "parser", - "php" + "CPU", + "core" + ], + "support": { + "issues": "https://github.com/theofidry/cpu-core-counter/issues", + "source": "https://github.com/theofidry/cpu-core-counter/tree/1.2.0" + }, + "funding": [ + { + "url": "https://github.com/theofidry", + "type": "github" + } ], - "time": "2019-07-30T19:33:28+00:00" + "time": "2024-08-06T10:04:20+00:00" }, { "name": "friendsofphp/php-cs-fixer", - "version": "v2.15.2", + "version": "v3.65.0", "source": { "type": "git", - "url": "https://github.com/FriendsOfPHP/PHP-CS-Fixer.git", - "reference": "c9d30fddfa3feb8b82663104864224f2ce7a3675" + "url": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer.git", + "reference": "79d4f3e77b250a7d8043d76c6af8f0695e8a469f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/FriendsOfPHP/PHP-CS-Fixer/zipball/c9d30fddfa3feb8b82663104864224f2ce7a3675", - "reference": "c9d30fddfa3feb8b82663104864224f2ce7a3675", + "url": "https://api.github.com/repos/PHP-CS-Fixer/PHP-CS-Fixer/zipball/79d4f3e77b250a7d8043d76c6af8f0695e8a469f", + "reference": "79d4f3e77b250a7d8043d76c6af8f0695e8a469f", "shasum": "" }, "require": { - "composer/semver": "^1.4", - "composer/xdebug-handler": "^1.2", - "doctrine/annotations": "^1.2", + "clue/ndjson-react": "^1.0", + "composer/semver": "^3.4", + "composer/xdebug-handler": "^3.0.3", + "ext-filter": "*", "ext-json": "*", "ext-tokenizer": "*", - "php": "^5.6 || ^7.0", - "php-cs-fixer/diff": "^1.3", - "symfony/console": "^3.4.17 || ^4.1.6", - "symfony/event-dispatcher": "^3.0 || ^4.0", - "symfony/filesystem": "^3.0 || ^4.0", - "symfony/finder": "^3.0 || ^4.0", - "symfony/options-resolver": "^3.0 || ^4.0", - "symfony/polyfill-php70": "^1.0", - "symfony/polyfill-php72": "^1.4", - "symfony/process": "^3.0 || ^4.0", - "symfony/stopwatch": "^3.0 || ^4.0" + "fidry/cpu-core-counter": "^1.2", + "php": "^7.4 || ^8.0", + "react/child-process": "^0.6.5", + "react/event-loop": "^1.0", + "react/promise": "^2.0 || ^3.0", + "react/socket": "^1.0", + "react/stream": "^1.0", + "sebastian/diff": "^4.0 || ^5.0 || ^6.0", + "symfony/console": "^5.4 || ^6.0 || ^7.0", + "symfony/event-dispatcher": "^5.4 || ^6.0 || ^7.0", + "symfony/filesystem": "^5.4 || ^6.0 || ^7.0", + "symfony/finder": "^5.4 || ^6.0 || ^7.0", + "symfony/options-resolver": "^5.4 || ^6.0 || ^7.0", + "symfony/polyfill-mbstring": "^1.28", + "symfony/polyfill-php80": "^1.28", + "symfony/polyfill-php81": "^1.28", + "symfony/process": "^5.4 || ^6.0 || ^7.0", + "symfony/stopwatch": "^5.4 || ^6.0 || ^7.0" }, "require-dev": { - "johnkary/phpunit-speedtrap": "^1.1 || ^2.0 || ^3.0", - "justinrainbow/json-schema": "^5.0", - "keradus/cli-executor": "^1.2", - "mikey179/vfsstream": "^1.6", - "php-coveralls/php-coveralls": "^2.1", - "php-cs-fixer/accessible-object": "^1.0", - "php-cs-fixer/phpunit-constraint-isidenticalstring": "^1.1", - "php-cs-fixer/phpunit-constraint-xmlmatchesxsd": "^1.1", - "phpunit/phpunit": "^5.7.27 || ^6.5.8 || ^7.1", - "phpunitgoodpractices/traits": "^1.8", - "symfony/phpunit-bridge": "^4.3" + "facile-it/paraunit": "^1.3.1 || ^2.4", + "infection/infection": "^0.29.8", + "justinrainbow/json-schema": "^5.3 || ^6.0", + "keradus/cli-executor": "^2.1", + "mikey179/vfsstream": "^1.6.12", + "php-coveralls/php-coveralls": "^2.7", + "php-cs-fixer/accessible-object": "^1.1", + "php-cs-fixer/phpunit-constraint-isidenticalstring": "^1.5", + "php-cs-fixer/phpunit-constraint-xmlmatchesxsd": "^1.5", + "phpunit/phpunit": "^9.6.21 || ^10.5.38 || ^11.4.3", + "symfony/var-dumper": "^5.4.47 || ^6.4.15 || ^7.1.8", + "symfony/yaml": "^5.4.45 || ^6.4.13 || ^7.1.6" }, "suggest": { - "ext-mbstring": "For handling non-UTF8 characters in cache signature.", - "php-cs-fixer/phpunit-constraint-isidenticalstring": "For IsIdenticalString constraint.", - "php-cs-fixer/phpunit-constraint-xmlmatchesxsd": "For XmlMatchesXsd constraint.", - "symfony/polyfill-mbstring": "When enabling `ext-mbstring` is not possible." + "ext-dom": "For handling output formats in XML", + "ext-mbstring": "For handling non-UTF8 characters." }, "bin": [ "php-cs-fixer" @@ -403,16 +520,8 @@ "psr-4": { "PhpCsFixer\\": "src/" }, - "classmap": [ - "tests/Test/AbstractFixerTestCase.php", - "tests/Test/AbstractIntegrationCaseFactory.php", - "tests/Test/AbstractIntegrationTestCase.php", - "tests/Test/Assert/AssertTokensTrait.php", - "tests/Test/IntegrationCase.php", - "tests/Test/IntegrationCaseFactory.php", - "tests/Test/IntegrationCaseFactoryInterface.php", - "tests/Test/InternalIntegrationCaseFactory.php", - "tests/TestCase.php" + "exclude-from-classmap": [ + "src/Fixer/Internal/*" ] }, "notification-url": "https://packagist.org/downloads/", @@ -430,51 +539,69 @@ } ], "description": "A tool to automatically fix PHP code style", - "time": "2019-08-27T16:03:01+00:00" + "keywords": [ + "Static code analysis", + "fixer", + "standards", + "static analysis" + ], + "support": { + "issues": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues", + "source": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/tree/v3.65.0" + }, + "funding": [ + { + "url": "https://github.com/keradus", + "type": "github" + } + ], + "time": "2024-11-25T00:39:24+00:00" }, { "name": "giorgiosironi/eris", - "version": "0.9.0", + "version": "1.0.0", "source": { "type": "git", "url": "https://github.com/giorgiosironi/eris.git", - "reference": "538bbdaeb5679d094a33864fd54f85d6a4ffaa74" + "reference": "ffc757f08710b2b8fb1b30cff7b1cf48f5aba11d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/giorgiosironi/eris/zipball/538bbdaeb5679d094a33864fd54f85d6a4ffaa74", - "reference": "538bbdaeb5679d094a33864fd54f85d6a4ffaa74", + "url": "https://api.github.com/repos/giorgiosironi/eris/zipball/ffc757f08710b2b8fb1b30cff7b1cf48f5aba11d", + "reference": "ffc757f08710b2b8fb1b30cff7b1cf48f5aba11d", "shasum": "" }, "require": { - "php": ">=5.5", - "phpunit/phpunit": ">4,<7" + "php": "^8.1" }, "require-dev": { - "fabpot/php-cs-fixer": "^1.11.2", - "icomefromthenet/reverse-regex": "v0.0.6.3" + "friendsofphp/php-cs-fixer": "^3.0", + "ilario-pierbattista/reverse-regex": "^0.4.0", + "phpstan/phpstan": "^1.10", + "phpunit/phpunit": "^10.0.4", + "psalm/phar": "^5.4", + "rector/rector": "^0.18", + "sebastian/comparator": ">=2.1.3" }, "suggest": { - "icomefromthenet/reverse-regex": "v0.0.6.3 for the regex() Generator" + "icomefromthenet/reverse-regex": "v0.0.6.3 for the regex() Generator", + "ilario-pierbattista/reverse-regex": "0.3.1 for the regex() Generator (alternative to icomefromthenet/reverse-regex) ", + "phpunit/phpunit": "Standard way to run generated test cases" }, "type": "library", "autoload": { - "psr-4": { - "Eris\\": "src/" - }, "files": [ "src/Generator/functions.php" - ] + ], + "psr-4": { + "Eris\\": "src/" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], "authors": [ - { - "name": "Gabriele Lana", - "email": "gabriele.lana@gmail.com" - }, { "name": "Giorgio Sironi", "email": "info@giorgiosironi.com" @@ -482,44 +609,54 @@ { "name": "Mirko Bonadei", "email": "mirko.bonadei@gmail.com" + }, + { + "name": "Gabriele Lana", + "email": "gabriele.lana@gmail.com" } ], "description": "PHP library for property-based testing. Integrates with PHPUnit.", - "time": "2017-03-12T17:39:53+00:00" + "support": { + "issues": "https://github.com/giorgiosironi/eris/issues", + "source": "https://github.com/giorgiosironi/eris/tree/1.0.0" + }, + "time": "2024-12-07T08:21:20+00:00" }, { "name": "myclabs/deep-copy", - "version": "1.9.3", + "version": "1.12.1", "source": { "type": "git", "url": "https://github.com/myclabs/DeepCopy.git", - "reference": "007c053ae6f31bba39dfa19a7726f56e9763bbea" + "reference": "123267b2c49fbf30d78a7b2d333f6be754b94845" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/007c053ae6f31bba39dfa19a7726f56e9763bbea", - "reference": "007c053ae6f31bba39dfa19a7726f56e9763bbea", + "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/123267b2c49fbf30d78a7b2d333f6be754b94845", + "reference": "123267b2c49fbf30d78a7b2d333f6be754b94845", "shasum": "" }, "require": { - "php": "^7.1" + "php": "^7.1 || ^8.0" }, - "replace": { - "myclabs/deep-copy": "self.version" + "conflict": { + "doctrine/collections": "<1.6.8", + "doctrine/common": "<2.13.3 || >=3 <3.2.2" }, "require-dev": { - "doctrine/collections": "^1.0", - "doctrine/common": "^2.6", - "phpunit/phpunit": "^7.1" + "doctrine/collections": "^1.6.8", + "doctrine/common": "^2.13.3 || ^3.2.2", + "phpspec/prophecy": "^1.10", + "phpunit/phpunit": "^7.5.20 || ^8.5.23 || ^9.5.13" }, "type": "library", "autoload": { - "psr-4": { - "DeepCopy\\": "src/DeepCopy/" - }, "files": [ "src/DeepCopy/deep_copy.php" - ] + ], + "psr-4": { + "DeepCopy\\": "src/DeepCopy/" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -533,77 +670,102 @@ "object", "object graph" ], - "time": "2019-08-09T12:45:53+00:00" + "support": { + "issues": "https://github.com/myclabs/DeepCopy/issues", + "source": "https://github.com/myclabs/DeepCopy/tree/1.12.1" + }, + "funding": [ + { + "url": "https://tidelift.com/funding/github/packagist/myclabs/deep-copy", + "type": "tidelift" + } + ], + "time": "2024-11-08T17:47:46+00:00" }, { - "name": "paragonie/random_compat", - "version": "v9.99.99", + "name": "nikic/php-parser", + "version": "v5.3.1", "source": { "type": "git", - "url": "https://github.com/paragonie/random_compat.git", - "reference": "84b4dfb120c6f9b4ff7b3685f9b8f1aa365a0c95" + "url": "https://github.com/nikic/PHP-Parser.git", + "reference": "8eea230464783aa9671db8eea6f8c6ac5285794b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/paragonie/random_compat/zipball/84b4dfb120c6f9b4ff7b3685f9b8f1aa365a0c95", - "reference": "84b4dfb120c6f9b4ff7b3685f9b8f1aa365a0c95", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/8eea230464783aa9671db8eea6f8c6ac5285794b", + "reference": "8eea230464783aa9671db8eea6f8c6ac5285794b", "shasum": "" }, "require": { - "php": "^7" + "ext-ctype": "*", + "ext-json": "*", + "ext-tokenizer": "*", + "php": ">=7.4" }, "require-dev": { - "phpunit/phpunit": "4.*|5.*", - "vimeo/psalm": "^1" - }, - "suggest": { - "ext-libsodium": "Provides a modern crypto API that can be used to generate random bytes." + "ircmaxell/php-yacc": "^0.0.7", + "phpunit/phpunit": "^9.0" }, + "bin": [ + "bin/php-parse" + ], "type": "library", + "extra": { + "branch-alias": { + "dev-master": "5.0-dev" + } + }, + "autoload": { + "psr-4": { + "PhpParser\\": "lib/PhpParser" + } + }, "notification-url": "https://packagist.org/downloads/", "license": [ - "MIT" + "BSD-3-Clause" ], "authors": [ { - "name": "Paragon Initiative Enterprises", - "email": "security@paragonie.com", - "homepage": "https://paragonie.com" + "name": "Nikita Popov" } ], - "description": "PHP 5.x polyfill for random_bytes() and random_int() from PHP 7", + "description": "A PHP parser written in PHP", "keywords": [ - "csprng", - "polyfill", - "pseudorandom", - "random" + "parser", + "php" ], - "time": "2018-07-02T15:55:56+00:00" + "support": { + "issues": "https://github.com/nikic/PHP-Parser/issues", + "source": "https://github.com/nikic/PHP-Parser/tree/v5.3.1" + }, + "time": "2024-10-08T18:51:32+00:00" }, { "name": "phar-io/manifest", - "version": "1.0.1", + "version": "2.0.4", "source": { "type": "git", "url": "https://github.com/phar-io/manifest.git", - "reference": "2df402786ab5368a0169091f61a7c1e0eb6852d0" + "reference": "54750ef60c58e43759730615a392c31c80e23176" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phar-io/manifest/zipball/2df402786ab5368a0169091f61a7c1e0eb6852d0", - "reference": "2df402786ab5368a0169091f61a7c1e0eb6852d0", + "url": "https://api.github.com/repos/phar-io/manifest/zipball/54750ef60c58e43759730615a392c31c80e23176", + "reference": "54750ef60c58e43759730615a392c31c80e23176", "shasum": "" }, "require": { "ext-dom": "*", + "ext-libxml": "*", "ext-phar": "*", - "phar-io/version": "^1.0.1", - "php": "^5.6 || ^7.0" + "ext-xmlwriter": "*", + "phar-io/version": "^3.0.1", + "php": "^7.2 || ^8.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0.x-dev" + "dev-master": "2.0.x-dev" } }, "autoload": { @@ -633,24 +795,34 @@ } ], "description": "Component for reading phar.io manifest information from a PHP Archive (PHAR)", - "time": "2017-03-05T18:14:27+00:00" + "support": { + "issues": "https://github.com/phar-io/manifest/issues", + "source": "https://github.com/phar-io/manifest/tree/2.0.4" + }, + "funding": [ + { + "url": "https://github.com/theseer", + "type": "github" + } + ], + "time": "2024-03-03T12:33:53+00:00" }, { "name": "phar-io/version", - "version": "1.0.1", + "version": "3.2.1", "source": { "type": "git", "url": "https://github.com/phar-io/version.git", - "reference": "a70c0ced4be299a63d32fa96d9281d03e94041df" + "reference": "4f7fd7836c6f332bb2933569e566a0d6c4cbed74" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phar-io/version/zipball/a70c0ced4be299a63d32fa96d9281d03e94041df", - "reference": "a70c0ced4be299a63d32fa96d9281d03e94041df", + "url": "https://api.github.com/repos/phar-io/version/zipball/4f7fd7836c6f332bb2933569e566a0d6c4cbed74", + "reference": "4f7fd7836c6f332bb2933569e566a0d6c4cbed74", "shasum": "" }, "require": { - "php": "^5.6 || ^7.0" + "php": "^7.2 || ^8.0" }, "type": "library", "autoload": { @@ -680,30 +852,54 @@ } ], "description": "Library for handling version information and constraints", - "time": "2017-03-05T17:38:23+00:00" + "support": { + "issues": "https://github.com/phar-io/version/issues", + "source": "https://github.com/phar-io/version/tree/3.2.1" + }, + "time": "2022-02-21T01:04:05+00:00" }, { - "name": "php-cs-fixer/diff", - "version": "v1.3.0", + "name": "phpunit/php-code-coverage", + "version": "11.0.8", "source": { "type": "git", - "url": "https://github.com/PHP-CS-Fixer/diff.git", - "reference": "78bb099e9c16361126c86ce82ec4405ebab8e756" + "url": "https://github.com/sebastianbergmann/php-code-coverage.git", + "reference": "418c59fd080954f8c4aa5631d9502ecda2387118" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHP-CS-Fixer/diff/zipball/78bb099e9c16361126c86ce82ec4405ebab8e756", - "reference": "78bb099e9c16361126c86ce82ec4405ebab8e756", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/418c59fd080954f8c4aa5631d9502ecda2387118", + "reference": "418c59fd080954f8c4aa5631d9502ecda2387118", "shasum": "" }, "require": { - "php": "^5.6 || ^7.0" + "ext-dom": "*", + "ext-libxml": "*", + "ext-xmlwriter": "*", + "nikic/php-parser": "^5.3.1", + "php": ">=8.2", + "phpunit/php-file-iterator": "^5.1.0", + "phpunit/php-text-template": "^4.0.1", + "sebastian/code-unit-reverse-lookup": "^4.0.1", + "sebastian/complexity": "^4.0.1", + "sebastian/environment": "^7.2.0", + "sebastian/lines-of-code": "^3.0.1", + "sebastian/version": "^5.0.2", + "theseer/tokenizer": "^1.2.3" }, "require-dev": { - "phpunit/phpunit": "^5.7.23 || ^6.4.3", - "symfony/process": "^3.3" + "phpunit/phpunit": "^11.5.0" + }, + "suggest": { + "ext-pcov": "PHP extension that provides line coverage", + "ext-xdebug": "PHP extension that provides line coverage as well as branch and path coverage" }, "type": "library", + "extra": { + "branch-alias": { + "dev-main": "11.0.x-dev" + } + }, "autoload": { "classmap": [ "src/" @@ -714,279 +910,335 @@ "BSD-3-Clause" ], "authors": [ - { - "name": "Kore Nordmann", - "email": "mail@kore-nordmann.de" - }, { "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - }, - { - "name": "SpacePossum" + "email": "sebastian@phpunit.de", + "role": "lead" } ], - "description": "sebastian/diff v2 backport support for PHP5.6", - "homepage": "https://github.com/PHP-CS-Fixer", + "description": "Library that provides collection, processing, and rendering functionality for PHP code coverage information.", + "homepage": "https://github.com/sebastianbergmann/php-code-coverage", "keywords": [ - "diff" + "coverage", + "testing", + "xunit" ], - "time": "2018-02-15T16:58:55+00:00" + "support": { + "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues", + "security": "https://github.com/sebastianbergmann/php-code-coverage/security/policy", + "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/11.0.8" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2024-12-11T12:34:27+00:00" }, { - "name": "phpdocumentor/reflection-common", - "version": "1.0.1", + "name": "phpunit/php-file-iterator", + "version": "5.1.0", "source": { "type": "git", - "url": "https://github.com/phpDocumentor/ReflectionCommon.git", - "reference": "21bdeb5f65d7ebf9f43b1b25d404f87deab5bfb6" + "url": "https://github.com/sebastianbergmann/php-file-iterator.git", + "reference": "118cfaaa8bc5aef3287bf315b6060b1174754af6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/21bdeb5f65d7ebf9f43b1b25d404f87deab5bfb6", - "reference": "21bdeb5f65d7ebf9f43b1b25d404f87deab5bfb6", + "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/118cfaaa8bc5aef3287bf315b6060b1174754af6", + "reference": "118cfaaa8bc5aef3287bf315b6060b1174754af6", "shasum": "" }, "require": { - "php": ">=5.5" + "php": ">=8.2" }, "require-dev": { - "phpunit/phpunit": "^4.6" + "phpunit/phpunit": "^11.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0.x-dev" + "dev-main": "5.0-dev" } }, "autoload": { - "psr-4": { - "phpDocumentor\\Reflection\\": [ - "src" - ] - } + "classmap": [ + "src/" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ - "MIT" + "BSD-3-Clause" ], "authors": [ { - "name": "Jaap van Otterdijk", - "email": "opensource@ijaap.nl" + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" } ], - "description": "Common reflection classes used by phpdocumentor to reflect the code structure", - "homepage": "http://www.phpdoc.org", + "description": "FilterIterator implementation that filters files based on a list of suffixes.", + "homepage": "https://github.com/sebastianbergmann/php-file-iterator/", "keywords": [ - "FQSEN", - "phpDocumentor", - "phpdoc", - "reflection", - "static analysis" + "filesystem", + "iterator" ], - "time": "2017-09-11T18:02:19+00:00" + "support": { + "issues": "https://github.com/sebastianbergmann/php-file-iterator/issues", + "security": "https://github.com/sebastianbergmann/php-file-iterator/security/policy", + "source": "https://github.com/sebastianbergmann/php-file-iterator/tree/5.1.0" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2024-08-27T05:02:59+00:00" }, { - "name": "phpdocumentor/reflection-docblock", - "version": "4.3.1", + "name": "phpunit/php-invoker", + "version": "5.0.1", "source": { "type": "git", - "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", - "reference": "bdd9f737ebc2a01c06ea7ff4308ec6697db9b53c" + "url": "https://github.com/sebastianbergmann/php-invoker.git", + "reference": "c1ca3814734c07492b3d4c5f794f4b0995333da2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/bdd9f737ebc2a01c06ea7ff4308ec6697db9b53c", - "reference": "bdd9f737ebc2a01c06ea7ff4308ec6697db9b53c", + "url": "https://api.github.com/repos/sebastianbergmann/php-invoker/zipball/c1ca3814734c07492b3d4c5f794f4b0995333da2", + "reference": "c1ca3814734c07492b3d4c5f794f4b0995333da2", "shasum": "" }, "require": { - "php": "^7.0", - "phpdocumentor/reflection-common": "^1.0.0", - "phpdocumentor/type-resolver": "^0.4.0", - "webmozart/assert": "^1.0" + "php": ">=8.2" }, "require-dev": { - "doctrine/instantiator": "~1.0.5", - "mockery/mockery": "^1.0", - "phpunit/phpunit": "^6.4" + "ext-pcntl": "*", + "phpunit/phpunit": "^11.0" + }, + "suggest": { + "ext-pcntl": "*" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "4.x-dev" + "dev-main": "5.0-dev" } }, "autoload": { - "psr-4": { - "phpDocumentor\\Reflection\\": [ - "src/" - ] - } + "classmap": [ + "src/" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ - "MIT" + "BSD-3-Clause" ], "authors": [ { - "name": "Mike van Riel", - "email": "me@mikevanriel.com" + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Invoke callables with a timeout", + "homepage": "https://github.com/sebastianbergmann/php-invoker/", + "keywords": [ + "process" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/php-invoker/issues", + "security": "https://github.com/sebastianbergmann/php-invoker/security/policy", + "source": "https://github.com/sebastianbergmann/php-invoker/tree/5.0.1" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" } ], - "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.", - "time": "2019-04-30T17:48:53+00:00" + "time": "2024-07-03T05:07:44+00:00" }, { - "name": "phpdocumentor/type-resolver", - "version": "0.4.0", + "name": "phpunit/php-text-template", + "version": "4.0.1", "source": { "type": "git", - "url": "https://github.com/phpDocumentor/TypeResolver.git", - "reference": "9c977708995954784726e25d0cd1dddf4e65b0f7" + "url": "https://github.com/sebastianbergmann/php-text-template.git", + "reference": "3e0404dc6b300e6bf56415467ebcb3fe4f33e964" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/9c977708995954784726e25d0cd1dddf4e65b0f7", - "reference": "9c977708995954784726e25d0cd1dddf4e65b0f7", + "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/3e0404dc6b300e6bf56415467ebcb3fe4f33e964", + "reference": "3e0404dc6b300e6bf56415467ebcb3fe4f33e964", "shasum": "" }, "require": { - "php": "^5.5 || ^7.0", - "phpdocumentor/reflection-common": "^1.0" + "php": ">=8.2" }, "require-dev": { - "mockery/mockery": "^0.9.4", - "phpunit/phpunit": "^5.2||^4.8.24" + "phpunit/phpunit": "^11.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0.x-dev" + "dev-main": "4.0-dev" } }, "autoload": { - "psr-4": { - "phpDocumentor\\Reflection\\": [ - "src/" - ] - } + "classmap": [ + "src/" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ - "MIT" + "BSD-3-Clause" ], "authors": [ { - "name": "Mike van Riel", - "email": "me@mikevanriel.com" + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Simple template engine.", + "homepage": "https://github.com/sebastianbergmann/php-text-template/", + "keywords": [ + "template" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/php-text-template/issues", + "security": "https://github.com/sebastianbergmann/php-text-template/security/policy", + "source": "https://github.com/sebastianbergmann/php-text-template/tree/4.0.1" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" } ], - "time": "2017-07-14T14:27:02+00:00" + "time": "2024-07-03T05:08:43+00:00" }, { - "name": "phpspec/prophecy", - "version": "1.8.1", + "name": "phpunit/php-timer", + "version": "7.0.1", "source": { "type": "git", - "url": "https://github.com/phpspec/prophecy.git", - "reference": "1927e75f4ed19131ec9bcc3b002e07fb1173ee76" + "url": "https://github.com/sebastianbergmann/php-timer.git", + "reference": "3b415def83fbcb41f991d9ebf16ae4ad8b7837b3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpspec/prophecy/zipball/1927e75f4ed19131ec9bcc3b002e07fb1173ee76", - "reference": "1927e75f4ed19131ec9bcc3b002e07fb1173ee76", + "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/3b415def83fbcb41f991d9ebf16ae4ad8b7837b3", + "reference": "3b415def83fbcb41f991d9ebf16ae4ad8b7837b3", "shasum": "" }, "require": { - "doctrine/instantiator": "^1.0.2", - "php": "^5.3|^7.0", - "phpdocumentor/reflection-docblock": "^2.0|^3.0.2|^4.0", - "sebastian/comparator": "^1.1|^2.0|^3.0", - "sebastian/recursion-context": "^1.0|^2.0|^3.0" + "php": ">=8.2" }, "require-dev": { - "phpspec/phpspec": "^2.5|^3.2", - "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.5 || ^7.1" + "phpunit/phpunit": "^11.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.8.x-dev" + "dev-main": "7.0-dev" } }, "autoload": { - "psr-4": { - "Prophecy\\": "src/Prophecy" - } + "classmap": [ + "src/" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ - "MIT" + "BSD-3-Clause" ], "authors": [ { - "name": "Konstantin Kudryashov", - "email": "ever.zet@gmail.com", - "homepage": "http://everzet.com" - }, - { - "name": "Marcello Duarte", - "email": "marcello.duarte@gmail.com" + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" } ], - "description": "Highly opinionated mocking framework for PHP 5.3+", - "homepage": "https://github.com/phpspec/prophecy", + "description": "Utility class for timing", + "homepage": "https://github.com/sebastianbergmann/php-timer/", "keywords": [ - "Double", - "Dummy", - "fake", - "mock", - "spy", - "stub" - ], - "time": "2019-06-13T12:50:23+00:00" + "timer" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/php-timer/issues", + "security": "https://github.com/sebastianbergmann/php-timer/security/policy", + "source": "https://github.com/sebastianbergmann/php-timer/tree/7.0.1" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2024-07-03T05:09:35+00:00" }, { - "name": "phpunit/php-code-coverage", - "version": "5.3.2", + "name": "phpunit/phpunit", + "version": "11.5.1", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "c89677919c5dd6d3b3852f230a663118762218ac" + "url": "https://github.com/sebastianbergmann/phpunit.git", + "reference": "2b94d4f2450b9869fa64a46fd8a6a41997aef56a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/c89677919c5dd6d3b3852f230a663118762218ac", - "reference": "c89677919c5dd6d3b3852f230a663118762218ac", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/2b94d4f2450b9869fa64a46fd8a6a41997aef56a", + "reference": "2b94d4f2450b9869fa64a46fd8a6a41997aef56a", "shasum": "" }, "require": { "ext-dom": "*", + "ext-json": "*", + "ext-libxml": "*", + "ext-mbstring": "*", + "ext-xml": "*", "ext-xmlwriter": "*", - "php": "^7.0", - "phpunit/php-file-iterator": "^1.4.2", - "phpunit/php-text-template": "^1.2.1", - "phpunit/php-token-stream": "^2.0.1", - "sebastian/code-unit-reverse-lookup": "^1.0.1", - "sebastian/environment": "^3.0", - "sebastian/version": "^2.0.1", - "theseer/tokenizer": "^1.1" - }, - "require-dev": { - "phpunit/phpunit": "^6.0" + "myclabs/deep-copy": "^1.12.1", + "phar-io/manifest": "^2.0.4", + "phar-io/version": "^3.2.1", + "php": ">=8.2", + "phpunit/php-code-coverage": "^11.0.7", + "phpunit/php-file-iterator": "^5.1.0", + "phpunit/php-invoker": "^5.0.1", + "phpunit/php-text-template": "^4.0.1", + "phpunit/php-timer": "^7.0.1", + "sebastian/cli-parser": "^3.0.2", + "sebastian/code-unit": "^3.0.1", + "sebastian/comparator": "^6.2.1", + "sebastian/diff": "^6.0.2", + "sebastian/environment": "^7.2.0", + "sebastian/exporter": "^6.3.0", + "sebastian/global-state": "^7.0.2", + "sebastian/object-enumerator": "^6.0.1", + "sebastian/type": "^5.1.0", + "sebastian/version": "^5.0.2", + "staabm/side-effects-detector": "^1.0.5" }, "suggest": { - "ext-xdebug": "^2.5.5" + "ext-soap": "To be able to generate mocks based on WSDL files" }, + "bin": [ + "phpunit" + ], "type": "library", "extra": { "branch-alias": { - "dev-master": "5.3.x-dev" + "dev-main": "11.5-dev" } }, "autoload": { + "files": [ + "src/Framework/Assert/Functions.php" + ], "classmap": [ "src/" ] @@ -998,375 +1250,670 @@ "authors": [ { "name": "Sebastian Bergmann", - "role": "lead", - "email": "sebastian@phpunit.de" + "email": "sebastian@phpunit.de", + "role": "lead" } ], - "description": "Library that provides collection, processing, and rendering functionality for PHP code coverage information.", - "homepage": "https://github.com/sebastianbergmann/php-code-coverage", + "description": "The PHP Unit Testing framework.", + "homepage": "https://phpunit.de/", "keywords": [ - "coverage", + "phpunit", "testing", "xunit" ], - "time": "2018-04-06T15:36:58+00:00" + "support": { + "issues": "https://github.com/sebastianbergmann/phpunit/issues", + "security": "https://github.com/sebastianbergmann/phpunit/security/policy", + "source": "https://github.com/sebastianbergmann/phpunit/tree/11.5.1" + }, + "funding": [ + { + "url": "https://phpunit.de/sponsors.html", + "type": "custom" + }, + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/phpunit/phpunit", + "type": "tidelift" + } + ], + "time": "2024-12-11T10:52:48+00:00" }, { - "name": "phpunit/php-file-iterator", - "version": "1.4.5", + "name": "psr/container", + "version": "2.0.2", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/php-file-iterator.git", - "reference": "730b01bc3e867237eaac355e06a36b85dd93a8b4" + "url": "https://github.com/php-fig/container.git", + "reference": "c71ecc56dfe541dbd90c5360474fbc405f8d5963" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/730b01bc3e867237eaac355e06a36b85dd93a8b4", - "reference": "730b01bc3e867237eaac355e06a36b85dd93a8b4", + "url": "https://api.github.com/repos/php-fig/container/zipball/c71ecc56dfe541dbd90c5360474fbc405f8d5963", + "reference": "c71ecc56dfe541dbd90c5360474fbc405f8d5963", "shasum": "" }, "require": { - "php": ">=5.3.3" + "php": ">=7.4.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.4.x-dev" + "dev-master": "2.0.x-dev" } }, "autoload": { - "classmap": [ - "src/" - ] + "psr-4": { + "Psr\\Container\\": "src/" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ - "BSD-3-Clause" + "MIT" ], "authors": [ { - "name": "Sebastian Bergmann", - "email": "sb@sebastian-bergmann.de", - "role": "lead" + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" } ], - "description": "FilterIterator implementation that filters files based on a list of suffixes.", - "homepage": "https://github.com/sebastianbergmann/php-file-iterator/", + "description": "Common Container Interface (PHP FIG PSR-11)", + "homepage": "https://github.com/php-fig/container", "keywords": [ - "filesystem", - "iterator" + "PSR-11", + "container", + "container-interface", + "container-interop", + "psr" ], - "time": "2017-11-27T13:52:08+00:00" + "support": { + "issues": "https://github.com/php-fig/container/issues", + "source": "https://github.com/php-fig/container/tree/2.0.2" + }, + "time": "2021-11-05T16:47:00+00:00" }, { - "name": "phpunit/php-text-template", - "version": "1.2.1", + "name": "psr/event-dispatcher", + "version": "1.0.0", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/php-text-template.git", - "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686" + "url": "https://github.com/php-fig/event-dispatcher.git", + "reference": "dbefd12671e8a14ec7f180cab83036ed26714bb0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/31f8b717e51d9a2afca6c9f046f5d69fc27c8686", - "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686", + "url": "https://api.github.com/repos/php-fig/event-dispatcher/zipball/dbefd12671e8a14ec7f180cab83036ed26714bb0", + "reference": "dbefd12671e8a14ec7f180cab83036ed26714bb0", "shasum": "" }, "require": { - "php": ">=5.3.3" + "php": ">=7.2.0" }, "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, "autoload": { - "classmap": [ - "src/" - ] + "psr-4": { + "Psr\\EventDispatcher\\": "src/" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ - "BSD-3-Clause" + "MIT" ], "authors": [ { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" } ], - "description": "Simple template engine.", - "homepage": "https://github.com/sebastianbergmann/php-text-template/", + "description": "Standard interfaces for event handling.", "keywords": [ - "template" + "events", + "psr", + "psr-14" ], - "time": "2015-06-21T13:50:34+00:00" + "support": { + "issues": "https://github.com/php-fig/event-dispatcher/issues", + "source": "https://github.com/php-fig/event-dispatcher/tree/1.0.0" + }, + "time": "2019-01-08T18:20:26+00:00" }, { - "name": "phpunit/php-timer", - "version": "1.0.9", + "name": "psr/log", + "version": "3.0.2", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/php-timer.git", - "reference": "3dcf38ca72b158baf0bc245e9184d3fdffa9c46f" + "url": "https://github.com/php-fig/log.git", + "reference": "f16e1d5863e37f8d8c2a01719f5b34baa2b714d3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/3dcf38ca72b158baf0bc245e9184d3fdffa9c46f", - "reference": "3dcf38ca72b158baf0bc245e9184d3fdffa9c46f", + "url": "https://api.github.com/repos/php-fig/log/zipball/f16e1d5863e37f8d8c2a01719f5b34baa2b714d3", + "reference": "f16e1d5863e37f8d8c2a01719f5b34baa2b714d3", "shasum": "" }, "require": { - "php": "^5.3.3 || ^7.0" - }, - "require-dev": { - "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0" + "php": ">=8.0.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0-dev" + "dev-master": "3.x-dev" } }, "autoload": { - "classmap": [ - "src/" - ] + "psr-4": { + "Psr\\Log\\": "src" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ - "BSD-3-Clause" + "MIT" ], "authors": [ { - "name": "Sebastian Bergmann", - "email": "sb@sebastian-bergmann.de", - "role": "lead" + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" } ], - "description": "Utility class for timing", - "homepage": "https://github.com/sebastianbergmann/php-timer/", + "description": "Common interface for logging libraries", + "homepage": "https://github.com/php-fig/log", "keywords": [ - "timer" + "log", + "psr", + "psr-3" ], - "time": "2017-02-26T11:10:40+00:00" + "support": { + "source": "https://github.com/php-fig/log/tree/3.0.2" + }, + "time": "2024-09-11T13:17:53+00:00" }, { - "name": "phpunit/php-token-stream", - "version": "2.0.2", + "name": "react/cache", + "version": "v1.2.0", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/php-token-stream.git", - "reference": "791198a2c6254db10131eecfe8c06670700904db" + "url": "https://github.com/reactphp/cache.git", + "reference": "d47c472b64aa5608225f47965a484b75c7817d5b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/791198a2c6254db10131eecfe8c06670700904db", - "reference": "791198a2c6254db10131eecfe8c06670700904db", + "url": "https://api.github.com/repos/reactphp/cache/zipball/d47c472b64aa5608225f47965a484b75c7817d5b", + "reference": "d47c472b64aa5608225f47965a484b75c7817d5b", "shasum": "" }, "require": { - "ext-tokenizer": "*", - "php": "^7.0" + "php": ">=5.3.0", + "react/promise": "^3.0 || ^2.0 || ^1.1" }, "require-dev": { - "phpunit/phpunit": "^6.2.4" + "phpunit/phpunit": "^9.5 || ^5.7 || ^4.8.35" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.0-dev" - } - }, "autoload": { - "classmap": [ - "src/" - ] + "psr-4": { + "React\\Cache\\": "src/" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ - "BSD-3-Clause" + "MIT" ], "authors": [ { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" + "name": "Christian Lück", + "email": "christian@clue.engineering", + "homepage": "https://clue.engineering/" + }, + { + "name": "Cees-Jan Kiewiet", + "email": "reactphp@ceesjankiewiet.nl", + "homepage": "https://wyrihaximus.net/" + }, + { + "name": "Jan Sorgalla", + "email": "jsorgalla@gmail.com", + "homepage": "https://sorgalla.com/" + }, + { + "name": "Chris Boden", + "email": "cboden@gmail.com", + "homepage": "https://cboden.dev/" } ], - "description": "Wrapper around PHP's tokenizer extension.", - "homepage": "https://github.com/sebastianbergmann/php-token-stream/", + "description": "Async, Promise-based cache interface for ReactPHP", "keywords": [ - "tokenizer" + "cache", + "caching", + "promise", + "reactphp" ], - "time": "2017-11-27T05:48:46+00:00" + "support": { + "issues": "https://github.com/reactphp/cache/issues", + "source": "https://github.com/reactphp/cache/tree/v1.2.0" + }, + "funding": [ + { + "url": "https://opencollective.com/reactphp", + "type": "open_collective" + } + ], + "time": "2022-11-30T15:59:55+00:00" }, { - "name": "phpunit/phpunit", - "version": "6.5.14", + "name": "react/child-process", + "version": "v0.6.5", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "bac23fe7ff13dbdb461481f706f0e9fe746334b7" + "url": "https://github.com/reactphp/child-process.git", + "reference": "e71eb1aa55f057c7a4a0d08d06b0b0a484bead43" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/bac23fe7ff13dbdb461481f706f0e9fe746334b7", - "reference": "bac23fe7ff13dbdb461481f706f0e9fe746334b7", + "url": "https://api.github.com/repos/reactphp/child-process/zipball/e71eb1aa55f057c7a4a0d08d06b0b0a484bead43", + "reference": "e71eb1aa55f057c7a4a0d08d06b0b0a484bead43", "shasum": "" }, "require": { - "ext-dom": "*", - "ext-json": "*", - "ext-libxml": "*", - "ext-mbstring": "*", - "ext-xml": "*", - "myclabs/deep-copy": "^1.6.1", - "phar-io/manifest": "^1.0.1", - "phar-io/version": "^1.0", - "php": "^7.0", - "phpspec/prophecy": "^1.7", - "phpunit/php-code-coverage": "^5.3", - "phpunit/php-file-iterator": "^1.4.3", - "phpunit/php-text-template": "^1.2.1", - "phpunit/php-timer": "^1.0.9", - "phpunit/phpunit-mock-objects": "^5.0.9", - "sebastian/comparator": "^2.1", - "sebastian/diff": "^2.0", - "sebastian/environment": "^3.1", - "sebastian/exporter": "^3.1", - "sebastian/global-state": "^2.0", - "sebastian/object-enumerator": "^3.0.3", - "sebastian/resource-operations": "^1.0", - "sebastian/version": "^2.0.1" - }, - "conflict": { - "phpdocumentor/reflection-docblock": "3.0.2", - "phpunit/dbunit": "<3.0" + "evenement/evenement": "^3.0 || ^2.0 || ^1.0", + "php": ">=5.3.0", + "react/event-loop": "^1.2", + "react/stream": "^1.2" }, "require-dev": { - "ext-pdo": "*" - }, - "suggest": { - "ext-xdebug": "*", - "phpunit/php-invoker": "^1.1" + "phpunit/phpunit": "^9.3 || ^5.7 || ^4.8.35", + "react/socket": "^1.8", + "sebastian/environment": "^5.0 || ^3.0 || ^2.0 || ^1.0" }, - "bin": [ - "phpunit" - ], "type": "library", - "extra": { - "branch-alias": { - "dev-master": "6.5.x-dev" - } - }, "autoload": { - "classmap": [ - "src/" - ] + "psr-4": { + "React\\ChildProcess\\": "src" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ - "BSD-3-Clause" + "MIT" ], "authors": [ { - "name": "Sebastian Bergmann", - "role": "lead", - "email": "sebastian@phpunit.de" + "name": "Christian Lück", + "email": "christian@clue.engineering", + "homepage": "https://clue.engineering/" + }, + { + "name": "Cees-Jan Kiewiet", + "email": "reactphp@ceesjankiewiet.nl", + "homepage": "https://wyrihaximus.net/" + }, + { + "name": "Jan Sorgalla", + "email": "jsorgalla@gmail.com", + "homepage": "https://sorgalla.com/" + }, + { + "name": "Chris Boden", + "email": "cboden@gmail.com", + "homepage": "https://cboden.dev/" } ], - "description": "The PHP Unit Testing framework.", - "homepage": "https://phpunit.de/", + "description": "Event-driven library for executing child processes with ReactPHP.", "keywords": [ - "phpunit", - "testing", - "xunit" + "event-driven", + "process", + "reactphp" ], - "time": "2019-02-01T05:22:47+00:00" + "support": { + "issues": "https://github.com/reactphp/child-process/issues", + "source": "https://github.com/reactphp/child-process/tree/v0.6.5" + }, + "funding": [ + { + "url": "https://github.com/WyriHaximus", + "type": "github" + }, + { + "url": "https://github.com/clue", + "type": "github" + } + ], + "time": "2022-09-16T13:41:56+00:00" }, { - "name": "phpunit/phpunit-mock-objects", - "version": "5.0.10", + "name": "react/dns", + "version": "v1.13.0", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/phpunit-mock-objects.git", - "reference": "cd1cf05c553ecfec36b170070573e540b67d3f1f" + "url": "https://github.com/reactphp/dns.git", + "reference": "eb8ae001b5a455665c89c1df97f6fb682f8fb0f5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/cd1cf05c553ecfec36b170070573e540b67d3f1f", - "reference": "cd1cf05c553ecfec36b170070573e540b67d3f1f", + "url": "https://api.github.com/repos/reactphp/dns/zipball/eb8ae001b5a455665c89c1df97f6fb682f8fb0f5", + "reference": "eb8ae001b5a455665c89c1df97f6fb682f8fb0f5", "shasum": "" }, "require": { - "doctrine/instantiator": "^1.0.5", - "php": "^7.0", - "phpunit/php-text-template": "^1.2.1", - "sebastian/exporter": "^3.1" + "php": ">=5.3.0", + "react/cache": "^1.0 || ^0.6 || ^0.5", + "react/event-loop": "^1.2", + "react/promise": "^3.2 || ^2.7 || ^1.2.1" }, - "conflict": { - "phpunit/phpunit": "<6.0" + "require-dev": { + "phpunit/phpunit": "^9.6 || ^5.7 || ^4.8.36", + "react/async": "^4.3 || ^3 || ^2", + "react/promise-timer": "^1.11" + }, + "type": "library", + "autoload": { + "psr-4": { + "React\\Dns\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Christian Lück", + "email": "christian@clue.engineering", + "homepage": "https://clue.engineering/" + }, + { + "name": "Cees-Jan Kiewiet", + "email": "reactphp@ceesjankiewiet.nl", + "homepage": "https://wyrihaximus.net/" + }, + { + "name": "Jan Sorgalla", + "email": "jsorgalla@gmail.com", + "homepage": "https://sorgalla.com/" + }, + { + "name": "Chris Boden", + "email": "cboden@gmail.com", + "homepage": "https://cboden.dev/" + } + ], + "description": "Async DNS resolver for ReactPHP", + "keywords": [ + "async", + "dns", + "dns-resolver", + "reactphp" + ], + "support": { + "issues": "https://github.com/reactphp/dns/issues", + "source": "https://github.com/reactphp/dns/tree/v1.13.0" + }, + "funding": [ + { + "url": "https://opencollective.com/reactphp", + "type": "open_collective" + } + ], + "time": "2024-06-13T14:18:03+00:00" + }, + { + "name": "react/event-loop", + "version": "v1.5.0", + "source": { + "type": "git", + "url": "https://github.com/reactphp/event-loop.git", + "reference": "bbe0bd8c51ffc05ee43f1729087ed3bdf7d53354" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/reactphp/event-loop/zipball/bbe0bd8c51ffc05ee43f1729087ed3bdf7d53354", + "reference": "bbe0bd8c51ffc05ee43f1729087ed3bdf7d53354", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" }, "require-dev": { - "phpunit/phpunit": "^6.5.11" + "phpunit/phpunit": "^9.6 || ^5.7 || ^4.8.36" }, "suggest": { - "ext-soap": "*" + "ext-pcntl": "For signal handling support when using the StreamSelectLoop" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "5.0.x-dev" + "autoload": { + "psr-4": { + "React\\EventLoop\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Christian Lück", + "email": "christian@clue.engineering", + "homepage": "https://clue.engineering/" + }, + { + "name": "Cees-Jan Kiewiet", + "email": "reactphp@ceesjankiewiet.nl", + "homepage": "https://wyrihaximus.net/" + }, + { + "name": "Jan Sorgalla", + "email": "jsorgalla@gmail.com", + "homepage": "https://sorgalla.com/" + }, + { + "name": "Chris Boden", + "email": "cboden@gmail.com", + "homepage": "https://cboden.dev/" } + ], + "description": "ReactPHP's core reactor event loop that libraries can use for evented I/O.", + "keywords": [ + "asynchronous", + "event-loop" + ], + "support": { + "issues": "https://github.com/reactphp/event-loop/issues", + "source": "https://github.com/reactphp/event-loop/tree/v1.5.0" + }, + "funding": [ + { + "url": "https://opencollective.com/reactphp", + "type": "open_collective" + } + ], + "time": "2023-11-13T13:48:05+00:00" + }, + { + "name": "react/promise", + "version": "v3.2.0", + "source": { + "type": "git", + "url": "https://github.com/reactphp/promise.git", + "reference": "8a164643313c71354582dc850b42b33fa12a4b63" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/reactphp/promise/zipball/8a164643313c71354582dc850b42b33fa12a4b63", + "reference": "8a164643313c71354582dc850b42b33fa12a4b63", + "shasum": "" + }, + "require": { + "php": ">=7.1.0" + }, + "require-dev": { + "phpstan/phpstan": "1.10.39 || 1.4.10", + "phpunit/phpunit": "^9.6 || ^7.5" }, + "type": "library", "autoload": { - "classmap": [ - "src/" - ] + "files": [ + "src/functions_include.php" + ], + "psr-4": { + "React\\Promise\\": "src/" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ - "BSD-3-Clause" + "MIT" ], "authors": [ { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" + "name": "Jan Sorgalla", + "email": "jsorgalla@gmail.com", + "homepage": "https://sorgalla.com/" + }, + { + "name": "Christian Lück", + "email": "christian@clue.engineering", + "homepage": "https://clue.engineering/" + }, + { + "name": "Cees-Jan Kiewiet", + "email": "reactphp@ceesjankiewiet.nl", + "homepage": "https://wyrihaximus.net/" + }, + { + "name": "Chris Boden", + "email": "cboden@gmail.com", + "homepage": "https://cboden.dev/" } ], - "description": "Mock Object library for PHPUnit", - "homepage": "https://github.com/sebastianbergmann/phpunit-mock-objects/", + "description": "A lightweight implementation of CommonJS Promises/A for PHP", "keywords": [ - "mock", - "xunit" + "promise", + "promises" + ], + "support": { + "issues": "https://github.com/reactphp/promise/issues", + "source": "https://github.com/reactphp/promise/tree/v3.2.0" + }, + "funding": [ + { + "url": "https://opencollective.com/reactphp", + "type": "open_collective" + } ], - "abandoned": true, - "time": "2018-08-09T05:50:03+00:00" + "time": "2024-05-24T10:39:05+00:00" }, { - "name": "psr/container", - "version": "1.0.0", + "name": "react/socket", + "version": "v1.16.0", "source": { "type": "git", - "url": "https://github.com/php-fig/container.git", - "reference": "b7ce3b176482dbbc1245ebf52b181af44c2cf55f" + "url": "https://github.com/reactphp/socket.git", + "reference": "23e4ff33ea3e160d2d1f59a0e6050e4b0fb0eac1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/container/zipball/b7ce3b176482dbbc1245ebf52b181af44c2cf55f", - "reference": "b7ce3b176482dbbc1245ebf52b181af44c2cf55f", + "url": "https://api.github.com/repos/reactphp/socket/zipball/23e4ff33ea3e160d2d1f59a0e6050e4b0fb0eac1", + "reference": "23e4ff33ea3e160d2d1f59a0e6050e4b0fb0eac1", "shasum": "" }, "require": { - "php": ">=5.3.0" + "evenement/evenement": "^3.0 || ^2.0 || ^1.0", + "php": ">=5.3.0", + "react/dns": "^1.13", + "react/event-loop": "^1.2", + "react/promise": "^3.2 || ^2.6 || ^1.2.1", + "react/stream": "^1.4" + }, + "require-dev": { + "phpunit/phpunit": "^9.6 || ^5.7 || ^4.8.36", + "react/async": "^4.3 || ^3.3 || ^2", + "react/promise-stream": "^1.4", + "react/promise-timer": "^1.11" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" + "autoload": { + "psr-4": { + "React\\Socket\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Christian Lück", + "email": "christian@clue.engineering", + "homepage": "https://clue.engineering/" + }, + { + "name": "Cees-Jan Kiewiet", + "email": "reactphp@ceesjankiewiet.nl", + "homepage": "https://wyrihaximus.net/" + }, + { + "name": "Jan Sorgalla", + "email": "jsorgalla@gmail.com", + "homepage": "https://sorgalla.com/" + }, + { + "name": "Chris Boden", + "email": "cboden@gmail.com", + "homepage": "https://cboden.dev/" + } + ], + "description": "Async, streaming plaintext TCP/IP and secure TLS socket server and client connections for ReactPHP", + "keywords": [ + "Connection", + "Socket", + "async", + "reactphp", + "stream" + ], + "support": { + "issues": "https://github.com/reactphp/socket/issues", + "source": "https://github.com/reactphp/socket/tree/v1.16.0" + }, + "funding": [ + { + "url": "https://opencollective.com/reactphp", + "type": "open_collective" } + ], + "time": "2024-07-26T10:38:09+00:00" + }, + { + "name": "react/stream", + "version": "v1.4.0", + "source": { + "type": "git", + "url": "https://github.com/reactphp/stream.git", + "reference": "1e5b0acb8fe55143b5b426817155190eb6f5b18d" }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/reactphp/stream/zipball/1e5b0acb8fe55143b5b426817155190eb6f5b18d", + "reference": "1e5b0acb8fe55143b5b426817155190eb6f5b18d", + "shasum": "" + }, + "require": { + "evenement/evenement": "^3.0 || ^2.0 || ^1.0", + "php": ">=5.3.8", + "react/event-loop": "^1.2" + }, + "require-dev": { + "clue/stream-filter": "~1.2", + "phpunit/phpunit": "^9.6 || ^5.7 || ^4.8.36" + }, + "type": "library", "autoload": { "psr-4": { - "Psr\\Container\\": "src/" + "React\\Stream\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", @@ -1375,92 +1922,187 @@ ], "authors": [ { - "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" + "name": "Christian Lück", + "email": "christian@clue.engineering", + "homepage": "https://clue.engineering/" + }, + { + "name": "Cees-Jan Kiewiet", + "email": "reactphp@ceesjankiewiet.nl", + "homepage": "https://wyrihaximus.net/" + }, + { + "name": "Jan Sorgalla", + "email": "jsorgalla@gmail.com", + "homepage": "https://sorgalla.com/" + }, + { + "name": "Chris Boden", + "email": "cboden@gmail.com", + "homepage": "https://cboden.dev/" } ], - "description": "Common Container Interface (PHP FIG PSR-11)", - "homepage": "https://github.com/php-fig/container", + "description": "Event-driven readable and writable streams for non-blocking I/O in ReactPHP", "keywords": [ - "PSR-11", - "container", - "container-interface", - "container-interop", - "psr" + "event-driven", + "io", + "non-blocking", + "pipe", + "reactphp", + "readable", + "stream", + "writable" + ], + "support": { + "issues": "https://github.com/reactphp/stream/issues", + "source": "https://github.com/reactphp/stream/tree/v1.4.0" + }, + "funding": [ + { + "url": "https://opencollective.com/reactphp", + "type": "open_collective" + } ], - "time": "2017-02-14T16:28:37+00:00" + "time": "2024-06-11T12:45:25+00:00" }, { - "name": "psr/log", - "version": "1.1.0", + "name": "sebastian/cli-parser", + "version": "3.0.2", "source": { "type": "git", - "url": "https://github.com/php-fig/log.git", - "reference": "6c001f1daafa3a3ac1d8ff69ee4db8e799a654dd" + "url": "https://github.com/sebastianbergmann/cli-parser.git", + "reference": "15c5dd40dc4f38794d383bb95465193f5e0ae180" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/log/zipball/6c001f1daafa3a3ac1d8ff69ee4db8e799a654dd", - "reference": "6c001f1daafa3a3ac1d8ff69ee4db8e799a654dd", + "url": "https://api.github.com/repos/sebastianbergmann/cli-parser/zipball/15c5dd40dc4f38794d383bb95465193f5e0ae180", + "reference": "15c5dd40dc4f38794d383bb95465193f5e0ae180", "shasum": "" }, "require": { - "php": ">=5.3.0" + "php": ">=8.2" + }, + "require-dev": { + "phpunit/phpunit": "^11.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0.x-dev" + "dev-main": "3.0-dev" } }, "autoload": { - "psr-4": { - "Psr\\Log\\": "Psr/Log/" + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Library for parsing CLI options", + "homepage": "https://github.com/sebastianbergmann/cli-parser", + "support": { + "issues": "https://github.com/sebastianbergmann/cli-parser/issues", + "security": "https://github.com/sebastianbergmann/cli-parser/security/policy", + "source": "https://github.com/sebastianbergmann/cli-parser/tree/3.0.2" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2024-07-03T04:41:36+00:00" + }, + { + "name": "sebastian/code-unit", + "version": "3.0.2", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/code-unit.git", + "reference": "ee88b0cdbe74cf8dd3b54940ff17643c0d6543ca" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/code-unit/zipball/ee88b0cdbe74cf8dd3b54940ff17643c0d6543ca", + "reference": "ee88b0cdbe74cf8dd3b54940ff17643c0d6543ca", + "shasum": "" + }, + "require": { + "php": ">=8.2" + }, + "require-dev": { + "phpunit/phpunit": "^11.5" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "3.0-dev" } }, + "autoload": { + "classmap": [ + "src/" + ] + }, "notification-url": "https://packagist.org/downloads/", "license": [ - "MIT" + "BSD-3-Clause" ], "authors": [ { - "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" } ], - "description": "Common interface for logging libraries", - "homepage": "https://github.com/php-fig/log", - "keywords": [ - "log", - "psr", - "psr-3" + "description": "Collection of value objects that represent the PHP code units", + "homepage": "https://github.com/sebastianbergmann/code-unit", + "support": { + "issues": "https://github.com/sebastianbergmann/code-unit/issues", + "security": "https://github.com/sebastianbergmann/code-unit/security/policy", + "source": "https://github.com/sebastianbergmann/code-unit/tree/3.0.2" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } ], - "time": "2018-11-20T15:27:04+00:00" + "time": "2024-12-12T09:59:06+00:00" }, { "name": "sebastian/code-unit-reverse-lookup", - "version": "1.0.1", + "version": "4.0.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/code-unit-reverse-lookup.git", - "reference": "4419fcdb5eabb9caa61a27c7a1db532a6b55dd18" + "reference": "183a9b2632194febd219bb9246eee421dad8d45e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/4419fcdb5eabb9caa61a27c7a1db532a6b55dd18", - "reference": "4419fcdb5eabb9caa61a27c7a1db532a6b55dd18", + "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/183a9b2632194febd219bb9246eee421dad8d45e", + "reference": "183a9b2632194febd219bb9246eee421dad8d45e", "shasum": "" }, "require": { - "php": "^5.6 || ^7.0" + "php": ">=8.2" }, "require-dev": { - "phpunit/phpunit": "^5.7 || ^6.0" + "phpunit/phpunit": "^11.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0.x-dev" + "dev-main": "4.0-dev" } }, "autoload": { @@ -1480,34 +2122,47 @@ ], "description": "Looks up which function or method a line of code belongs to", "homepage": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/", - "time": "2017-03-04T06:30:41+00:00" + "support": { + "issues": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/issues", + "security": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/security/policy", + "source": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/tree/4.0.1" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2024-07-03T04:45:54+00:00" }, { "name": "sebastian/comparator", - "version": "2.1.3", + "version": "6.2.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/comparator.git", - "reference": "34369daee48eafb2651bea869b4b15d75ccc35f9" + "reference": "43d129d6a0f81c78bee378b46688293eb7ea3739" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/34369daee48eafb2651bea869b4b15d75ccc35f9", - "reference": "34369daee48eafb2651bea869b4b15d75ccc35f9", + "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/43d129d6a0f81c78bee378b46688293eb7ea3739", + "reference": "43d129d6a0f81c78bee378b46688293eb7ea3739", "shasum": "" }, "require": { - "php": "^7.0", - "sebastian/diff": "^2.0 || ^3.0", - "sebastian/exporter": "^3.1" + "ext-dom": "*", + "ext-mbstring": "*", + "php": ">=8.2", + "sebastian/diff": "^6.0", + "sebastian/exporter": "^6.0" }, "require-dev": { - "phpunit/phpunit": "^6.4" + "phpunit/phpunit": "^11.4" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.1.x-dev" + "dev-main": "6.2-dev" } }, "autoload": { @@ -1520,6 +2175,10 @@ "BSD-3-Clause" ], "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + }, { "name": "Jeff Welch", "email": "whatthejeff@gmail.com" @@ -1531,10 +2190,6 @@ { "name": "Bernhard Schussek", "email": "bschussek@2bepublished.at" - }, - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" } ], "description": "Provides the functionality to compare PHP values for equality", @@ -1544,32 +2199,102 @@ "compare", "equality" ], - "time": "2018-02-01T13:46:46+00:00" + "support": { + "issues": "https://github.com/sebastianbergmann/comparator/issues", + "security": "https://github.com/sebastianbergmann/comparator/security/policy", + "source": "https://github.com/sebastianbergmann/comparator/tree/6.2.1" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2024-10-31T05:30:08+00:00" + }, + { + "name": "sebastian/complexity", + "version": "4.0.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/complexity.git", + "reference": "ee41d384ab1906c68852636b6de493846e13e5a0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/complexity/zipball/ee41d384ab1906c68852636b6de493846e13e5a0", + "reference": "ee41d384ab1906c68852636b6de493846e13e5a0", + "shasum": "" + }, + "require": { + "nikic/php-parser": "^5.0", + "php": ">=8.2" + }, + "require-dev": { + "phpunit/phpunit": "^11.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "4.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Library for calculating the complexity of PHP code units", + "homepage": "https://github.com/sebastianbergmann/complexity", + "support": { + "issues": "https://github.com/sebastianbergmann/complexity/issues", + "security": "https://github.com/sebastianbergmann/complexity/security/policy", + "source": "https://github.com/sebastianbergmann/complexity/tree/4.0.1" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2024-07-03T04:49:50+00:00" }, { "name": "sebastian/diff", - "version": "2.0.1", + "version": "6.0.2", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/diff.git", - "reference": "347c1d8b49c5c3ee30c7040ea6fc446790e6bddd" + "reference": "b4ccd857127db5d41a5b676f24b51371d76d8544" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/347c1d8b49c5c3ee30c7040ea6fc446790e6bddd", - "reference": "347c1d8b49c5c3ee30c7040ea6fc446790e6bddd", + "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/b4ccd857127db5d41a5b676f24b51371d76d8544", + "reference": "b4ccd857127db5d41a5b676f24b51371d76d8544", "shasum": "" }, "require": { - "php": "^7.0" + "php": ">=8.2" }, "require-dev": { - "phpunit/phpunit": "^6.2" + "phpunit/phpunit": "^11.0", + "symfony/process": "^4.2 || ^5" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.0-dev" + "dev-main": "6.0-dev" } }, "autoload": { @@ -1582,46 +2307,63 @@ "BSD-3-Clause" ], "authors": [ - { - "name": "Kore Nordmann", - "email": "mail@kore-nordmann.de" - }, { "name": "Sebastian Bergmann", "email": "sebastian@phpunit.de" + }, + { + "name": "Kore Nordmann", + "email": "mail@kore-nordmann.de" } ], "description": "Diff implementation", "homepage": "https://github.com/sebastianbergmann/diff", "keywords": [ - "diff" + "diff", + "udiff", + "unidiff", + "unified diff" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/diff/issues", + "security": "https://github.com/sebastianbergmann/diff/security/policy", + "source": "https://github.com/sebastianbergmann/diff/tree/6.0.2" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } ], - "time": "2017-08-03T08:09:46+00:00" + "time": "2024-07-03T04:53:05+00:00" }, { "name": "sebastian/environment", - "version": "3.1.0", + "version": "7.2.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/environment.git", - "reference": "cd0871b3975fb7fc44d11314fd1ee20925fce4f5" + "reference": "855f3ae0ab316bbafe1ba4e16e9f3c078d24a0c5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/cd0871b3975fb7fc44d11314fd1ee20925fce4f5", - "reference": "cd0871b3975fb7fc44d11314fd1ee20925fce4f5", + "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/855f3ae0ab316bbafe1ba4e16e9f3c078d24a0c5", + "reference": "855f3ae0ab316bbafe1ba4e16e9f3c078d24a0c5", "shasum": "" }, "require": { - "php": "^7.0" + "php": ">=8.2" }, "require-dev": { - "phpunit/phpunit": "^6.1" + "phpunit/phpunit": "^11.0" + }, + "suggest": { + "ext-posix": "*" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.1.x-dev" + "dev-main": "7.2-dev" } }, "autoload": { @@ -1640,40 +2382,51 @@ } ], "description": "Provides functionality to handle HHVM/PHP environments", - "homepage": "http://www.github.com/sebastianbergmann/environment", + "homepage": "https://github.com/sebastianbergmann/environment", "keywords": [ "Xdebug", "environment", "hhvm" ], - "time": "2017-07-01T08:51:00+00:00" + "support": { + "issues": "https://github.com/sebastianbergmann/environment/issues", + "security": "https://github.com/sebastianbergmann/environment/security/policy", + "source": "https://github.com/sebastianbergmann/environment/tree/7.2.0" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2024-07-03T04:54:44+00:00" }, { "name": "sebastian/exporter", - "version": "3.1.1", + "version": "6.3.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/exporter.git", - "reference": "06a9a5947f47b3029d76118eb5c22802e5869687" + "reference": "3473f61172093b2da7de1fb5782e1f24cc036dc3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/06a9a5947f47b3029d76118eb5c22802e5869687", - "reference": "06a9a5947f47b3029d76118eb5c22802e5869687", + "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/3473f61172093b2da7de1fb5782e1f24cc036dc3", + "reference": "3473f61172093b2da7de1fb5782e1f24cc036dc3", "shasum": "" }, "require": { - "php": "^7.0", - "sebastian/recursion-context": "^3.0" + "ext-mbstring": "*", + "php": ">=8.2", + "sebastian/recursion-context": "^6.0" }, "require-dev": { - "ext-mbstring": "*", - "phpunit/phpunit": "^6.0" + "phpunit/phpunit": "^11.3" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.1.x-dev" + "dev-main": "6.1-dev" } }, "autoload": { @@ -1708,40 +2461,51 @@ } ], "description": "Provides the functionality to export PHP variables for visualization", - "homepage": "http://www.github.com/sebastianbergmann/exporter", + "homepage": "https://www.github.com/sebastianbergmann/exporter", "keywords": [ "export", "exporter" ], - "time": "2019-08-11T12:43:14+00:00" + "support": { + "issues": "https://github.com/sebastianbergmann/exporter/issues", + "security": "https://github.com/sebastianbergmann/exporter/security/policy", + "source": "https://github.com/sebastianbergmann/exporter/tree/6.3.0" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2024-12-05T09:17:50+00:00" }, { "name": "sebastian/global-state", - "version": "2.0.0", + "version": "7.0.2", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/global-state.git", - "reference": "e8ba02eed7bbbb9e59e43dedd3dddeff4a56b0c4" + "reference": "3be331570a721f9a4b5917f4209773de17f747d7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/e8ba02eed7bbbb9e59e43dedd3dddeff4a56b0c4", - "reference": "e8ba02eed7bbbb9e59e43dedd3dddeff4a56b0c4", + "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/3be331570a721f9a4b5917f4209773de17f747d7", + "reference": "3be331570a721f9a4b5917f4209773de17f747d7", "shasum": "" }, "require": { - "php": "^7.0" + "php": ">=8.2", + "sebastian/object-reflector": "^4.0", + "sebastian/recursion-context": "^6.0" }, "require-dev": { - "phpunit/phpunit": "^6.0" - }, - "suggest": { - "ext-uopz": "*" + "ext-dom": "*", + "phpunit/phpunit": "^11.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.0-dev" + "dev-main": "7.0-dev" } }, "autoload": { @@ -1760,38 +2524,107 @@ } ], "description": "Snapshotting of global state", - "homepage": "http://www.github.com/sebastianbergmann/global-state", + "homepage": "https://www.github.com/sebastianbergmann/global-state", "keywords": [ "global state" ], - "time": "2017-04-27T15:39:26+00:00" + "support": { + "issues": "https://github.com/sebastianbergmann/global-state/issues", + "security": "https://github.com/sebastianbergmann/global-state/security/policy", + "source": "https://github.com/sebastianbergmann/global-state/tree/7.0.2" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2024-07-03T04:57:36+00:00" + }, + { + "name": "sebastian/lines-of-code", + "version": "3.0.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/lines-of-code.git", + "reference": "d36ad0d782e5756913e42ad87cb2890f4ffe467a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/lines-of-code/zipball/d36ad0d782e5756913e42ad87cb2890f4ffe467a", + "reference": "d36ad0d782e5756913e42ad87cb2890f4ffe467a", + "shasum": "" + }, + "require": { + "nikic/php-parser": "^5.0", + "php": ">=8.2" + }, + "require-dev": { + "phpunit/phpunit": "^11.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "3.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Library for counting the lines of code in PHP source code", + "homepage": "https://github.com/sebastianbergmann/lines-of-code", + "support": { + "issues": "https://github.com/sebastianbergmann/lines-of-code/issues", + "security": "https://github.com/sebastianbergmann/lines-of-code/security/policy", + "source": "https://github.com/sebastianbergmann/lines-of-code/tree/3.0.1" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2024-07-03T04:58:38+00:00" }, { "name": "sebastian/object-enumerator", - "version": "3.0.3", + "version": "6.0.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/object-enumerator.git", - "reference": "7cfd9e65d11ffb5af41198476395774d4c8a84c5" + "reference": "f5b498e631a74204185071eb41f33f38d64608aa" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/7cfd9e65d11ffb5af41198476395774d4c8a84c5", - "reference": "7cfd9e65d11ffb5af41198476395774d4c8a84c5", + "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/f5b498e631a74204185071eb41f33f38d64608aa", + "reference": "f5b498e631a74204185071eb41f33f38d64608aa", "shasum": "" }, "require": { - "php": "^7.0", - "sebastian/object-reflector": "^1.1.1", - "sebastian/recursion-context": "^3.0" + "php": ">=8.2", + "sebastian/object-reflector": "^4.0", + "sebastian/recursion-context": "^6.0" }, "require-dev": { - "phpunit/phpunit": "^6.0" + "phpunit/phpunit": "^11.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.0.x-dev" + "dev-main": "6.0-dev" } }, "autoload": { @@ -1811,32 +2644,43 @@ ], "description": "Traverses array structures and object graphs to enumerate all referenced objects", "homepage": "https://github.com/sebastianbergmann/object-enumerator/", - "time": "2017-08-03T12:35:26+00:00" + "support": { + "issues": "https://github.com/sebastianbergmann/object-enumerator/issues", + "security": "https://github.com/sebastianbergmann/object-enumerator/security/policy", + "source": "https://github.com/sebastianbergmann/object-enumerator/tree/6.0.1" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2024-07-03T05:00:13+00:00" }, { "name": "sebastian/object-reflector", - "version": "1.1.1", + "version": "4.0.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/object-reflector.git", - "reference": "773f97c67f28de00d397be301821b06708fca0be" + "reference": "6e1a43b411b2ad34146dee7524cb13a068bb35f9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/object-reflector/zipball/773f97c67f28de00d397be301821b06708fca0be", - "reference": "773f97c67f28de00d397be301821b06708fca0be", + "url": "https://api.github.com/repos/sebastianbergmann/object-reflector/zipball/6e1a43b411b2ad34146dee7524cb13a068bb35f9", + "reference": "6e1a43b411b2ad34146dee7524cb13a068bb35f9", "shasum": "" }, "require": { - "php": "^7.0" + "php": ">=8.2" }, "require-dev": { - "phpunit/phpunit": "^6.0" + "phpunit/phpunit": "^11.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.1-dev" + "dev-main": "4.0-dev" } }, "autoload": { @@ -1856,32 +2700,43 @@ ], "description": "Allows reflection of object attributes, including inherited and non-public ones", "homepage": "https://github.com/sebastianbergmann/object-reflector/", - "time": "2017-03-29T09:07:27+00:00" + "support": { + "issues": "https://github.com/sebastianbergmann/object-reflector/issues", + "security": "https://github.com/sebastianbergmann/object-reflector/security/policy", + "source": "https://github.com/sebastianbergmann/object-reflector/tree/4.0.1" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2024-07-03T05:01:32+00:00" }, { "name": "sebastian/recursion-context", - "version": "3.0.0", + "version": "6.0.2", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/recursion-context.git", - "reference": "5b0cd723502bac3b006cbf3dbf7a1e3fcefe4fa8" + "reference": "694d156164372abbd149a4b85ccda2e4670c0e16" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/5b0cd723502bac3b006cbf3dbf7a1e3fcefe4fa8", - "reference": "5b0cd723502bac3b006cbf3dbf7a1e3fcefe4fa8", + "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/694d156164372abbd149a4b85ccda2e4670c0e16", + "reference": "694d156164372abbd149a4b85ccda2e4670c0e16", "shasum": "" }, "require": { - "php": "^7.0" + "php": ">=8.2" }, "require-dev": { - "phpunit/phpunit": "^6.0" + "phpunit/phpunit": "^11.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.0.x-dev" + "dev-main": "6.0-dev" } }, "autoload": { @@ -1894,44 +2749,58 @@ "BSD-3-Clause" ], "authors": [ - { - "name": "Jeff Welch", - "email": "whatthejeff@gmail.com" - }, { "name": "Sebastian Bergmann", "email": "sebastian@phpunit.de" }, + { + "name": "Jeff Welch", + "email": "whatthejeff@gmail.com" + }, { "name": "Adam Harvey", "email": "aharvey@php.net" } ], "description": "Provides functionality to recursively process PHP variables", - "homepage": "http://www.github.com/sebastianbergmann/recursion-context", - "time": "2017-03-03T06:23:57+00:00" + "homepage": "https://github.com/sebastianbergmann/recursion-context", + "support": { + "issues": "https://github.com/sebastianbergmann/recursion-context/issues", + "security": "https://github.com/sebastianbergmann/recursion-context/security/policy", + "source": "https://github.com/sebastianbergmann/recursion-context/tree/6.0.2" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2024-07-03T05:10:34+00:00" }, { - "name": "sebastian/resource-operations", - "version": "1.0.0", + "name": "sebastian/type", + "version": "5.1.0", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/resource-operations.git", - "reference": "ce990bb21759f94aeafd30209e8cfcdfa8bc3f52" + "url": "https://github.com/sebastianbergmann/type.git", + "reference": "461b9c5da241511a2a0e8f240814fb23ce5c0aac" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/resource-operations/zipball/ce990bb21759f94aeafd30209e8cfcdfa8bc3f52", - "reference": "ce990bb21759f94aeafd30209e8cfcdfa8bc3f52", + "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/461b9c5da241511a2a0e8f240814fb23ce5c0aac", + "reference": "461b9c5da241511a2a0e8f240814fb23ce5c0aac", "shasum": "" }, "require": { - "php": ">=5.6.0" + "php": ">=8.2" + }, + "require-dev": { + "phpunit/phpunit": "^11.3" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0.x-dev" + "dev-main": "5.1-dev" } }, "autoload": { @@ -1946,34 +2815,46 @@ "authors": [ { "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Collection of value objects that represent the types of the PHP type system", + "homepage": "https://github.com/sebastianbergmann/type", + "support": { + "issues": "https://github.com/sebastianbergmann/type/issues", + "security": "https://github.com/sebastianbergmann/type/security/policy", + "source": "https://github.com/sebastianbergmann/type/tree/5.1.0" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" } ], - "description": "Provides a list of PHP built-in functions that operate on resources", - "homepage": "https://www.github.com/sebastianbergmann/resource-operations", - "time": "2015-07-28T20:34:47+00:00" + "time": "2024-09-17T13:12:04+00:00" }, { "name": "sebastian/version", - "version": "2.0.1", + "version": "5.0.2", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/version.git", - "reference": "99732be0ddb3361e16ad77b68ba41efc8e979019" + "reference": "c687e3387b99f5b03b6caa64c74b63e2936ff874" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/99732be0ddb3361e16ad77b68ba41efc8e979019", - "reference": "99732be0ddb3361e16ad77b68ba41efc8e979019", + "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/c687e3387b99f5b03b6caa64c74b63e2936ff874", + "reference": "c687e3387b99f5b03b6caa64c74b63e2936ff874", "shasum": "" }, "require": { - "php": ">=5.6" + "php": ">=8.2" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.0.x-dev" + "dev-main": "5.0-dev" } }, "autoload": { @@ -1994,57 +2875,115 @@ ], "description": "Library that helps with managing the version number of Git-hosted PHP projects", "homepage": "https://github.com/sebastianbergmann/version", - "time": "2016-10-03T07:35:21+00:00" + "support": { + "issues": "https://github.com/sebastianbergmann/version/issues", + "security": "https://github.com/sebastianbergmann/version/security/policy", + "source": "https://github.com/sebastianbergmann/version/tree/5.0.2" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2024-10-09T05:16:32+00:00" + }, + { + "name": "staabm/side-effects-detector", + "version": "1.0.5", + "source": { + "type": "git", + "url": "https://github.com/staabm/side-effects-detector.git", + "reference": "d8334211a140ce329c13726d4a715adbddd0a163" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/staabm/side-effects-detector/zipball/d8334211a140ce329c13726d4a715adbddd0a163", + "reference": "d8334211a140ce329c13726d4a715adbddd0a163", + "shasum": "" + }, + "require": { + "ext-tokenizer": "*", + "php": "^7.4 || ^8.0" + }, + "require-dev": { + "phpstan/extension-installer": "^1.4.3", + "phpstan/phpstan": "^1.12.6", + "phpunit/phpunit": "^9.6.21", + "symfony/var-dumper": "^5.4.43", + "tomasvotruba/type-coverage": "1.0.0", + "tomasvotruba/unused-public": "1.0.0" + }, + "type": "library", + "autoload": { + "classmap": [ + "lib/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "A static analysis tool to detect side effects in PHP code", + "keywords": [ + "static analysis" + ], + "support": { + "issues": "https://github.com/staabm/side-effects-detector/issues", + "source": "https://github.com/staabm/side-effects-detector/tree/1.0.5" + }, + "funding": [ + { + "url": "https://github.com/staabm", + "type": "github" + } + ], + "time": "2024-10-20T05:08:20+00:00" }, { "name": "symfony/console", - "version": "v4.3.4", + "version": "v7.2.1", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "de63799239b3881b8a08f8481b22348f77ed7b36" + "reference": "fefcc18c0f5d0efe3ab3152f15857298868dc2c3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/de63799239b3881b8a08f8481b22348f77ed7b36", - "reference": "de63799239b3881b8a08f8481b22348f77ed7b36", + "url": "https://api.github.com/repos/symfony/console/zipball/fefcc18c0f5d0efe3ab3152f15857298868dc2c3", + "reference": "fefcc18c0f5d0efe3ab3152f15857298868dc2c3", "shasum": "" }, "require": { - "php": "^7.1.3", + "php": ">=8.2", "symfony/polyfill-mbstring": "~1.0", - "symfony/polyfill-php73": "^1.8", - "symfony/service-contracts": "^1.1" + "symfony/service-contracts": "^2.5|^3", + "symfony/string": "^6.4|^7.0" }, "conflict": { - "symfony/dependency-injection": "<3.4", - "symfony/event-dispatcher": "<4.3", - "symfony/process": "<3.3" + "symfony/dependency-injection": "<6.4", + "symfony/dotenv": "<6.4", + "symfony/event-dispatcher": "<6.4", + "symfony/lock": "<6.4", + "symfony/process": "<6.4" }, "provide": { - "psr/log-implementation": "1.0" + "psr/log-implementation": "1.0|2.0|3.0" }, "require-dev": { - "psr/log": "~1.0", - "symfony/config": "~3.4|~4.0", - "symfony/dependency-injection": "~3.4|~4.0", - "symfony/event-dispatcher": "^4.3", - "symfony/lock": "~3.4|~4.0", - "symfony/process": "~3.4|~4.0", - "symfony/var-dumper": "^4.3" - }, - "suggest": { - "psr/log": "For using the console logger", - "symfony/event-dispatcher": "", - "symfony/lock": "", - "symfony/process": "" + "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" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "4.3-dev" - } - }, "autoload": { "psr-4": { "Symfony\\Component\\Console\\": "" @@ -2067,54 +3006,137 @@ "homepage": "https://symfony.com/contributors" } ], - "description": "Symfony Console Component", + "description": "Eases the creation of beautiful and testable command line interfaces", + "homepage": "https://symfony.com", + "keywords": [ + "cli", + "command-line", + "console", + "terminal" + ], + "support": { + "source": "https://github.com/symfony/console/tree/v7.2.1" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-12-11T03:49:26+00:00" + }, + { + "name": "symfony/deprecation-contracts", + "version": "v3.5.1", + "source": { + "type": "git", + "url": "https://github.com/symfony/deprecation-contracts.git", + "reference": "74c71c939a79f7d5bf3c1ce9f5ea37ba0114c6f6" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/74c71c939a79f7d5bf3c1ce9f5ea37ba0114c6f6", + "reference": "74c71c939a79f7d5bf3c1ce9f5ea37ba0114c6f6", + "shasum": "" + }, + "require": { + "php": ">=8.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "3.5-dev" + }, + "thanks": { + "name": "symfony/contracts", + "url": "https://github.com/symfony/contracts" + } + }, + "autoload": { + "files": [ + "function.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "A generic function and convention to trigger deprecation notices", "homepage": "https://symfony.com", - "time": "2019-08-26T08:26:39+00:00" + "support": { + "source": "https://github.com/symfony/deprecation-contracts/tree/v3.5.1" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-09-25T14:20:29+00:00" }, { "name": "symfony/event-dispatcher", - "version": "v4.3.4", + "version": "v7.2.0", "source": { "type": "git", "url": "https://github.com/symfony/event-dispatcher.git", - "reference": "429d0a1451d4c9c4abe1959b2986b88794b9b7d2" + "reference": "910c5db85a5356d0fea57680defec4e99eb9c8c1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/429d0a1451d4c9c4abe1959b2986b88794b9b7d2", - "reference": "429d0a1451d4c9c4abe1959b2986b88794b9b7d2", + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/910c5db85a5356d0fea57680defec4e99eb9c8c1", + "reference": "910c5db85a5356d0fea57680defec4e99eb9c8c1", "shasum": "" }, "require": { - "php": "^7.1.3", - "symfony/event-dispatcher-contracts": "^1.1" + "php": ">=8.2", + "symfony/event-dispatcher-contracts": "^2.5|^3" }, "conflict": { - "symfony/dependency-injection": "<3.4" + "symfony/dependency-injection": "<6.4", + "symfony/service-contracts": "<2.5" }, "provide": { "psr/event-dispatcher-implementation": "1.0", - "symfony/event-dispatcher-implementation": "1.1" + "symfony/event-dispatcher-implementation": "2.0|3.0" }, "require-dev": { - "psr/log": "~1.0", - "symfony/config": "~3.4|~4.0", - "symfony/dependency-injection": "~3.4|~4.0", - "symfony/expression-language": "~3.4|~4.0", - "symfony/http-foundation": "^3.4|^4.0", - "symfony/service-contracts": "^1.1", - "symfony/stopwatch": "~3.4|~4.0" - }, - "suggest": { - "symfony/dependency-injection": "", - "symfony/http-kernel": "" + "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/service-contracts": "^2.5|^3", + "symfony/stopwatch": "^6.4|^7.0" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "4.3-dev" - } - }, "autoload": { "psr-4": { "Symfony\\Component\\EventDispatcher\\": "" @@ -2137,35 +3159,53 @@ "homepage": "https://symfony.com/contributors" } ], - "description": "Symfony EventDispatcher Component", + "description": "Provides tools that allow your application components to communicate with each other by dispatching events and listening to them", "homepage": "https://symfony.com", - "time": "2019-08-26T08:55:16+00:00" + "support": { + "source": "https://github.com/symfony/event-dispatcher/tree/v7.2.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-09-25T14:21:43+00:00" }, { "name": "symfony/event-dispatcher-contracts", - "version": "v1.1.5", + "version": "v3.5.1", "source": { "type": "git", "url": "https://github.com/symfony/event-dispatcher-contracts.git", - "reference": "c61766f4440ca687de1084a5c00b08e167a2575c" + "reference": "7642f5e970b672283b7823222ae8ef8bbc160b9f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher-contracts/zipball/c61766f4440ca687de1084a5c00b08e167a2575c", - "reference": "c61766f4440ca687de1084a5c00b08e167a2575c", + "url": "https://api.github.com/repos/symfony/event-dispatcher-contracts/zipball/7642f5e970b672283b7823222ae8ef8bbc160b9f", + "reference": "7642f5e970b672283b7823222ae8ef8bbc160b9f", "shasum": "" }, "require": { - "php": "^7.1.3" - }, - "suggest": { - "psr/event-dispatcher": "", - "symfony/event-dispatcher-implementation": "" + "php": ">=8.1", + "psr/event-dispatcher": "^1" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.1-dev" + "dev-main": "3.5-dev" + }, + "thanks": { + "name": "symfony/contracts", + "url": "https://github.com/symfony/contracts" } }, "autoload": { @@ -2197,32 +3237,48 @@ "interoperability", "standards" ], - "time": "2019-06-20T06:46:26+00:00" + "support": { + "source": "https://github.com/symfony/event-dispatcher-contracts/tree/v3.5.1" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-09-25T14:20:29+00:00" }, { "name": "symfony/filesystem", - "version": "v4.3.4", + "version": "v7.2.0", "source": { "type": "git", "url": "https://github.com/symfony/filesystem.git", - "reference": "9abbb7ef96a51f4d7e69627bc6f63307994e4263" + "reference": "b8dce482de9d7c9fe2891155035a7248ab5c7fdb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/filesystem/zipball/9abbb7ef96a51f4d7e69627bc6f63307994e4263", - "reference": "9abbb7ef96a51f4d7e69627bc6f63307994e4263", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/b8dce482de9d7c9fe2891155035a7248ab5c7fdb", + "reference": "b8dce482de9d7c9fe2891155035a7248ab5c7fdb", "shasum": "" }, "require": { - "php": "^7.1.3", - "symfony/polyfill-ctype": "~1.8" + "php": ">=8.2", + "symfony/polyfill-ctype": "~1.8", + "symfony/polyfill-mbstring": "~1.8" }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "4.3-dev" - } + "require-dev": { + "symfony/process": "^6.4|^7.0" }, + "type": "library", "autoload": { "psr-4": { "Symfony\\Component\\Filesystem\\": "" @@ -2245,33 +3301,48 @@ "homepage": "https://symfony.com/contributors" } ], - "description": "Symfony Filesystem Component", + "description": "Provides basic utilities for the filesystem", "homepage": "https://symfony.com", - "time": "2019-08-20T14:07:54+00:00" + "support": { + "source": "https://github.com/symfony/filesystem/tree/v7.2.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-10-25T15:15:23+00:00" }, { "name": "symfony/finder", - "version": "v4.3.4", + "version": "v7.2.0", "source": { "type": "git", "url": "https://github.com/symfony/finder.git", - "reference": "86c1c929f0a4b24812e1eb109262fc3372c8e9f2" + "reference": "6de263e5868b9a137602dd1e33e4d48bfae99c49" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/86c1c929f0a4b24812e1eb109262fc3372c8e9f2", - "reference": "86c1c929f0a4b24812e1eb109262fc3372c8e9f2", + "url": "https://api.github.com/repos/symfony/finder/zipball/6de263e5868b9a137602dd1e33e4d48bfae99c49", + "reference": "6de263e5868b9a137602dd1e33e4d48bfae99c49", "shasum": "" }, "require": { - "php": "^7.1.3" + "php": ">=8.2" }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "4.3-dev" - } + "require-dev": { + "symfony/filesystem": "^6.4|^7.0" }, + "type": "library", "autoload": { "psr-4": { "Symfony\\Component\\Finder\\": "" @@ -2294,33 +3365,46 @@ "homepage": "https://symfony.com/contributors" } ], - "description": "Symfony Finder Component", + "description": "Finds files and directories via an intuitive fluent interface", "homepage": "https://symfony.com", - "time": "2019-08-14T12:26:46+00:00" + "support": { + "source": "https://github.com/symfony/finder/tree/v7.2.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-10-23T06:56:12+00:00" }, { "name": "symfony/options-resolver", - "version": "v4.3.4", + "version": "v7.2.0", "source": { "type": "git", "url": "https://github.com/symfony/options-resolver.git", - "reference": "81c2e120522a42f623233968244baebd6b36cb6a" + "reference": "7da8fbac9dcfef75ffc212235d76b2754ce0cf50" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/options-resolver/zipball/81c2e120522a42f623233968244baebd6b36cb6a", - "reference": "81c2e120522a42f623233968244baebd6b36cb6a", + "url": "https://api.github.com/repos/symfony/options-resolver/zipball/7da8fbac9dcfef75ffc212235d76b2754ce0cf50", + "reference": "7da8fbac9dcfef75ffc212235d76b2754ce0cf50", "shasum": "" }, "require": { - "php": "^7.1.3" + "php": ">=8.2", + "symfony/deprecation-contracts": "^2.5|^3" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "4.3-dev" - } - }, "autoload": { "psr-4": { "Symfony\\Component\\OptionsResolver\\": "" @@ -2343,48 +3427,69 @@ "homepage": "https://symfony.com/contributors" } ], - "description": "Symfony OptionsResolver Component", + "description": "Provides an improved replacement for the array_replace PHP function", "homepage": "https://symfony.com", "keywords": [ "config", "configuration", "options" ], - "time": "2019-08-08T09:29:19+00:00" + "support": { + "source": "https://github.com/symfony/options-resolver/tree/v7.2.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-11-20T11:17:29+00:00" }, { "name": "symfony/polyfill-ctype", - "version": "v1.12.0", + "version": "v1.31.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-ctype.git", - "reference": "550ebaac289296ce228a706d0867afc34687e3f4" + "reference": "a3cc8b044a6ea513310cbd48ef7333b384945638" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/550ebaac289296ce228a706d0867afc34687e3f4", - "reference": "550ebaac289296ce228a706d0867afc34687e3f4", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/a3cc8b044a6ea513310cbd48ef7333b384945638", + "reference": "a3cc8b044a6ea513310cbd48ef7333b384945638", "shasum": "" }, "require": { - "php": ">=5.3.3" + "php": ">=7.2" + }, + "provide": { + "ext-ctype": "*" }, "suggest": { "ext-ctype": "For best performance" }, "type": "library", "extra": { - "branch-alias": { - "dev-master": "1.12-dev" + "thanks": { + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" } }, "autoload": { - "psr-4": { - "Symfony\\Polyfill\\Ctype\\": "" - }, "files": [ "bootstrap.php" - ] + ], + "psr-4": { + "Symfony\\Polyfill\\Ctype\\": "" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -2408,41 +3513,59 @@ "polyfill", "portable" ], - "time": "2019-08-06T08:03:45+00:00" + "support": { + "source": "https://github.com/symfony/polyfill-ctype/tree/v1.31.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-09-09T11:45:10+00:00" }, { - "name": "symfony/polyfill-mbstring", - "version": "v1.12.0", + "name": "symfony/polyfill-intl-grapheme", + "version": "v1.31.0", "source": { "type": "git", - "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "b42a2f66e8f1b15ccf25652c3424265923eb4f17" + "url": "https://github.com/symfony/polyfill-intl-grapheme.git", + "reference": "b9123926e3b7bc2f98c02ad54f6a4b02b91a8abe" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/b42a2f66e8f1b15ccf25652c3424265923eb4f17", - "reference": "b42a2f66e8f1b15ccf25652c3424265923eb4f17", + "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/b9123926e3b7bc2f98c02ad54f6a4b02b91a8abe", + "reference": "b9123926e3b7bc2f98c02ad54f6a4b02b91a8abe", "shasum": "" }, "require": { - "php": ">=5.3.3" + "php": ">=7.2" }, "suggest": { - "ext-mbstring": "For best performance" + "ext-intl": "For best performance" }, "type": "library", "extra": { - "branch-alias": { - "dev-master": "1.12-dev" + "thanks": { + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" } }, "autoload": { - "psr-4": { - "Symfony\\Polyfill\\Mbstring\\": "" - }, "files": [ "bootstrap.php" - ] + ], + "psr-4": { + "Symfony\\Polyfill\\Intl\\Grapheme\\": "" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -2458,48 +3581,69 @@ "homepage": "https://symfony.com/contributors" } ], - "description": "Symfony polyfill for the Mbstring extension", + "description": "Symfony polyfill for intl's grapheme_* functions", "homepage": "https://symfony.com", "keywords": [ "compatibility", - "mbstring", + "grapheme", + "intl", "polyfill", "portable", "shim" ], - "time": "2019-08-06T08:03:45+00:00" + "support": { + "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.31.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-09-09T11:45:10+00:00" }, { - "name": "symfony/polyfill-php70", - "version": "v1.12.0", + "name": "symfony/polyfill-intl-normalizer", + "version": "v1.31.0", "source": { "type": "git", - "url": "https://github.com/symfony/polyfill-php70.git", - "reference": "54b4c428a0054e254223797d2713c31e08610831" + "url": "https://github.com/symfony/polyfill-intl-normalizer.git", + "reference": "3833d7255cc303546435cb650316bff708a1c75c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php70/zipball/54b4c428a0054e254223797d2713c31e08610831", - "reference": "54b4c428a0054e254223797d2713c31e08610831", + "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/3833d7255cc303546435cb650316bff708a1c75c", + "reference": "3833d7255cc303546435cb650316bff708a1c75c", "shasum": "" }, "require": { - "paragonie/random_compat": "~1.0|~2.0|~9.99", - "php": ">=5.3.3" + "php": ">=7.2" + }, + "suggest": { + "ext-intl": "For best performance" }, "type": "library", "extra": { - "branch-alias": { - "dev-master": "1.12-dev" + "thanks": { + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" } }, "autoload": { - "psr-4": { - "Symfony\\Polyfill\\Php70\\": "" - }, "files": [ "bootstrap.php" ], + "psr-4": { + "Symfony\\Polyfill\\Intl\\Normalizer\\": "" + }, "classmap": [ "Resources/stubs" ] @@ -2518,45 +3662,148 @@ "homepage": "https://symfony.com/contributors" } ], - "description": "Symfony polyfill backporting some PHP 7.0+ features to lower PHP versions", + "description": "Symfony polyfill for intl's Normalizer class and related functions", "homepage": "https://symfony.com", "keywords": [ "compatibility", + "intl", + "normalizer", "polyfill", "portable", "shim" ], - "time": "2019-08-06T08:03:45+00:00" + "support": { + "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.31.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-09-09T11:45:10+00:00" }, { - "name": "symfony/polyfill-php72", - "version": "v1.12.0", + "name": "symfony/polyfill-mbstring", + "version": "v1.31.0", "source": { "type": "git", - "url": "https://github.com/symfony/polyfill-php72.git", - "reference": "04ce3335667451138df4307d6a9b61565560199e" + "url": "https://github.com/symfony/polyfill-mbstring.git", + "reference": "85181ba99b2345b0ef10ce42ecac37612d9fd341" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php72/zipball/04ce3335667451138df4307d6a9b61565560199e", - "reference": "04ce3335667451138df4307d6a9b61565560199e", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/85181ba99b2345b0ef10ce42ecac37612d9fd341", + "reference": "85181ba99b2345b0ef10ce42ecac37612d9fd341", "shasum": "" }, "require": { - "php": ">=5.3.3" + "php": ">=7.2" + }, + "provide": { + "ext-mbstring": "*" + }, + "suggest": { + "ext-mbstring": "For best performance" }, "type": "library", "extra": { - "branch-alias": { - "dev-master": "1.12-dev" + "thanks": { + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" } }, "autoload": { + "files": [ + "bootstrap.php" + ], "psr-4": { - "Symfony\\Polyfill\\Php72\\": "" + "Symfony\\Polyfill\\Mbstring\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for the Mbstring extension", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "mbstring", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.31.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-09-09T11:45:10+00:00" + }, + { + "name": "symfony/polyfill-php80", + "version": "v1.31.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-php80.git", + "reference": "60328e362d4c2c802a54fcbf04f9d3fb892b4cf8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/60328e362d4c2c802a54fcbf04f9d3fb892b4cf8", + "reference": "60328e362d4c2c802a54fcbf04f9d3fb892b4cf8", + "shasum": "" + }, + "require": { + "php": ">=7.2" + }, + "type": "library", + "extra": { + "thanks": { + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" + } + }, + "autoload": { "files": [ "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Php80\\": "" + }, + "classmap": [ + "Resources/stubs" ] }, "notification-url": "https://packagist.org/downloads/", @@ -2564,6 +3811,10 @@ "MIT" ], "authors": [ + { + "name": "Ion Bazan", + "email": "ion.bazan@gmail.com" + }, { "name": "Nicolas Grekas", "email": "p@tchwork.com" @@ -2573,7 +3824,7 @@ "homepage": "https://symfony.com/contributors" } ], - "description": "Symfony polyfill backporting some PHP 7.2+ features to lower PHP versions", + "description": "Symfony polyfill backporting some PHP 8.0+ features to lower PHP versions", "homepage": "https://symfony.com", "keywords": [ "compatibility", @@ -2581,38 +3832,56 @@ "portable", "shim" ], - "time": "2019-08-06T08:03:45+00:00" + "support": { + "source": "https://github.com/symfony/polyfill-php80/tree/v1.31.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-09-09T11:45:10+00:00" }, { - "name": "symfony/polyfill-php73", - "version": "v1.12.0", + "name": "symfony/polyfill-php81", + "version": "v1.31.0", "source": { "type": "git", - "url": "https://github.com/symfony/polyfill-php73.git", - "reference": "2ceb49eaccb9352bff54d22570276bb75ba4a188" + "url": "https://github.com/symfony/polyfill-php81.git", + "reference": "4a4cfc2d253c21a5ad0e53071df248ed48c6ce5c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/2ceb49eaccb9352bff54d22570276bb75ba4a188", - "reference": "2ceb49eaccb9352bff54d22570276bb75ba4a188", + "url": "https://api.github.com/repos/symfony/polyfill-php81/zipball/4a4cfc2d253c21a5ad0e53071df248ed48c6ce5c", + "reference": "4a4cfc2d253c21a5ad0e53071df248ed48c6ce5c", "shasum": "" }, "require": { - "php": ">=5.3.3" + "php": ">=7.2" }, "type": "library", "extra": { - "branch-alias": { - "dev-master": "1.12-dev" + "thanks": { + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" } }, "autoload": { - "psr-4": { - "Symfony\\Polyfill\\Php73\\": "" - }, "files": [ "bootstrap.php" ], + "psr-4": { + "Symfony\\Polyfill\\Php81\\": "" + }, "classmap": [ "Resources/stubs" ] @@ -2631,7 +3900,7 @@ "homepage": "https://symfony.com/contributors" } ], - "description": "Symfony polyfill backporting some PHP 7.3+ features to lower PHP versions", + "description": "Symfony polyfill backporting some PHP 8.1+ features to lower PHP versions", "homepage": "https://symfony.com", "keywords": [ "compatibility", @@ -2639,31 +3908,43 @@ "portable", "shim" ], - "time": "2019-08-06T08:03:45+00:00" + "support": { + "source": "https://github.com/symfony/polyfill-php81/tree/v1.31.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-09-09T11:45:10+00:00" }, { "name": "symfony/process", - "version": "v4.3.4", + "version": "v7.2.0", "source": { "type": "git", "url": "https://github.com/symfony/process.git", - "reference": "e89969c00d762349f078db1128506f7f3dcc0d4a" + "reference": "d34b22ba9390ec19d2dd966c40aa9e8462f27a7e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/e89969c00d762349f078db1128506f7f3dcc0d4a", - "reference": "e89969c00d762349f078db1128506f7f3dcc0d4a", + "url": "https://api.github.com/repos/symfony/process/zipball/d34b22ba9390ec19d2dd966c40aa9e8462f27a7e", + "reference": "d34b22ba9390ec19d2dd966c40aa9e8462f27a7e", "shasum": "" }, "require": { - "php": "^7.1.3" + "php": ">=8.2" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "4.3-dev" - } - }, "autoload": { "psr-4": { "Symfony\\Component\\Process\\": "" @@ -2686,41 +3967,66 @@ "homepage": "https://symfony.com/contributors" } ], - "description": "Symfony Process Component", + "description": "Executes commands in sub-processes", "homepage": "https://symfony.com", - "time": "2019-08-26T08:26:39+00:00" + "support": { + "source": "https://github.com/symfony/process/tree/v7.2.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-11-06T14:24:19+00:00" }, { "name": "symfony/service-contracts", - "version": "v1.1.6", + "version": "v3.5.1", "source": { "type": "git", "url": "https://github.com/symfony/service-contracts.git", - "reference": "ea7263d6b6d5f798b56a45a5b8d686725f2719a3" + "reference": "e53260aabf78fb3d63f8d79d69ece59f80d5eda0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/service-contracts/zipball/ea7263d6b6d5f798b56a45a5b8d686725f2719a3", - "reference": "ea7263d6b6d5f798b56a45a5b8d686725f2719a3", + "url": "https://api.github.com/repos/symfony/service-contracts/zipball/e53260aabf78fb3d63f8d79d69ece59f80d5eda0", + "reference": "e53260aabf78fb3d63f8d79d69ece59f80d5eda0", "shasum": "" }, "require": { - "php": "^7.1.3", - "psr/container": "^1.0" + "php": ">=8.1", + "psr/container": "^1.1|^2.0", + "symfony/deprecation-contracts": "^2.5|^3" }, - "suggest": { - "symfony/service-implementation": "" + "conflict": { + "ext-psr": "<1.1|>=2" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.1-dev" + "dev-main": "3.5-dev" + }, + "thanks": { + "name": "symfony/contracts", + "url": "https://github.com/symfony/contracts" } }, "autoload": { "psr-4": { "Symfony\\Contracts\\Service\\": "" - } + }, + "exclude-from-classmap": [ + "/Test/" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -2746,32 +4052,44 @@ "interoperability", "standards" ], - "time": "2019-08-20T14:44:19+00:00" + "support": { + "source": "https://github.com/symfony/service-contracts/tree/v3.5.1" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-09-25T14:20:29+00:00" }, { "name": "symfony/stopwatch", - "version": "v4.3.4", + "version": "v7.2.0", "source": { "type": "git", "url": "https://github.com/symfony/stopwatch.git", - "reference": "1e4ff456bd625be5032fac9be4294e60442e9b71" + "reference": "696f418b0d722a4225e1c3d95489d262971ca924" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/stopwatch/zipball/1e4ff456bd625be5032fac9be4294e60442e9b71", - "reference": "1e4ff456bd625be5032fac9be4294e60442e9b71", + "url": "https://api.github.com/repos/symfony/stopwatch/zipball/696f418b0d722a4225e1c3d95489d262971ca924", + "reference": "696f418b0d722a4225e1c3d95489d262971ca924", "shasum": "" }, "require": { - "php": "^7.1.3", - "symfony/service-contracts": "^1.0" + "php": ">=8.2", + "symfony/service-contracts": "^2.5|^3" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "4.3-dev" - } - }, "autoload": { "psr-4": { "Symfony\\Component\\Stopwatch\\": "" @@ -2794,108 +4112,173 @@ "homepage": "https://symfony.com/contributors" } ], - "description": "Symfony Stopwatch Component", + "description": "Provides a way to profile code", "homepage": "https://symfony.com", - "time": "2019-08-07T11:52:19+00:00" + "support": { + "source": "https://github.com/symfony/stopwatch/tree/v7.2.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-09-25T14:21:43+00:00" }, { - "name": "theseer/tokenizer", - "version": "1.1.3", + "name": "symfony/string", + "version": "v7.2.0", "source": { "type": "git", - "url": "https://github.com/theseer/tokenizer.git", - "reference": "11336f6f84e16a720dae9d8e6ed5019efa85a0f9" + "url": "https://github.com/symfony/string.git", + "reference": "446e0d146f991dde3e73f45f2c97a9faad773c82" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/theseer/tokenizer/zipball/11336f6f84e16a720dae9d8e6ed5019efa85a0f9", - "reference": "11336f6f84e16a720dae9d8e6ed5019efa85a0f9", + "url": "https://api.github.com/repos/symfony/string/zipball/446e0d146f991dde3e73f45f2c97a9faad773c82", + "reference": "446e0d146f991dde3e73f45f2c97a9faad773c82", "shasum": "" }, "require": { - "ext-dom": "*", - "ext-tokenizer": "*", - "ext-xmlwriter": "*", - "php": "^7.0" + "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" + }, + "conflict": { + "symfony/translation-contracts": "<2.5" + }, + "require-dev": { + "symfony/emoji": "^7.1", + "symfony/error-handler": "^6.4|^7.0", + "symfony/http-client": "^6.4|^7.0", + "symfony/intl": "^6.4|^7.0", + "symfony/translation-contracts": "^2.5|^3.0", + "symfony/var-exporter": "^6.4|^7.0" }, "type": "library", "autoload": { - "classmap": [ - "src/" + "files": [ + "Resources/functions.php" + ], + "psr-4": { + "Symfony\\Component\\String\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" ] }, "notification-url": "https://packagist.org/downloads/", "license": [ - "BSD-3-Clause" + "MIT" ], "authors": [ { - "name": "Arne Blankerts", - "role": "Developer", - "email": "arne@blankerts.de" + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" } ], - "description": "A small library for converting tokenized PHP source code into XML and potentially other formats", - "time": "2019-06-13T22:48:21+00:00" + "description": "Provides an object-oriented API to strings and deals with bytes, UTF-8 code points and grapheme clusters in a unified way", + "homepage": "https://symfony.com", + "keywords": [ + "grapheme", + "i18n", + "string", + "unicode", + "utf-8", + "utf8" + ], + "support": { + "source": "https://github.com/symfony/string/tree/v7.2.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-11-13T13:31:26+00:00" }, { - "name": "webmozart/assert", - "version": "1.5.0", + "name": "theseer/tokenizer", + "version": "1.2.3", "source": { "type": "git", - "url": "https://github.com/webmozart/assert.git", - "reference": "88e6d84706d09a236046d686bbea96f07b3a34f4" + "url": "https://github.com/theseer/tokenizer.git", + "reference": "737eda637ed5e28c3413cb1ebe8bb52cbf1ca7a2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/webmozart/assert/zipball/88e6d84706d09a236046d686bbea96f07b3a34f4", - "reference": "88e6d84706d09a236046d686bbea96f07b3a34f4", + "url": "https://api.github.com/repos/theseer/tokenizer/zipball/737eda637ed5e28c3413cb1ebe8bb52cbf1ca7a2", + "reference": "737eda637ed5e28c3413cb1ebe8bb52cbf1ca7a2", "shasum": "" }, "require": { - "php": "^5.3.3 || ^7.0", - "symfony/polyfill-ctype": "^1.8" - }, - "require-dev": { - "phpunit/phpunit": "^4.8.36 || ^7.5.13" + "ext-dom": "*", + "ext-tokenizer": "*", + "ext-xmlwriter": "*", + "php": "^7.2 || ^8.0" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.3-dev" - } - }, "autoload": { - "psr-4": { - "Webmozart\\Assert\\": "src/" - } + "classmap": [ + "src/" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ - "MIT" + "BSD-3-Clause" ], "authors": [ { - "name": "Bernhard Schussek", - "email": "bschussek@gmail.com" + "name": "Arne Blankerts", + "email": "arne@blankerts.de", + "role": "Developer" } ], - "description": "Assertions to validate method input/output with nice error messages.", - "keywords": [ - "assert", - "check", - "validate" + "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" + }, + "funding": [ + { + "url": "https://github.com/theseer", + "type": "github" + } ], - "time": "2019-08-24T08:43:50+00:00" + "time": "2024-03-03T12:36:25+00:00" } ], "aliases": [], "minimum-stability": "stable", - "stability-flags": [], + "stability-flags": {}, "prefer-stable": true, "prefer-lowest": false, "platform": { - "php": ">=7.1" + "php": "^7.1|^8.0" }, - "platform-dev": [] + "platform-dev": {}, + "plugin-api-version": "2.6.0" } diff --git a/example/ApplicativeFunctorTest.php b/example/ApplicativeFunctorTest.php index f2ab915..b618f4b 100644 --- a/example/ApplicativeFunctorTest.php +++ b/example/ApplicativeFunctorTest.php @@ -4,10 +4,11 @@ namespace example; +use PHPUnit\Framework\TestCase; use Widmogrod\Primitive\Listt; use function Widmogrod\Functional\fromIterable; -class ApplicativeFunctorTest extends \PHPUnit\Framework\TestCase +class ApplicativeFunctorTest extends TestCase { public function test_it_should_apply_every_function_in_collection_with_every_item_in_second() { diff --git a/example/ApplicatorLiftTest.php b/example/ApplicatorLiftTest.php index 23f2a42..014e288 100644 --- a/example/ApplicatorLiftTest.php +++ b/example/ApplicatorLiftTest.php @@ -4,6 +4,7 @@ namespace example; +use PHPUnit\Framework\TestCase; use Widmogrod\Functional as f; use Widmogrod\Primitive\Listt; @@ -12,7 +13,7 @@ function sum_($a, $b) return $a + $b; } -class ApplicatorLiftTest extends \PHPUnit\Framework\TestCase +class ApplicatorLiftTest extends TestCase { public function test_it_should_sum_all_from_one_list_with_elements_from_second() { diff --git a/example/ComplexErrorDrivenDevelopmentTest.php b/example/ComplexErrorDrivenDevelopmentTest.php index fb7aa2f..f830cad 100644 --- a/example/ComplexErrorDrivenDevelopmentTest.php +++ b/example/ComplexErrorDrivenDevelopmentTest.php @@ -3,6 +3,8 @@ declare(strict_types=1); require_once 'vendor/autoload.php'; +use PHPUnit\Framework\Attributes\DataProvider; +use PHPUnit\Framework\TestCase; use Widmogrod\Functional as f; use Widmogrod\Monad\Either as E; @@ -51,7 +53,7 @@ function updateDatabaseStep(array $request) { return E\tryCatch( f\tee('updateDatabase'), - function (\Exception $e) { + function (Exception $e) { return $e->getMessage(); } )($request); @@ -87,11 +89,9 @@ function handleRequest(array $request) )($request); } -class ComplexErrorDrivenDevelopmentTest extends \PHPUnit\Framework\TestCase +class ComplexErrorDrivenDevelopmentTest extends TestCase { - /** - * @dataProvider provideData - */ + #[DataProvider('provideData')] public function test_it_should_be_prepared_of_errors(array $request, $isError, $expected) { $result = handleRequest($request); @@ -104,40 +104,40 @@ public function test_it_should_be_prepared_of_errors(array $request, $isError, $ $this->assertEquals($expected, f\valueOf($result)); } - public function provideData() + public static function provideData() { return [ 'success case' => [ - '$request' => [ + [ 'name' => 'Jone Doe', 'email' => 'test@example.com' ], - '$isError' => false, - '$expected' => ['status' => 200], + false, + ['status' => 200], ], 'username to short' => [ - '$request' => [ + [ 'name' => '', 'email' => 'test@example.com' ], - '$isError' => true, - '$expected' => ['error' => 'Request name is empty'], + true, + ['error' => 'Request name is empty'], ], 'username to long' => [ - '$request' => [ + [ 'name' => 'asd asdasdlaks askl djalskd jalskdjaslkdjasldjadsa asd', 'email' => 'test@example.com' ], - '$isError' => true, - '$expected' => ['error' => 'Request name is to long'], + true, + ['error' => 'Request name is to long'], ], 'email empty' => [ - '$request' => [ + [ 'name' => 'Jone Doe', 'email' => '' ], - '$isError' => true, - '$expected' => ['error' => 'Request e-mail is empty'], + true, + ['error' => 'Request e-mail is empty'], ], ]; } diff --git a/example/EitherMonadTest.php b/example/EitherMonadTest.php index a1f2d5e..d03dcdd 100644 --- a/example/EitherMonadTest.php +++ b/example/EitherMonadTest.php @@ -4,6 +4,7 @@ namespace example; +use PHPUnit\Framework\TestCase; use Widmogrod\Functional as f; use Widmogrod\Monad\Either; use Widmogrod\Monad\Either as e; @@ -15,7 +16,7 @@ function read($file) : Either\Left::of(sprintf('File "%s" does not exists', $file)); } -class EitherMonadTest extends \PHPUnit\Framework\TestCase +class EitherMonadTest extends TestCase { public function test_it_should_concat_content_of_two_files_only_when_files_exists() { diff --git a/example/ExampleOfTraversableTest.php b/example/ExampleOfTraversableTest.php index 84aa429..0cf2182 100644 --- a/example/ExampleOfTraversableTest.php +++ b/example/ExampleOfTraversableTest.php @@ -4,6 +4,7 @@ namespace example; +use PHPUnit\Framework\TestCase; use Widmogrod\Functional as f; use Widmogrod\Monad\Maybe as m; @@ -12,7 +13,7 @@ function value_is($x) return $x % 2 == 1 ? m\nothing() : m\just($x); } -class ExampleOfTraversableTest extends \PHPUnit\Framework\TestCase +class ExampleOfTraversableTest extends TestCase { public function test_it_traverse_just() { diff --git a/example/FreeBddStyleDSLTest.php b/example/FreeBddStyleDSLTest.php index f76a92d..5fc6552 100644 --- a/example/FreeBddStyleDSLTest.php +++ b/example/FreeBddStyleDSLTest.php @@ -4,16 +4,18 @@ namespace example; +use Exception; use FunctionalPHP\FantasyLand\Functor; +use PHPUnit\Framework\TestCase; use Widmogrod\Monad\Free\MonadFree; use Widmogrod\Monad\Free\Pure; use Widmogrod\Monad\State; -use const Widmogrod\Monad\State\value; use function Widmogrod\Functional\curryN; use function Widmogrod\Functional\push_; use function Widmogrod\Monad\Free\foldFree; use function Widmogrod\Monad\Free\liftF; use function Widmogrod\Useful\matchPatterns; +use const Widmogrod\Monad\State\value; interface ScenarioF extends Functor { @@ -111,7 +113,6 @@ function then_(string $assertion): MonadFree return liftF(new Then($assertion, Pure::of('-then-'))); } - class Scenario { private $free; @@ -226,7 +227,7 @@ function matchRegexp(array $patterns, $value = null) } } - throw new \Exception(sprintf( + throw new Exception(sprintf( 'Cannot match "%s" to list of regexp %s', $value, implode(', ', array_keys($patterns)) @@ -237,7 +238,7 @@ function matchRegexp(array $patterns, $value = null) /** * Inspired by https://github.com/politrons/TestDSL */ -class FreeBddStyleDSLTest extends \PHPUnit\Framework\TestCase +class FreeBddStyleDSLTest extends TestCase { public function test_it_should_interpret_bdd_scenario() { @@ -265,7 +266,8 @@ public function test_it_should_interpret_bdd_scenario() }, ]); - $this->assertInternalType('array', $result); + $this->assertIsArray($result); + $this->assertArrayHasKey('productsCount', $result); $this->assertArrayHasKey('products', $result); diff --git a/example/FreeCalculatorTest.php b/example/FreeCalculatorTest.php index ca5c746..57d2e49 100644 --- a/example/FreeCalculatorTest.php +++ b/example/FreeCalculatorTest.php @@ -5,13 +5,16 @@ namespace example; use FunctionalPHP\FantasyLand\Functor; +use PHPUnit\Framework\Attributes\DataProvider; +use PHPUnit\Framework\TestCase; use Widmogrod\Monad\Free\MonadFree; use Widmogrod\Monad\Free\Pure; use Widmogrod\Monad\Identity; use Widmogrod\Primitive\Stringg; use Widmogrod\Useful\PatternMatcher; -use function Widmogrod\Functional\compose; +use Widmogrod\Useful\PatternNotMatchedError; use function Widmogrod\Functional\bindM2; +use function Widmogrod\Functional\compose; use function Widmogrod\Monad\Free\foldFree; use function Widmogrod\Monad\Free\liftF; use function Widmogrod\Useful\matchPatterns; @@ -126,7 +129,6 @@ public function patternMatched(callable $fn) } } - class Square implements ExpF { private $a; @@ -197,7 +199,7 @@ function square(MonadFree $a): MonadFree * interpretInt :: ExpF -> Identity Free Int * * @return Identity - * @throws \Widmogrod\Useful\PatternNotMatchedError + * @throws PatternNotMatchedError */ function interpretInt(ExpF $f) { @@ -223,7 +225,7 @@ function interpretInt(ExpF $f) * interpretInt :: ExpF -> Identity Free Stringg * * @return Identity - * @throws \Widmogrod\Useful\PatternNotMatchedError + * @throws PatternNotMatchedError */ function interpretPrint(ExpF $f) { @@ -255,7 +257,7 @@ function interpretPrint(ExpF $f) * optimizeCalc :: ExpF -> ExpF * * @return Identity - * @throws \Widmogrod\Useful\PatternNotMatchedError + * @throws PatternNotMatchedError */ function optimizeCalc(ExpF $f) { @@ -277,57 +279,54 @@ function optimizeCalc(ExpF $f) ], $f); } -class FreeCalculatorTest extends \PHPUnit\Framework\TestCase +class FreeCalculatorTest extends TestCase { - /** - * @dataProvider provideCalculations - */ + #[DataProvider('provideCalculations')] public function test_example_with_do_notation($calc, $expected) { $result = foldFree(interpretInt, $calc, Identity::of); $this->assertEquals(Identity::of($expected), $result); } - public function provideCalculations() + public static function provideCalculations() { return [ '1' => [ - '$calc' => int(1), - '$expected' => 1, + int(1), + 1, ], '1 + 1' => [ - '$calc' => sum( + sum( int(1), int(1) ), - '$expected' => 2, + 2, ], '2 * 3' => [ - '$calc' => mul( + mul( int(2), int(3) ), - '$expected' => 6, + 6, ], '(1 + 1) * (2 * 3)' => [ - '$calc' => mul( + mul( sum(int(1), int(1)), mul( int(2), int(3) ) ), - '$expected' => 12, + 12, ], '(2 * 3) ^ 2' => [ - '$calc' => - square( - mul( - int(2), - int(3) - ) - ), - '$expected' => 36, + square( + mul( + int(2), + int(3) + ) + ), + 36, ], ]; } diff --git a/example/FreeDooDSLTest.php b/example/FreeDooDSLTest.php index ed27d2b..8b3196a 100644 --- a/example/FreeDooDSLTest.php +++ b/example/FreeDooDSLTest.php @@ -4,12 +4,13 @@ namespace example; +use PHPUnit\Framework\TestCase; use Widmogrod\Monad\Identity; use function Widmogrod\Monad\Control\Doo\doo; use function Widmogrod\Monad\Control\Doo\in; use function Widmogrod\Monad\Control\Doo\let; -class FreeDooDSLTest extends \PHPUnit\Framework\TestCase +class FreeDooDSLTest extends TestCase { public function test_example_with_do_notation() { diff --git a/example/FreeMonadTest.php b/example/FreeMonadTest.php index 03ee04e..caf7af7 100644 --- a/example/FreeMonadTest.php +++ b/example/FreeMonadTest.php @@ -5,16 +5,18 @@ namespace example2; use FunctionalPHP\FantasyLand\Functor; +use PHPUnit\Framework\Attributes\DataProvider; +use PHPUnit\Framework\TestCase; use Widmogrod\Functional as f; use Widmogrod\Monad\Free as ff; use Widmogrod\Monad\Free\MonadFree; use Widmogrod\Monad\IO; use Widmogrod\Monad\State; use Widmogrod\Primitive\Listt; -use const Widmogrod\Monad\IO\pure; -use const Widmogrod\Monad\State\value; use function Widmogrod\Functional\fromNil; use function Widmogrod\Useful\matchPatterns; +use const Widmogrod\Monad\IO\pure; +use const Widmogrod\Monad\State\value; interface TeletypeF extends Functor { @@ -179,11 +181,9 @@ function echo_composition_() )(); } -class FreeMonadTest extends \PHPUnit\Framework\TestCase +class FreeMonadTest extends TestCase { - /** - * @dataProvider provideEchoImplementation - */ + #[DataProvider('provideEchoImplementation')] public function test_it_should_allow_to_interpret_as_a_state_monad(MonadFree $echo) { $result = ff\foldFree(interpretState, $echo, value); @@ -197,9 +197,7 @@ public function test_it_should_allow_to_interpret_as_a_state_monad(MonadFree $ec ])); } - /** - * @dataProvider provideEchoImplementation - */ + #[DataProvider('provideEchoImplementation')] public function test_it_should_allow_to_interpret_as_IO(MonadFree $echo) { $result = ff\foldFree(interpretIO, $echo, pure); @@ -210,7 +208,7 @@ public function test_it_should_allow_to_interpret_as_IO(MonadFree $echo) // $result->run(); } - public function provideEchoImplementation() + public static function provideEchoImplementation() { return [ 'echo implementation via explicit chaining (bind)' => [echo_chaining_()], diff --git a/example/FreeUnionTypeGeneratorTest.php b/example/FreeUnionTypeGeneratorTest.php index d31743b..e422b30 100644 --- a/example/FreeUnionTypeGeneratorTest.php +++ b/example/FreeUnionTypeGeneratorTest.php @@ -5,12 +5,14 @@ namespace example; use FunctionalPHP\FantasyLand\Functor; +use PHPUnit\Framework\TestCase; use Widmogrod\Monad\Free\MonadFree; use Widmogrod\Monad\Free\Pure; use Widmogrod\Monad\Identity; use Widmogrod\Primitive\Listt; use Widmogrod\Primitive\Stringg; use Widmogrod\Useful\PatternMatcher; +use Widmogrod\Useful\PatternNotMatchedError; use function Widmogrod\Functional\compose; use function Widmogrod\Functional\curryN; use function Widmogrod\Functional\fromIterable; @@ -101,7 +103,6 @@ public function patternMatched(callable $fn) } } - class Derived_ implements UnionF { private $a; @@ -233,7 +234,6 @@ public function __construct(%s) { $constructorWithProps = count($args) ? $constructorWithProps : ''; - return Stringg::of(sprintf( "class %s implements %s { %s @@ -257,9 +257,9 @@ public function __toString() const interpretTypesAndGenerate = 'example\interpretTypesAndGenerate'; /** - * @param UnionF $f + * @param UnionF $f * @return Identity - * @throws \Widmogrod\Useful\PatternNotMatchedError + * @throws PatternNotMatchedError */ function interpretTypesAndGenerate(UnionF $f): Identity { @@ -285,9 +285,9 @@ function interpretTypesAndGenerate(UnionF $f): Identity return Identity::of($a)->map($next); } ], $f); -}; +} -class FreeUnionTypeGeneratorTest extends \PHPUnit\Framework\TestCase +class FreeUnionTypeGeneratorTest extends TestCase { public function test_example_1() { diff --git a/example/FunctorCollectionTest.php b/example/FunctorCollectionTest.php index 5b79df5..20674dc 100644 --- a/example/FunctorCollectionTest.php +++ b/example/FunctorCollectionTest.php @@ -4,9 +4,10 @@ namespace example; +use PHPUnit\Framework\TestCase; use function Widmogrod\Functional\fromIterable; -class FunctorCollectionTest extends \PHPUnit\Framework\TestCase +class FunctorCollectionTest extends TestCase { public function test_it_should_return_new_map() { diff --git a/example/ListComprehensionWithMonadTest.php b/example/ListComprehensionWithMonadTest.php index 552d8cd..090a00e 100644 --- a/example/ListComprehensionWithMonadTest.php +++ b/example/ListComprehensionWithMonadTest.php @@ -4,10 +4,11 @@ namespace example; +use PHPUnit\Framework\TestCase; use function Widmogrod\Functional\fromIterable; use function Widmogrod\Functional\fromValue; -class ListComprehensionWithMonadTest extends \PHPUnit\Framework\TestCase +class ListComprehensionWithMonadTest extends TestCase { public function test_it_should_combine_two_lists() { diff --git a/example/MaybeMonadAndCollectionTest.php b/example/MaybeMonadAndCollectionTest.php index fd35930..5bc9bb1 100644 --- a/example/MaybeMonadAndCollectionTest.php +++ b/example/MaybeMonadAndCollectionTest.php @@ -4,17 +4,17 @@ namespace example; +use PHPUnit\Framework\Attributes\DataProvider; +use PHPUnit\Framework\TestCase; use Widmogrod\Functional as f; use Widmogrod\Monad\Maybe; -use const Widmogrod\Monad\Maybe\maybeNull; use function Widmogrod\Monad\Maybe\just; use function Widmogrod\Monad\Maybe\nothing; +use const Widmogrod\Monad\Maybe\maybeNull; -class MaybeMonadAndCollectionTest extends \PHPUnit\Framework\TestCase +class MaybeMonadAndCollectionTest extends TestCase { - /** - * @dataProvider provideData - */ + #[DataProvider('provideData')] public function test_it_should_extract_elements_which_exists($data) { // $get :: String a -> [b] -> Maybe b @@ -40,9 +40,7 @@ public function test_it_should_extract_elements_which_exists($data) ); } - /** - * @dataProvider provideData - */ + #[DataProvider('provideData')] public function test_it_should_extract_elements_which_exists_alternative_solution($data) { // $get :: String a -> Maybe [b] -> Maybe b @@ -66,11 +64,11 @@ public function test_it_should_extract_elements_which_exists_alternative_solutio ); } - public function provideData() + public static function provideData() { return [ 'default' => [ - '$data' => [ + [ ['id' => 1, 'meta' => ['images' => ['//first.jpg', '//second.jpg']]], ['id' => 2, 'meta' => ['images' => ['//third.jpg']]], ['id' => 3], diff --git a/example/MaybeMonoidTest.php b/example/MaybeMonoidTest.php index f75455e..23e6f2c 100644 --- a/example/MaybeMonoidTest.php +++ b/example/MaybeMonoidTest.php @@ -2,20 +2,20 @@ declare(strict_types=1); +use PHPUnit\Framework\Attributes\DataProvider; +use PHPUnit\Framework\TestCase; use Widmogrod\Functional as f; use Widmogrod\Monad\Maybe\Just; use Widmogrod\Monad\Maybe\Maybe; use Widmogrod\Primitive\Stringg; -use const Widmogrod\Monad\Maybe\maybeNull; use function Widmogrod\Functional\map; use function Widmogrod\Monad\Maybe\just; use function Widmogrod\Monad\Maybe\maybeNull; +use const Widmogrod\Monad\Maybe\maybeNull; -class MaybeMonoidTest extends \PHPUnit\Framework\TestCase +class MaybeMonoidTest extends TestCase { - /** - * @dataProvider provideData - */ + #[DataProvider('provideData')] public function test_it_should_concat_only_strings_and_skip_nulls(array $data, array $expected, string $asString) { $fullName = f\fromIterable($data) @@ -27,9 +27,7 @@ public function test_it_should_concat_only_strings_and_skip_nulls(array $data, a $this->assertEquals($fullName, just(Stringg::of($asString))); } - /** - * @dataProvider provideData - */ + #[DataProvider('provideData')] public function test_it_should_concat_only_just_values_naive_string_implementation(array $data, array $expected, string $asString) { // $makeMaybeMonoid :: string -> Maybe Stringg @@ -52,9 +50,7 @@ public function test_it_should_concat_only_just_values_naive_string_implementati $this->assertEquals($fullName, just(Stringg::of($asString))); } - /** - * @dataProvider provideData - */ + #[DataProvider('provideData')] public function test_it_should_concat_only_just_values_list_naive_implementation2(array $data, array $expected) { // $makeMaybeMonoid :: string -> Maybe Listt string @@ -77,26 +73,26 @@ public function test_it_should_concat_only_just_values_list_naive_implementation $this->assertEquals($fullName, just(f\fromIterable($expected))); } - public function provideData() + public static function provideData() { return [ 'array with null values' => [ - '$data' => [ + [ 'firstName' => 'First', 'middleName' => null, 'lastName' => 'Last' ], - '$expected' => ['First', 'Last'], - '$asString' => 'FirstLast', + ['First', 'Last'], + 'FirstLast', ], 'array with strings' => [ - '$data' => [ + [ 'firstName' => 'First', 'middleName' => 'Middle', 'lastName' => 'Last' ], - '$expected' => ['First', 'Middle', 'Last'], - '$asString' => 'FirstMiddleLast', + ['First', 'Middle', 'Last'], + 'FirstMiddleLast', ] ]; } diff --git a/example/ParserTest.php b/example/ParserTest.php index 4c749ff..b3366be 100644 --- a/example/ParserTest.php +++ b/example/ParserTest.php @@ -4,12 +4,15 @@ namespace example; +use PHPUnit\Framework\Attributes\DataProvider; +use PHPUnit\Framework\TestCase; use Widmogrod\Monad\Identity; use Widmogrod\Monad\Maybe\Just; use Widmogrod\Monad\Maybe\Maybe; use Widmogrod\Primitive\EmptyListError; use Widmogrod\Primitive\Listt; use Widmogrod\Primitive\Stringg; +use function is_numeric; use function Widmogrod\Functional\append; use function Widmogrod\Functional\bind; use function Widmogrod\Functional\concatM; @@ -33,7 +36,6 @@ require_once __DIR__ . '/FreeCalculatorTest.php'; require_once __DIR__ . '/FreeUnionTypeGeneratorTest.php'; - /** * match :: Monoid a, Semigroup a, Setoid a => (a -> Bool) -> [a] -> Maybe (a, [a]) * numbers :: [a] -> Maybe (a, [a]) @@ -60,7 +62,7 @@ */ // match :: Monoid a, Semigroup a, Setoid a => (a -> a -> Bool) -> [a] -> Maybe (a, [a]) -function matchP(callable $predicate, Listt $a = null) +function matchP(callable $predicate, ?Listt $a = null) { return curryN(2, function (callable $predicate, Listt $a) { try { @@ -97,12 +99,12 @@ function matchP(callable $predicate, Listt $a = null) function numbersP(Listt $a) { return matchP(function (Stringg $s) { - return \is_numeric($s->extract()); + return is_numeric($s->extract()); }, $a); } // char :: Char -> [a] -> Maybe (a, [a]) -function charP(string $char, Listt $a = null) +function charP(string $char, ?Listt $a = null) { return curryN(2, function (string $char, Listt $a) { try { @@ -131,7 +133,7 @@ function maybeMapFirst(callable $fn) } // tokenize' :: ([a] -> Maybe (a, [a])) -> (a -> b) -> [a] -> Maybe (b, [a]) -function tokenizeP(callable $matcher, callable $transform = null, Listt $a = null) +function tokenizeP(callable $matcher, ?callable $transform = null, ?Listt $a = null) { return curryN(3, function (callable $matcher, callable $transform, Listt $a) { return bind(maybeMapFirst($transform), $matcher($a)); @@ -139,7 +141,7 @@ function tokenizeP(callable $matcher, callable $transform = null, Listt $a = nul } // allof' :: ([([a] -> Maybe (b, [a]))] -> ([b] -> b) -> [a] -> Maybe (b, [a]) -function allOfP(Listt $matchers, callable $transform = null, Listt $a = null) +function allOfP(Listt $matchers, ?callable $transform = null, ?Listt $a = null) { return curryN(3, function (Listt $matchers, callable $transform, Listt $a) { $result = reduce(function (?Maybe $b, callable $matcher) use ($a) { @@ -162,10 +164,9 @@ function allOfP(Listt $matchers, callable $transform = null, Listt $a = null) })(...func_get_args()); } - // many' :: ([([a] -> Maybe (b, [a]))] -> ([b] -> b) -> [a] -> Maybe (b, [a]) // Zero or more. -function manyP(Listt $matchers, callable $transform = null, Listt $a = null) +function manyP(Listt $matchers, ?callable $transform = null, ?Listt $a = null) { return curryN(3, function (Listt $matchers, callable $transform, Listt $a) { $res = fromNil(); @@ -192,7 +193,7 @@ function manyP(Listt $matchers, callable $transform = null, Listt $a = null) } // oneof' :: ([([a] -> Maybe b)] -> [a] -> Maybe b -function oneOfP(Listt $matchers, Listt $a = null) +function oneOfP(Listt $matchers, ?Listt $a = null) { return curryN(2, function (Listt $matchers, Listt $a) { $result = reduce(function (?Maybe $b, callable $matcher) use ($a) { @@ -208,7 +209,7 @@ function oneOfP(Listt $matchers, Listt $a = null) } // endByP :: ([a] -> Maybe b) -> ([a] -> Maybe b) -> [a] -> Maybe [b] -function endByP(callable $matcher, callable $matcherEnd = null, callable $transform = null, Listt $a = null) +function endByP(?callable $matcher, ?callable $matcherEnd = null, ?callable $transform = null, ?Listt $a = null) { return curryN(4, function (callable $matcher, callable $matcherEnd, callable $transform, Listt $a): Maybe { $before = fromNil(); @@ -250,7 +251,7 @@ function endByP(callable $matcher, callable $matcherEnd = null, callable $transf })(...func_get_args()); } -function maybeP(callable $matcher, Listt $a = null) +function maybeP(callable $matcher, ?Listt $a = null) { return curryN(2, function (callable $matcher, Listt $a) { $r = $matcher($a); @@ -261,9 +262,8 @@ function maybeP(callable $matcher, Listt $a = null) })(...func_get_args()); } - // lazyP :: ([a] -> Maybe b) -> [a] -> Maybe [b] -function lazyP(callable $fn, Listt $a = null) +function lazyP(callable $fn, ?Listt $a = null) { return curryN(2, function (callable $fn, Listt $a) { return $fn($a); @@ -297,7 +297,7 @@ function tokens(string $input): Listt return $tokens; } -class ParserTest extends \PHPUnit\Framework\TestCase +class ParserTest extends TestCase { public function test_generated_ast() { @@ -456,7 +456,7 @@ public function test_integration_with_free_calc() public function test_generate_data_types_as_array() { // lexeme :: ([a] -> Maybe (a, [a])) -> [a] -> Maybe (a, [a]) - $lexeme = function (callable $fn, Listt $a = null) { + $lexeme = function (callable $fn, ?Listt $a = null) { return curryN(2, function (callable $fn, Listt $a) { // TODO Not optimal, for test only $trimNil = dropWhile(function (Stringg $s) { @@ -468,7 +468,7 @@ public function test_generate_data_types_as_array() }; // lexeme :: ([a] -> Maybe (a, [a])) -> [a] -> Maybe (a, [a]) - $lexeme2 = function (callable $fn, Listt $a = null) { + $lexeme2 = function (callable $fn, ?Listt $a = null) { return curryN(2, function (callable $fn, Listt $a) { $trimNil = dropWhile(function (Stringg $s) { return trim($s->extract(), " ") === ""; @@ -479,7 +479,7 @@ public function test_generate_data_types_as_array() }; // lexeme :: ([a] -> Maybe (a, [a])) -> [a] -> Maybe (a, [a]) - $lexemeOr = function (callable $fn, Listt $a = null) { + $lexemeOr = function (callable $fn, ?Listt $a = null) { return curryN(2, function (callable $fn, Listt $a) { $trimNil = dropWhile(function (Stringg $s) { return trim($s->extract(), " \0\n\t\r|") === ""; @@ -632,7 +632,7 @@ public function test_generate_data_types_as_array() public function buildParserForDataTypes() { // lexeme :: ([a] -> Maybe (a, [a])) -> [a] -> Maybe (a, [a]) - $lexeme = function (callable $fn, Listt $a = null) { + $lexeme = function (callable $fn, ?Listt $a = null) { return curryN(2, function (callable $fn, Listt $a) { // TODO Not optimal, for test only $trimNil = dropWhile(function (Stringg $s) { @@ -644,7 +644,7 @@ public function buildParserForDataTypes() }; // lexeme :: ([a] -> Maybe (a, [a])) -> [a] -> Maybe (a, [a]) - $lexeme2 = function (callable $fn, Listt $a = null) { + $lexeme2 = function (callable $fn, ?Listt $a = null) { return curryN(2, function (callable $fn, Listt $a) { $trimNil = dropWhile(function (Stringg $s) { return trim($s->extract(), " ") === ""; @@ -655,7 +655,7 @@ public function buildParserForDataTypes() }; // lexeme :: ([a] -> Maybe (a, [a])) -> [a] -> Maybe (a, [a]) - $lexemeOr = function (callable $fn, Listt $a = null) { + $lexemeOr = function (callable $fn, ?Listt $a = null) { return curryN(2, function (callable $fn, Listt $a) { $trimNil = dropWhile(function (Stringg $s) { return trim($s->extract(), " \0\n\t\r|") === ""; @@ -765,7 +765,6 @@ public function buildParserForDataTypes() return declaree($declaration, fromValue($derived)); }); - $expression = manyP(fromIterable([ $declarationDerived, $declaration, @@ -776,9 +775,7 @@ public function buildParserForDataTypes() return $expression; } - /** - * @dataProvider provideGeneratedCode - */ + #[DataProvider('provideGeneratedCode')] public function test_generate_data_types_as_free_string(string $input, string $expectedFileContents) { $tokens = tokens($input); @@ -794,24 +791,24 @@ public function test_generate_data_types_as_free_string(string $input, string $e $this->assertEquals($expected, $generated); } - public function provideGeneratedCode() + public static function provideGeneratedCode() { return [ 'data A = B deriving (Show)' => [ - '$declaration' => 'data A = B deriving (Show)', - '$toImplementation' => 'A.txt', + 'data A = B deriving (Show)', + 'A.txt', ], 'data Maybe a = Just a | Nothing' => [ - '$declaration' => 'data Maybe a = Just a | Nothing', - '$toImplementation' => 'Maybe.txt', + 'data Maybe a = Just a | Nothing', + 'Maybe.txt', ], 'data Either a b = Left a | Right b' => [ - '$declaration' => 'data Either a b = Left a | Right b', - '$toImplementation' => 'Either.txt', + 'data Either a b = Left a | Right b', + 'Either.txt', ], 'data FreeT f a = Pure a | Free f (FreeT f a)' => [ - '$declaration' => 'data FreeT f a = Pure a | Free f (FreeT f a)', - '$toImplementation' => 'FreeT.txt', + 'data FreeT f a = Pure a | Free f (FreeT f a)', + 'FreeT.txt', ], ]; } diff --git a/example/ReaderMonadTest.php b/example/ReaderMonadTest.php index f41f7c6..39b4ce0 100644 --- a/example/ReaderMonadTest.php +++ b/example/ReaderMonadTest.php @@ -4,6 +4,7 @@ namespace example; +use PHPUnit\Framework\TestCase; use Widmogrod\Monad\Reader as R; function hello($name) @@ -19,7 +20,7 @@ function ask($content) }); } -class ReaderMonadTest extends \PHPUnit\Framework\TestCase +class ReaderMonadTest extends TestCase { public function test_it_should_pass_the_name_around() { diff --git a/example/StateMonadTest.php b/example/StateMonadTest.php index db5b779..249ade5 100644 --- a/example/StateMonadTest.php +++ b/example/StateMonadTest.php @@ -4,6 +4,8 @@ namespace example; +use PHPUnit\Framework\Attributes\DataProvider; +use PHPUnit\Framework\TestCase; use Widmogrod\Monad\Maybe; use Widmogrod\Monad\State as S; @@ -88,11 +90,9 @@ function retrieveRelated($productName) }); } -class StateMonadTest extends \PHPUnit\Framework\TestCase +class StateMonadTest extends TestCase { - /** - * @dataProvider provideData - */ + #[DataProvider('provideData')] public function test_demonstrate_state_monad($expectedProducts) { $initialState = new InMemoryCache([]); @@ -113,11 +113,11 @@ public function test_demonstrate_state_monad($expectedProducts) $this->assertSame($outputState1, $outputState2); } - public function provideData() + public static function provideData() { return [ 'default' => [ - '$expectedProducts' => ['iPhone 5', 'iPhone 6s'], + ['iPhone 5', 'iPhone 6s'], ], ]; } diff --git a/example/WriterMonadTest.php b/example/WriterMonadTest.php index 88edea2..f3abfc8 100644 --- a/example/WriterMonadTest.php +++ b/example/WriterMonadTest.php @@ -4,11 +4,12 @@ namespace example; +use PHPUnit\Framework\TestCase; use Widmogrod\Functional as f; use Widmogrod\Monad\Writer as W; use Widmogrod\Primitive\Stringg as S; -class WriterMonadTest extends \PHPUnit\Framework\TestCase +class WriterMonadTest extends TestCase { public function test_it_should_filter_with_logs() { diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 5702446..e787b85 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -1,6 +1,17 @@ + xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xsd" + bootstrap="vendor/autoload.php" + cacheDirectory=".phpunit.cache" + executionOrder="depends,defects" + shortenArraysForExportThreshold="10" + requireCoverageMetadata="false" + beStrictAboutCoverageMetadata="true" + beStrictAboutOutputDuringTests="true" + displayDetailsOnPhpunitDeprecations="true" + failOnPhpunitDeprecation="false" + failOnRisky="true" + failOnWarning="true"> ./test/Functional @@ -18,9 +29,16 @@ ./example/ - - - ./src/ - - + + + + + + + + src + + diff --git a/src/Common/ValueOfTrait.php b/src/Common/ValueOfTrait.php index b45bef1..f4b3f92 100644 --- a/src/Common/ValueOfTrait.php +++ b/src/Common/ValueOfTrait.php @@ -4,6 +4,8 @@ namespace Widmogrod\Common; +use function Widmogrod\Functional\valueOf; + trait ValueOfTrait { /** @@ -13,6 +15,6 @@ trait ValueOfTrait */ public function extract() { - return \Widmogrod\Functional\valueOf($this->value); + return valueOf($this->value); } } diff --git a/src/Functional/functions.php b/src/Functional/functions.php index bfd10c0..0a48d44 100644 --- a/src/Functional/functions.php +++ b/src/Functional/functions.php @@ -4,11 +4,14 @@ namespace Widmogrod\Functional; +use Closure; +use Exception; use FunctionalPHP\FantasyLand\Applicative; use FunctionalPHP\FantasyLand\Foldable; use FunctionalPHP\FantasyLand\Functor; use FunctionalPHP\FantasyLand\Monad; use FunctionalPHP\FantasyLand\Traversable; +use ReflectionFunction; use Widmogrod\Common\ValueOfInterface; use Widmogrod\Primitive\Listt; use Widmogrod\Primitive\ListtCons; @@ -83,7 +86,7 @@ function curryN($numberOfArguments, callable $function, array $args = []) */ function curry(callable $function, array $args = []) { - $reflectionOfFunction = new \ReflectionFunction(\Closure::fromCallable($function)); + $reflectionOfFunction = new ReflectionFunction(Closure::fromCallable($function)); $numberOfArguments = count($reflectionOfFunction->getParameters()); // We cant expect more arguments than are defined in function @@ -123,7 +126,7 @@ function valueOf($value) * @param callable $function * @param mixed $value * - * @return \Closure + * @return Closure */ function tee(callable $function, $value = null) { @@ -144,9 +147,9 @@ function tee(callable $function, $value = null) * * Call $function with arguments in reversed order * - * @return \Closure + * @param callable $function + * @return Closure * - * @param callable $function */ function reverse(callable $function) { @@ -163,10 +166,10 @@ function reverse(callable $function) /** * map :: Functor f => (a -> b) -> f a -> f b * - * @return mixed|\Closure + * @param callable $transformation + * @param Functor $value + * @return mixed|Closure * - * @param callable $transformation - * @param Functor $value */ function map(callable $transformation, ?Functor $value = null) { @@ -183,10 +186,10 @@ function map(callable $transformation, ?Functor $value = null) /** * bind :: Monad m => (a -> m b) -> m a -> m b * - * @return mixed|\Closure + * @param callable $function + * @param Monad $value + * @return mixed|Closure * - * @param callable $function - * @param Monad $value */ function bind(callable $function, ?Monad $value = null) { @@ -254,7 +257,7 @@ function reduce(callable $callable, $accumulator = null, ?Foldable $foldable = n * * @return mixed */ -function foldr(callable $callable, $accumulator = null, ?Foldable $foldable = null) +function foldr(callable $callback, mixed $initialValue = null, ?Foldable $inputFoldable = null) { return curryN(3, function ( callable $callable, @@ -280,7 +283,7 @@ function foldr(callable $callable, $accumulator = null, ?Foldable $foldable = nu * @param callable $predicate * @param Foldable $list * - * @return Foldable|\Closure + * @return Foldable|Closure */ function filter(callable $predicate, ?Foldable $list = null) { @@ -305,7 +308,7 @@ function filter(callable $predicate, ?Foldable $list = null) * @param callable $a * @param callable $b,... * - * @return \Closure func($mValue) : mixed + * @return Closure func($mValue) : mixed */ function mpipeline(callable $a, callable $b) { @@ -326,7 +329,7 @@ function mpipeline(callable $a, callable $b) * @param callable $a * @param callable $b,... * - * @return \Closure func($mValue) : mixed + * @return Closure func($mValue) : mixed */ function mcompose(callable $a, callable $b) { @@ -341,7 +344,7 @@ function mcompose(callable $a, callable $b) * * @param callable $function * @param callable $catchFunction - * @param $value + * @param $value * * @return mixed */ @@ -350,7 +353,7 @@ function tryCatch(callable $function, callable $catchFunction, $value) return curryN(3, function (callable $function, callable $catchFunction, $value) { try { return $function($value); - } catch (\Exception $e) { + } catch (Exception $e) { return $catchFunction($e); } })(...func_get_args()); @@ -364,11 +367,11 @@ function tryCatch(callable $function, callable $catchFunction, $value) /** * reThrow :: Exception e => e -> a * - * @param \Exception $e + * @param Exception $e * - * @throws \Exception + * @throws Exception */ -function reThrow(\Exception $e) +function reThrow(Exception $e) { throw $e; } @@ -391,7 +394,7 @@ function reThrow(\Exception $e) * @param Monad $ma * @param Monad $mb * - * @return Monad|\Closure + * @return Monad|Closure */ function liftM2( ?callable $transformation = null, @@ -416,7 +419,7 @@ function liftM2( * @param Monad $ma * @param Monad $mb * - * @return Monad|\Closure + * @return Monad|Closure */ function bindM2( ?callable $transformation = null, @@ -451,7 +454,7 @@ function ( * @param Applicative $fa * @param Applicative $fb * - * @return Applicative|\Closure + * @return Applicative|Closure */ function liftA2( ?callable $transformation = null, @@ -489,7 +492,7 @@ function liftA2( * @param Monad $a * @param Monad $b * - * @return Monad|\Closure + * @return Monad|Closure */ function sequenceM(Monad $a, ?Monad $b = null): Monad { @@ -517,7 +520,7 @@ function sequenceM(Monad $a, ?Monad $b = null): Monad * @param callable $transformation (a -> f b) * @param Traversable $t t a * - * @return \Closure|Applicative f (t b) + * @return Closure|Applicative f (t b) */ function traverse(callable $transformation, ?Traversable $t = null) { @@ -540,7 +543,7 @@ function traverse(callable $transformation, ?Traversable $t = null) * @param callable $f (a -> m Bool) * @param Foldable $xs [a] * - * @return \Closure|Monad m [a] + * @return Closure|Monad m [a] */ function filterM(callable $f, ?Foldable $xs = null) { diff --git a/src/Functional/infinit.php b/src/Functional/infinit.php index 2513754..52d8206 100644 --- a/src/Functional/infinit.php +++ b/src/Functional/infinit.php @@ -4,6 +4,7 @@ namespace Widmogrod\Functional; +use Closure; use Widmogrod\Primitive\EmptyListError; use Widmogrod\Primitive\Listt; use Widmogrod\Primitive\ListtCons; @@ -22,9 +23,9 @@ * ```haskell * iterate f x == [x, f x, f (f x), ...] * ``` - * @param callable $fn - * @param mixed $a - * @return Listt|\Closure + * @param callable $fn + * @param mixed $a + * @return Listt|Closure */ function iterate(callable $fn, $a = null) { @@ -45,7 +46,7 @@ function iterate(callable $fn, $a = null) * * repeat x is an infinite list, with x the value of every element. * - * @param $a + * @param $a * @return ListtCons */ function repeat($a) @@ -66,9 +67,9 @@ function repeat($a) * replicate n x is a list of length n with x the value of every element. * It is an instance of the more general genericReplicate, in which n may be of any integral type. * - * @param int $n - * @param mixed $a - * @return Listt|\Closure + * @param int $n + * @param mixed $a + * @return Listt|Closure */ function replicate(int $n, $a = null): Listt { @@ -97,7 +98,7 @@ function cycle(Listt $xs): Listt throw new EmptyListError(__FUNCTION__); } - $cycle = function (Listt $xs, Listt $cycled) use (&$cycle) : Listt { + $cycle = function (Listt $xs, Listt $cycled) use (&$cycle): Listt { if ($cycled instanceof ListtNil) { return cycle($xs); } diff --git a/src/Functional/listt.php b/src/Functional/listt.php index 7146106..3af9da8 100644 --- a/src/Functional/listt.php +++ b/src/Functional/listt.php @@ -4,7 +4,11 @@ namespace Widmogrod\Functional; +use ArrayObject; +use Closure; use FunctionalPHP\FantasyLand\Foldable; +use IteratorAggregate; +use Widmogrod\Primitive\EmptyListError; use Widmogrod\Primitive\Listt; use Widmogrod\Primitive\ListtCons; use Widmogrod\Useful\SnapshotIterator; @@ -25,10 +29,10 @@ function fromIterable(iterable $i): Listt { if (is_array($i)) { - $i = new \ArrayObject($i); + $i = new ArrayObject($i); } - if ($i instanceof \IteratorAggregate) { + if ($i instanceof IteratorAggregate) { $i = $i->getIterator(); } @@ -128,9 +132,9 @@ function concat(Foldable $xs): Listt /** * prepend :: a -> [a] -> [a] * - * @param mixed $x - * @param Listt $xs - * @return Listt|\Closure + * @param mixed $x + * @param Listt $xs + * @return Listt|Closure */ function prepend($x, ?Listt $xs = null) { @@ -177,9 +181,9 @@ function append(Listt $a, ?Listt $b = null) * * Extract the first element of a list, which must be non-empty. * - * @param Listt $l + * @param Listt $l * @return mixed - * @throws \Widmogrod\Primitive\EmptyListError + * @throws EmptyListError */ function head(Listt $l) { @@ -196,9 +200,9 @@ function head(Listt $l) * * Extract the elements after the head of a list, which must be non-empty. * - * @param Listt $l + * @param Listt $l * @return Listt - * @throws \Widmogrod\Primitive\EmptyListError + * @throws EmptyListError */ function tail(Listt $l) { diff --git a/src/Functional/miscellaneous.php b/src/Functional/miscellaneous.php index 9c58d1b..c9331de 100644 --- a/src/Functional/miscellaneous.php +++ b/src/Functional/miscellaneous.php @@ -4,6 +4,8 @@ namespace Widmogrod\Functional; +use Closure; + /** * @var callable */ @@ -39,8 +41,8 @@ function identity($x) * [42,42,42,42] * ``` * - * @param $a - * @param $b + * @param $a + * @param $b * @return callable */ function constt($a, $b = null) @@ -50,7 +52,6 @@ function constt($a, $b = null) })(...func_get_args()); } - /** * @var callable */ @@ -70,7 +71,7 @@ function constt($a, $b = null) * @param callable $a * @param callable $b,... * - * @return \Closure func($value) : mixed + * @return Closure func($value) : mixed */ function compose(callable $a, callable $b) { @@ -94,7 +95,7 @@ function compose(callable $a, callable $b) * @param callable $a * @param callable $b,... * - * @return \Closure func($value) : mixed + * @return Closure func($value) : mixed */ function pipeline(callable $a, callable $b) { diff --git a/src/Functional/monoid.php b/src/Functional/monoid.php index 59b90cd..e90f362 100644 --- a/src/Functional/monoid.php +++ b/src/Functional/monoid.php @@ -4,6 +4,7 @@ namespace Widmogrod\Functional; +use Closure; use FunctionalPHP\FantasyLand\Monoid; use FunctionalPHP\FantasyLand\Semigroup; @@ -29,7 +30,7 @@ function emptyM(Monoid $a): Monoid * @param Semigroup $a * @param Semigroup|null $b * - * @return Semigroup|\Closure + * @return Semigroup|Closure */ function concatM(Semigroup $a, ?Semigroup $b = null) { diff --git a/src/Functional/predicates.php b/src/Functional/predicates.php index bb3c015..3f3b913 100644 --- a/src/Functional/predicates.php +++ b/src/Functional/predicates.php @@ -4,6 +4,8 @@ namespace Widmogrod\Functional; +use Closure; + const eql = 'Widmogrod\Functional\eql'; /** @@ -12,7 +14,7 @@ * @param mixed $expected * @param mixed $value * - * @return bool|\Closure + * @return bool|Closure */ function eql($expected, $value = null) { @@ -29,7 +31,7 @@ function eql($expected, $value = null) * @param mixed $expected * @param mixed $value * - * @return bool|\Closure + * @return bool|Closure */ function lt($expected, $value = null) { @@ -38,7 +40,6 @@ function lt($expected, $value = null) })(...func_get_args()); } - const orr = 'Widmogrod\Functional\orr'; /** @@ -48,7 +49,7 @@ function lt($expected, $value = null) * @param callable|null $predicateB * @param mixed $value * - * @return bool|\Closure + * @return bool|Closure */ function orr(callable $predicateA, ?callable $predicateB = null, $value = null) { diff --git a/src/Functional/setoid.php b/src/Functional/setoid.php index b07bd79..a91bfc1 100644 --- a/src/Functional/setoid.php +++ b/src/Functional/setoid.php @@ -4,6 +4,7 @@ namespace Widmogrod\Functional; +use Closure; use FunctionalPHP\FantasyLand\Setoid; const equal = 'Widmogrod\Functional\equal'; @@ -14,11 +15,11 @@ * @param Setoid $a * @param Setoid $b * - * @return bool|\Closure + * @return bool|Closure */ function equal(Setoid $a, ?Setoid $b = null) { - return curryN(2, function (Setoid $a, Setoid $b):bool { + return curryN(2, function (Setoid $a, Setoid $b): bool { return $a->equals($b); })(...func_get_args()); } diff --git a/src/Functional/strings.php b/src/Functional/strings.php index 31f4e7f..fe25199 100644 --- a/src/Functional/strings.php +++ b/src/Functional/strings.php @@ -4,6 +4,8 @@ namespace Widmogrod\Functional; +use Closure; + const concatStrings = 'Widmogrod\Functional\concatStrings'; /** @@ -12,7 +14,7 @@ * @param string $a * @param string|null $b * - * @return string|\Closure + * @return string|Closure */ function concatStrings($a, $b = null) { diff --git a/src/Functional/sublist.php b/src/Functional/sublist.php index eb1faec..ab98731 100644 --- a/src/Functional/sublist.php +++ b/src/Functional/sublist.php @@ -4,6 +4,7 @@ namespace Widmogrod\Functional; +use Closure; use Widmogrod\Primitive\EmptyListError; use Widmogrod\Primitive\Listt; use Widmogrod\Primitive\ListtCons; @@ -19,9 +20,9 @@ * * take n, applied to a list xs, returns the prefix of xs of length n, or xs itself if n > length xs: * - * @param int $n - * @param Listt $xs - * @return Listt|\Closure + * @param int $n + * @param Listt $xs + * @return Listt|Closure */ function take(int $n, ?Listt $xs = null) { @@ -45,9 +46,9 @@ function take(int $n, ?Listt $xs = null) * drop :: Int -> [a] -> [a] * * drop n xs returns the suffix of xs after the first n elements, or [] if n > length xs: - * @param int $n - * @param Listt $xs - * @return Listt|\Closure + * @param int $n + * @param Listt $xs + * @return Listt|Closure */ function drop(int $n, ?Listt $xs = null) { @@ -80,9 +81,9 @@ function drop(int $n, ?Listt $xs = null) * | otherwise = xs * ``` * - * @param callable $predicate - * @param Listt $xs - * @return Listt|\Closure + * @param callable $predicate + * @param Listt $xs + * @return Listt|Closure */ function dropWhile(callable $predicate, ?Listt $xs = null) { @@ -122,9 +123,9 @@ function dropWhile(callable $predicate, ?Listt $xs = null) * where first element is longest prefix (possibly empty) of xs of elements * that satisfy p and second element is the remainder of the list * - * @param callable $predicate - * @param Listt $xs - * @return array|\Closure + * @param callable $predicate + * @param Listt $xs + * @return array|Closure */ function span(callable $predicate, ?Listt $xs = null) { diff --git a/src/Functional/zipping.php b/src/Functional/zipping.php index 8f46496..cd0f4c1 100644 --- a/src/Functional/zipping.php +++ b/src/Functional/zipping.php @@ -4,6 +4,7 @@ namespace Widmogrod\Functional; +use Closure; use Widmogrod\Primitive\EmptyListError; use Widmogrod\Primitive\Listt; use Widmogrod\Primitive\ListtCons; @@ -19,9 +20,9 @@ * zip takes two lists and returns a list of corresponding pairs. If one input list is short, excess elements of the longer list are discarded. * zip is right-lazy: * - * @param Listt $xs - * @param Listt|null $ys - * @return Listt|\Closure + * @param Listt $xs + * @param Listt|null $ys + * @return Listt|Closure */ function zip(Listt $xs, ?Listt $ys = null) { diff --git a/src/Monad/Control/Doo/Algebra/DooF.php b/src/Monad/Control/Doo/Algebra/DooF.php index a4739d3..3106a7a 100644 --- a/src/Monad/Control/Doo/Algebra/DooF.php +++ b/src/Monad/Control/Doo/Algebra/DooF.php @@ -1,6 +1,7 @@ c) * @param mixed $value a * - * @return Either|\Closure + * @return Either|Closure */ function tryCatch(?callable $function = null, ?callable $catchFunction = null, $value = null) { diff --git a/src/Monad/Free/Free.php b/src/Monad/Free/Free.php index 415b504..7fd8d07 100644 --- a/src/Monad/Free/Free.php +++ b/src/Monad/Free/Free.php @@ -14,7 +14,7 @@ */ class Free implements MonadFree { - const of = 'Widmogrod\Monad\Free\Free::of'; + public const of = 'Widmogrod\Monad\Free\Free::of'; /** * @var FantasyLand\Functor @@ -113,7 +113,7 @@ public function map(callable $go): FantasyLand\Functor */ public function foldFree(callable $f, callable $return): FantasyLand\Monad { - return $f($this->f)->bind(function (MonadFree $next) use ($f, $return) : FantasyLand\Monad { + return $f($this->f)->bind(function (MonadFree $next) use ($f, $return): FantasyLand\Monad { return $next->foldFree($f, $return); }); } diff --git a/src/Monad/Free/Pure.php b/src/Monad/Free/Pure.php index a3ae118..59b317e 100644 --- a/src/Monad/Free/Pure.php +++ b/src/Monad/Free/Pure.php @@ -4,14 +4,14 @@ namespace Widmogrod\Monad\Free; -use Widmogrod\Common; use FunctionalPHP\FantasyLand; +use Widmogrod\Common; class Pure implements MonadFree { use Common\PointedTrait; - const of = 'Widmogrod\Monad\Free\Pure::of'; + public const of = 'Widmogrod\Monad\Free\Pure::of'; /** * @inheritdoc diff --git a/src/Monad/IO.php b/src/Monad/IO.php index ea38426..902df04 100644 --- a/src/Monad/IO.php +++ b/src/Monad/IO.php @@ -4,14 +4,14 @@ namespace Widmogrod\Monad; -use Widmogrod\Common; use FunctionalPHP\FantasyLand; +use Widmogrod\Common; class IO implements FantasyLand\Monad, FantasyLand\Foldable { - const of = 'Widmogrod\Monad\IO::of'; + public const of = 'Widmogrod\Monad\IO::of'; use Common\PointedTrait; diff --git a/src/Monad/IO/IOError.php b/src/Monad/IO/IOError.php index fb0b4db..a5d4ae9 100644 --- a/src/Monad/IO/IOError.php +++ b/src/Monad/IO/IOError.php @@ -4,6 +4,8 @@ namespace Widmogrod\Monad\IO; -class IOError extends \Exception +use Exception; + +class IOError extends Exception { } diff --git a/src/Monad/IO/errors.php b/src/Monad/IO/errors.php index 9cc76e7..10e3c1d 100644 --- a/src/Monad/IO/errors.php +++ b/src/Monad/IO/errors.php @@ -4,6 +4,8 @@ namespace Widmogrod\Monad\IO; +use Closure; +use Exception; use Widmogrod\Functional as f; use Widmogrod\Monad as M; use Widmogrod\Monad\Either as E; @@ -29,11 +31,11 @@ function userError($error) * * throwIO :: Exception e -> IO a * - * @param \Exception $e + * @param Exception $e * * @return M\IO */ -function throwIO(\Exception $e) +function throwIO(Exception $e) { return M\IO::of(function () use ($e) { throw $e; @@ -48,7 +50,7 @@ function throwIO(\Exception $e) * @param M\IO $io * @param callable $catchFunction * - * @return M\IO|\Closure + * @return M\IO|Closure */ function tryCatch(?M\IO $io = null, ?callable $catchFunction = null) { @@ -56,7 +58,7 @@ function tryCatch(?M\IO $io = null, ?callable $catchFunction = null) return M\IO::of(function () use ($io, $catchFunction) { try { return $io->run(); - } catch (\Exception $e) { + } catch (Exception $e) { return $catchFunction($e); } }); diff --git a/src/Monad/IO/functions.php b/src/Monad/IO/functions.php index 2a88de6..c83c6d0 100644 --- a/src/Monad/IO/functions.php +++ b/src/Monad/IO/functions.php @@ -53,9 +53,9 @@ function until(callable $predicate, callable $do, $base, M\IO $ioValue) const getChar = 'Widmogrod\Monad\IO\getChar'; /** + * @return M\IO * @throws IOError * - * @return M\IO */ function getChar() { @@ -75,9 +75,9 @@ function getChar() /** * getLine :: IO String * + * @return M\IO * @throws IOError * - * @return M\IO */ function getLine() { @@ -107,9 +107,9 @@ function putStrLn($string) * * @param $fileName * + * @return M\IO * @throws IOError * - * @return M\IO */ function readFile($fileName) { @@ -135,9 +135,9 @@ function readFile($fileName) * @param string $fileName * @param string $content * + * @return M\IO * @throws IOError * - * @return M\IO */ function writeFile($fileName, $content) { @@ -162,9 +162,9 @@ function writeFile($fileName, $content) * * Computation getArgs returns a list of the program's command line arguments (not including the program name). * + * @return M\IO * @throws IOError * - * @return M\IO */ function getArgs() { @@ -186,9 +186,9 @@ function getArgs() * * @param string $name * + * @return M\IO * @throws IOError * - * @return M\IO */ function getEnv($name) { diff --git a/src/Monad/Identity.php b/src/Monad/Identity.php index 346169c..f3d636b 100644 --- a/src/Monad/Identity.php +++ b/src/Monad/Identity.php @@ -4,14 +4,14 @@ namespace Widmogrod\Monad; -use Widmogrod\Common; use FunctionalPHP\FantasyLand; +use Widmogrod\Common; class Identity implements FantasyLand\Monad, Common\ValueOfInterface { - const of = 'Widmogrod\Monad\Identity::of'; + public const of = 'Widmogrod\Monad\Identity::of'; use Common\PointedTrait; use Common\ValueOfTrait; diff --git a/src/Monad/Maybe/Just.php b/src/Monad/Maybe/Just.php index 7ded5fc..b3048aa 100644 --- a/src/Monad/Maybe/Just.php +++ b/src/Monad/Maybe/Just.php @@ -4,8 +4,8 @@ namespace Widmogrod\Monad\Maybe; -use Widmogrod\Common; use FunctionalPHP\FantasyLand; +use Widmogrod\Common; use Widmogrod\Primitive\TypeMismatchError; use Widmogrod\Useful\PatternMatcher; @@ -13,7 +13,7 @@ class Just implements Maybe, PatternMatcher { use Common\PointedTrait; - const of = 'Widmogrod\Monad\Maybe\Just::of'; + public const of = 'Widmogrod\Monad\Maybe\Just::of'; /** * @inheritdoc diff --git a/src/Monad/Maybe/Maybe.php b/src/Monad/Maybe/Maybe.php index 281c6f7..28d4657 100644 --- a/src/Monad/Maybe/Maybe.php +++ b/src/Monad/Maybe/Maybe.php @@ -4,8 +4,8 @@ namespace Widmogrod\Monad\Maybe; -use Widmogrod\Common; use FunctionalPHP\FantasyLand; +use Widmogrod\Common; interface Maybe extends FantasyLand\Monad, diff --git a/src/Monad/Maybe/Nothing.php b/src/Monad/Maybe/Nothing.php index f0237dd..a275cb8 100644 --- a/src/Monad/Maybe/Nothing.php +++ b/src/Monad/Maybe/Nothing.php @@ -9,7 +9,7 @@ class Nothing implements Maybe, PatternMatcher { - const of = 'Widmogrod\Monad\Maybe\Nothing::of'; + public const of = 'Widmogrod\Monad\Maybe\Nothing::of'; /** * @inheritdoc diff --git a/src/Monad/Maybe/functions.php b/src/Monad/Maybe/functions.php index 11ef56f..6a6fe53 100644 --- a/src/Monad/Maybe/functions.php +++ b/src/Monad/Maybe/functions.php @@ -4,6 +4,7 @@ namespace Widmogrod\Monad\Maybe; +use Closure; use Widmogrod\Functional as f; const pure = 'Widmogrod\Monad\Maybe\pure'; @@ -33,9 +34,9 @@ function nothing() const just = 'Widmogrod\Monad\Maybe\just'; /** + * @param mixed $value * @return Just * - * @param mixed $value */ function just($value) { @@ -51,7 +52,7 @@ function just($value) * @param callable $fn * @param Maybe $maybe * - * @return mixed|\Closure + * @return mixed|Closure */ function maybe($default, ?callable $fn = null, ?Maybe $maybe = null) { diff --git a/src/Monad/Reader.php b/src/Monad/Reader.php index 209dda2..c634a25 100644 --- a/src/Monad/Reader.php +++ b/src/Monad/Reader.php @@ -4,12 +4,12 @@ namespace Widmogrod\Monad; -use Widmogrod\Common; use FunctionalPHP\FantasyLand; +use Widmogrod\Common; class Reader implements FantasyLand\Monad { - const of = 'Widmogrod\Monad\Reader::of'; + public const of = 'Widmogrod\Monad\Reader::of'; use Common\PointedTrait; diff --git a/src/Monad/State.php b/src/Monad/State.php index 8fb04be..49c2fa9 100644 --- a/src/Monad/State.php +++ b/src/Monad/State.php @@ -4,12 +4,12 @@ namespace Widmogrod\Monad; -use Widmogrod\Common; use FunctionalPHP\FantasyLand; +use Widmogrod\Common; class State implements FantasyLand\Monad { - const of = 'Widmogrod\Monad\State::of'; + public const of = 'Widmogrod\Monad\State::of'; use Common\PointedTrait; diff --git a/src/Monad/Writer.php b/src/Monad/Writer.php index 244eee6..ea2273f 100644 --- a/src/Monad/Writer.php +++ b/src/Monad/Writer.php @@ -9,7 +9,7 @@ class Writer implements FantasyLand\Monad { - const of = 'Widmogrod\Monad\Writer::of'; + public const of = 'Widmogrod\Monad\Writer::of'; public static function of($value, ?FantasyLand\Monoid $side = null) { diff --git a/src/Primitive/EmptyListError.php b/src/Primitive/EmptyListError.php index 7f31abb..8b0df59 100644 --- a/src/Primitive/EmptyListError.php +++ b/src/Primitive/EmptyListError.php @@ -4,7 +4,9 @@ namespace Widmogrod\Primitive; -class EmptyListError extends \Exception +use Exception; + +class EmptyListError extends Exception { public function __construct(string $method) { diff --git a/src/Primitive/Listt.php b/src/Primitive/Listt.php index e343ca2..e561d87 100644 --- a/src/Primitive/Listt.php +++ b/src/Primitive/Listt.php @@ -4,8 +4,8 @@ namespace Widmogrod\Primitive; -use Widmogrod\Common; use FunctionalPHP\FantasyLand; +use Widmogrod\Common; /** * data List a = Nil | Cons a (List a) @@ -30,7 +30,7 @@ public function head(); /** * tail :: [a] -> [a] * - * @return \Widmogrod\Primitive\Listt + * @return Listt * * @throws EmptyListError */ diff --git a/src/Primitive/ListtCons.php b/src/Primitive/ListtCons.php index 23b6dba..425fc83 100644 --- a/src/Primitive/ListtCons.php +++ b/src/Primitive/ListtCons.php @@ -4,11 +4,13 @@ namespace Widmogrod\Primitive; -use Widmogrod\Common; use FunctionalPHP\FantasyLand; +use IteratorAggregate; +use Traversable; +use Widmogrod\Common; use Widmogrod\Functional as f; -class ListtCons implements Listt, \IteratorAggregate +class ListtCons implements Listt, IteratorAggregate { public const of = 'Widmogrod\Primitive\ListtCons::of'; @@ -35,7 +37,7 @@ public function __construct(callable $next) /** * @inheritdoc */ - public function getIterator(): \Traversable + public function getIterator(): Traversable { $tail = $this; do { diff --git a/src/Primitive/ListtNil.php b/src/Primitive/ListtNil.php index 5155ec1..d60b97e 100644 --- a/src/Primitive/ListtNil.php +++ b/src/Primitive/ListtNil.php @@ -4,10 +4,13 @@ namespace Widmogrod\Primitive; +use ArrayObject; use FunctionalPHP\FantasyLand; +use IteratorAggregate; +use Traversable; use Widmogrod\Common; -class ListtNil implements Listt, \IteratorAggregate +class ListtNil implements Listt, IteratorAggregate { use Common\PointedTrait; @@ -127,8 +130,8 @@ public function tail(): Listt /** * @inheritdoc */ - public function getIterator(): \Traversable + public function getIterator(): Traversable { - return new \ArrayObject(); + return new ArrayObject(); } } diff --git a/src/Primitive/Num.php b/src/Primitive/Num.php index 9b1402f..bc8df97 100644 --- a/src/Primitive/Num.php +++ b/src/Primitive/Num.php @@ -4,15 +4,15 @@ namespace Widmogrod\Primitive; -use Widmogrod\Common; use FunctionalPHP\FantasyLand; +use Widmogrod\Common; class Num implements FantasyLand\Pointed, FantasyLand\Setoid, Common\ValueOfInterface { - const of = 'Widmogrod\Primitive\Num::of'; + public const of = 'Widmogrod\Primitive\Num::of'; use Common\PointedTrait; use Common\ValueOfTrait; diff --git a/src/Primitive/Stringg.php b/src/Primitive/Stringg.php index c8e837b..4812f1b 100644 --- a/src/Primitive/Stringg.php +++ b/src/Primitive/Stringg.php @@ -4,8 +4,8 @@ namespace Widmogrod\Primitive; -use Widmogrod\Common; use FunctionalPHP\FantasyLand; +use Widmogrod\Common; class Stringg implements FantasyLand\Pointed, @@ -13,7 +13,7 @@ class Stringg implements FantasyLand\Setoid, Common\ValueOfInterface { - const of = 'Widmogrod\Primitive\Stringg::of'; + public const of = 'Widmogrod\Primitive\Stringg::of'; use Common\PointedTrait; use Common\ValueOfTrait; diff --git a/src/Primitive/TypeMismatchError.php b/src/Primitive/TypeMismatchError.php index cc1c8aa..3162f23 100644 --- a/src/Primitive/TypeMismatchError.php +++ b/src/Primitive/TypeMismatchError.php @@ -4,7 +4,9 @@ namespace Widmogrod\Primitive; -class TypeMismatchError extends \Exception +use Exception; + +class TypeMismatchError extends Exception { public function __construct($value, $expected) { diff --git a/src/Useful/PatternNotMatchedError.php b/src/Useful/PatternNotMatchedError.php index fd81420..5427451 100644 --- a/src/Useful/PatternNotMatchedError.php +++ b/src/Useful/PatternNotMatchedError.php @@ -4,7 +4,9 @@ namespace Widmogrod\Useful; -class PatternNotMatchedError extends \Exception +use Exception; + +class PatternNotMatchedError extends Exception { public static function cannotMatch($value, array $patterns): self { diff --git a/src/Useful/SnapshotIterator.php b/src/Useful/SnapshotIterator.php index bb7ea19..d15e067 100644 --- a/src/Useful/SnapshotIterator.php +++ b/src/Useful/SnapshotIterator.php @@ -4,7 +4,9 @@ namespace Widmogrod\Useful; -class SnapshotIterator extends \IteratorIterator +use IteratorIterator; + +class SnapshotIterator extends IteratorIterator { private $inMemoryValid; private $inMemoryCurrent; diff --git a/src/Useful/match.php b/src/Useful/match.php index f01a8cb..7a6f3c3 100644 --- a/src/Useful/match.php +++ b/src/Useful/match.php @@ -22,9 +22,9 @@ * * @param array $patterns * @param mixed $value + * @return mixed * @throws PatternNotMatchedError * - * @return mixed */ function matchPatterns(array $patterns, $value = null) { diff --git a/test/Functional/ApplicatorTest.php b/test/Functional/ApplicatorTest.php index a2142ff..b7a4428 100644 --- a/test/Functional/ApplicatorTest.php +++ b/test/Functional/ApplicatorTest.php @@ -4,13 +4,14 @@ namespace test\Functional; +use ArgumentCountError; +use PHPUnit\Framework\Attributes\DataProvider; +use PHPUnit\Framework\TestCase; use function Widmogrod\Functional\applicator; -class ApplicatorTest extends \PHPUnit\Framework\TestCase +class ApplicatorTest extends TestCase { - /** - * @dataProvider provideData - */ + #[DataProvider('provideData')] public function test_it_should_apply_value_as_a_argument_to_a_function( $value, callable $fn, @@ -22,26 +23,24 @@ public function test_it_should_apply_value_as_a_argument_to_a_function( ); } - /** - * @expectedException \ArgumentCountError - * @expectedExceptionMessage Too few arguments to function - */ - public function test_it_should_fail_when_function_requires_more_argumetns() + public function test_it_should_fail_when_function_requires_more_arguments() { + $this->expectException(ArgumentCountError::class); + $this->expectExceptionMessage('Too few arguments to function'); applicator(1, function (int $i, string $a): int { return 10 + $i; }); } - public function provideData() + public static function provideData() { return [ 'Single value function' => [ - '$value' => 133, - '$fn' => function (int $i): int { + 133, + function (int $i): int { return 10 + $i; }, - '$expected' => 143, + 143, ], ]; } diff --git a/test/Functional/ComposeTest.php b/test/Functional/ComposeTest.php index 4108e6f..0a69583 100644 --- a/test/Functional/ComposeTest.php +++ b/test/Functional/ComposeTest.php @@ -4,18 +4,19 @@ namespace test\Functional; +use Closure; +use PHPUnit\Framework\Attributes\DataProvider; +use PHPUnit\Framework\TestCase; use Widmogrod\Functional as f; -class ComposeTest extends \PHPUnit\Framework\TestCase +class ComposeTest extends TestCase { public function test_it_should_retun_function_accepting_arguments() { - $this->assertInstanceOf(\Closure::class, f\compose('strtolower', 'strtoupper')); + $this->assertInstanceOf(Closure::class, f\compose('strtolower', 'strtoupper')); } - /** - * @dataProvider provideData - */ + #[DataProvider('provideData')] public function test_it_should_be_curried( $functions, $value, @@ -28,13 +29,13 @@ public function test_it_should_be_curried( ); } - public function provideData() + public static function provideData() { return [ 'two function' => [ - '$functions' => ['strtolower', 'strtoupper'], - '$value' => 'aBcD', - '$expected' => 'abcd' + ['strtolower', 'strtoupper'], + 'aBcD', + 'abcd' ], ]; } diff --git a/test/Functional/ConcatTest.php b/test/Functional/ConcatTest.php index 3e652cb..a0dc90b 100644 --- a/test/Functional/ConcatTest.php +++ b/test/Functional/ConcatTest.php @@ -4,15 +4,15 @@ namespace test\Functional; +use PHPUnit\Framework\Attributes\DataProvider; +use PHPUnit\Framework\TestCase; use Widmogrod\Functional as f; use Widmogrod\Monad\Maybe\Just; use Widmogrod\Monad\Maybe\Nothing; -class ConcatTest extends \PHPUnit\Framework\TestCase +class ConcatTest extends TestCase { - /** - * @dataProvider provideData - */ + #[DataProvider('provideData')] public function test_it_should_concat_values_to_array( $value, $expected @@ -20,18 +20,18 @@ public function test_it_should_concat_values_to_array( $this->assertEquals($expected, f\concat($value)); } - public function provideData() + public static function provideData() { return [ 'list of lists' => [ - '$array' => f\fromIterable([ + f\fromIterable([ f\fromIterable(['a', 1, 3]), f\fromIterable(['b', 2, 4]) ]), - '$expected' => f\fromIterable(['a', 1, 3, 'b', 2, 4]), + f\fromIterable(['a', 1, 3, 'b', 2, 4]), ], 'list of lists of lists' => [ - '$array' => f\fromIterable([ + f\fromIterable([ f\fromIterable([ f\fromIterable(['a', 1]), f\fromIterable(['b', 2]) @@ -40,21 +40,21 @@ public function provideData() f\fromIterable(['c', 3]) ]), ]), - '$expected' => f\fromIterable([ + f\fromIterable([ f\fromIterable(['a', 1]), f\fromIterable(['b', 2]), f\fromIterable(['c', 3]) ]), ], 'list of lists of lists with some noregulatives' => [ - '$array' => f\fromIterable([ + f\fromIterable([ f\fromIterable([ f\fromIterable(['a', 1]), f\fromIterable(['b', 2]), ]), f\fromIterable(['c', 3]) ]), - '$expected' => f\fromIterable([ + f\fromIterable([ f\fromIterable(['a', 1]), f\fromIterable(['b', 2]), 'c', @@ -62,12 +62,12 @@ public function provideData() ]), ], 'Just of lists' => [ - '$array' => Just::of(f\fromIterable(['a', 1, 3])), - '$expected' => f\fromIterable(['a', 1, 3]), + Just::of(f\fromIterable(['a', 1, 3])), + f\fromIterable(['a', 1, 3]), ], 'Nothing of lists' => [ - '$array' => Nothing::mempty(), - '$expected' => f\fromNil() + Nothing::mempty(), + f\fromNil() ], ]; } diff --git a/test/Functional/ConsttTest.php b/test/Functional/ConsttTest.php index 2d6e2d1..b4f82a9 100644 --- a/test/Functional/ConsttTest.php +++ b/test/Functional/ConsttTest.php @@ -6,9 +6,10 @@ use Eris\Generator; use Eris\TestTrait; +use PHPUnit\Framework\TestCase; use function Widmogrod\Functional\constt; -class ConsttTest extends \PHPUnit\Framework\TestCase +class ConsttTest extends TestCase { use TestTrait; diff --git a/test/Functional/CurryNTest.php b/test/Functional/CurryNTest.php index 7980c6d..dab9aab 100644 --- a/test/Functional/CurryNTest.php +++ b/test/Functional/CurryNTest.php @@ -4,22 +4,22 @@ namespace test\Functional; +use PHPUnit\Framework\Attributes\DataProvider; +use PHPUnit\Framework\TestCase; use Widmogrod\Functional as f; -class CurryNTest extends \PHPUnit\Framework\TestCase +class CurryNTest extends TestCase { - /** - * @dataProvider provideArgumentsWithFunctions - */ + #[DataProvider('provideArgumentsWithFunctions')] public function test_it_should_return_function_event_if_function_not_accept_arguments( $numberOfArguments, $function, $default ) { - $this->assertInternalType('callable', f\curryN($numberOfArguments, $function, $default)); + $this->assertIsCallable(f\curryN($numberOfArguments, $function, $default)); } - public function provideArgumentsWithFunctions() + public static function provideArgumentsWithFunctions() { $function = function ($a, $b, $c) { return sprintf('should not return value (%s, %s, %s)', $a, $b, $c); @@ -27,40 +27,36 @@ public function provideArgumentsWithFunctions() return [ 'curry N = 0' => [ - '$numberOfArguments' => 0, - '$function' => $function, - '$default' => [], + 0, + $function, + [], ], 'curry with default arguments for non argument curry' => [ - '$numberOfArguments' => 0, - '$function' => $function, - '$default' => ['test'], + 0, + $function, + ['test'], ], 'curry one' => [ - '$numberOfArguments' => 1, - '$function' => $function, - '$default' => [], + 1, + $function, + [], ], 'curry with one argument binded' => [ - '$numberOfArguments' => 1, - '$function' => $function, - '$default' => ['test'], + 1, + $function, + ['test'], ], ]; } - /** - * @dataProvider provideCurriedSumFunction - */ + #[DataProvider('provideCurriedSumFunction')] public function test_it_should_evaluate_curried_function_if_number_of_arguments_is_fulfilled( callable $curriedSum ) { $this->assertSame(3, $curriedSum(1, 2)); } - /** - * @dataProvider provideCurriedSumFunction - */ + #[DataProvider('provideCurriedSumFunction')] public function test_it_should_be_able_to_curry_multiple_times( callable $curriedSum ) { @@ -70,9 +66,7 @@ public function test_it_should_be_able_to_curry_multiple_times( $this->assertSame(4, $addOne(3)); } - /** - * @dataProvider provideCurriedSumFunction - */ + #[DataProvider('provideCurriedSumFunction')] public function test_it_should_be_able_to_curry_few_variants_and_evaluate_them( callable $curriedSum ) { @@ -86,36 +80,34 @@ public function test_it_should_be_able_to_curry_few_variants_and_evaluate_them( $this->assertSame(7, $addTwo(5)); } - public function provideCurriedSumFunction() + public static function provideCurriedSumFunction() { return [ 'curried sum' => [ - '$curriedSum' => f\curryN(2, function ($a, $b) { + f\curryN(2, function ($a, $b) { return $a + $b; }) ], 'curried sum with predefined value' => [ - '$curriedSum' => f\curryN(2, function ($x, $y, $a, $b) { + f\curryN(2, function ($x, $y, $a, $b) { return ($a - $x) - ($y - $b); }, [1, -1]) ] ]; } - /** - * @dataProvider provideCurriedReturnArgsFunction - */ + #[DataProvider('provideCurriedReturnArgsFunction')] public function test_it_should_be_able_to_curry_even_if_more_arguments_is_applied( callable $returnArgs ) { $this->assertSame([1, 2, 3], $returnArgs(1, 2, 3)); } - public function provideCurriedReturnArgsFunction() + public static function provideCurriedReturnArgsFunction() { return [ 'curried' => [ - '$returnArgs' => f\curryN(2, function () { + f\curryN(2, function () { return func_get_args(); }) ] diff --git a/test/Functional/CurryTest.php b/test/Functional/CurryTest.php index 58b9811..15d1628 100644 --- a/test/Functional/CurryTest.php +++ b/test/Functional/CurryTest.php @@ -4,13 +4,14 @@ namespace test\Functional; +use Closure; +use PHPUnit\Framework\Attributes\DataProvider; +use PHPUnit\Framework\TestCase; use Widmogrod\Functional as f; -class CurryTest extends \PHPUnit\Framework\TestCase +class CurryTest extends TestCase { - /** - * @dataProvider provideFunctionToCurry - */ + #[DataProvider('provideFunctionToCurry')] public function test_it_should_detect_automatically_number_of_arguments_to_curry( $fn, $resultAfterCurries @@ -32,35 +33,33 @@ public function test_it_should_detect_automatically_number_of_arguments_to_curry ); } - public function provideFunctionToCurry() + public static function provideFunctionToCurry() { return [ 'args = 0' => [ - '$fn' => function () { + function () { }, - '$resultAfterCurries' => 1, + 1, ], 'args = 1' => [ - '$fn' => function ($a) { + function ($a) { }, - '$resultAfterCurries' => 1, + 1, ], 'args = 2' => [ - '$fn' => function ($a, $b) { + function ($a, $b) { }, - '$resultAfterCurries' => 2, + 2, ], 'args = 2 with default' => [ - '$fn' => function ($a, $b = null) { + function ($a, $b = null) { }, - '$resultAfterCurries' => 2, + 2, ], ]; } - /** - * @dataProvider provideFunctionsToCurry - */ + #[DataProvider('provideFunctionsToCurry')] public function test_it_curry_with_lest_arguments_if_defaults_are_provided( $result, $function @@ -71,54 +70,52 @@ public function test_it_curry_with_lest_arguments_if_defaults_are_provided( ); } - public function provideFunctionsToCurry() + public static function provideFunctionsToCurry() { return [ 'curry args = 0 and default = 0' => [ - '$result' => null, - '$function' => f\curry(function () { + null, + f\curry(function () { }, []) ], 'curry args = 1 and default = 1' => [ - '$result' => [1], - '$function' => f\curry(function ($a) { + [1], + f\curry(function ($a) { return [$a]; }, [1]) ], 'curry args = 2 and default = 2' => [ - '$result' => [1, 2], - '$function' => f\curry(function ($a, $b) { + [1, 2], + f\curry(function ($a, $b) { return [$a, $b]; }, [1, 2]) ], 'curry args = 2 and default = 3' => [ - '$result' => [1, 2, 3], - '$function' => f\curry(function ($a) { + [1, 2, 3], + f\curry(function ($a) { return func_get_args(); }, [1, 2, 3]) ], 'curry args = 2 and default = 4' => [ - '$result' => [1, 2], - '$function' => f\curry(function ($a, $b) { + [1, 2], + f\curry(function ($a, $b) { return [$a, $b]; }, [1, 2, 3, 4]) ], ]; } - /** - * @dataProvider provideCallablesToTest - */ + #[DataProvider('provideCallablesToTest')] public function test_it_curry_every_type_of_callable(callable $callable) { $curried = f\curry($callable); - $this->assertInstanceOf(\Closure::class, $curried); - $this->assertInstanceOf(\Closure::class, $curried(1)); + $this->assertInstanceOf(Closure::class, $curried); + $this->assertInstanceOf(Closure::class, $curried(1)); $this->assertSame([1, 2], $curried(1)(2)); } - public function provideCallablesToTest() + public static function provideCallablesToTest() { return [ 'closure' => [ @@ -153,7 +150,7 @@ public static function staticMethod($a, $b) } } -namespace test\Functional\inner; +namespace test\Functional\inner; function my_named_function($a, $b) { diff --git a/test/Functional/CycleTest.php b/test/Functional/CycleTest.php index 503027b..e340954 100644 --- a/test/Functional/CycleTest.php +++ b/test/Functional/CycleTest.php @@ -6,14 +6,15 @@ use Eris\Generator; use Eris\TestTrait; -use const Widmogrod\Functional\identity; +use PHPUnit\Framework\TestCase; use function Widmogrod\Functional\cycle; use function Widmogrod\Functional\fromIterable; use function Widmogrod\Functional\iterate; use function Widmogrod\Functional\length; use function Widmogrod\Functional\take; +use const Widmogrod\Functional\identity; -class CycleTest extends \PHPUnit\Framework\TestCase +class CycleTest extends TestCase { use TestTrait; diff --git a/test/Functional/DropTest.php b/test/Functional/DropTest.php index e0f75fe..5589093 100644 --- a/test/Functional/DropTest.php +++ b/test/Functional/DropTest.php @@ -4,16 +4,16 @@ namespace test\Functional; +use PHPUnit\Framework\Attributes\DataProvider; +use PHPUnit\Framework\TestCase; use Widmogrod\Primitive\Listt; use function Widmogrod\Functional\drop; use function Widmogrod\Functional\fromIterable; use function Widmogrod\Functional\fromNil; -class DropTest extends \PHPUnit\Framework\TestCase +class DropTest extends TestCase { - /** - * @dataProvider provideData - */ + #[DataProvider('provideData')] public function test_it( Listt $a, int $n, @@ -30,33 +30,33 @@ public function test_it( ); } - public function provideData() + public static function provideData() { return [ 'should return empty list from when input is empty list' => [ - '$a' => fromNil(), - '$n' => 1, - '$expected' => fromNil(), + fromNil(), + 1, + fromNil(), ], 'should provided list when n is zero' => [ - '$a' => fromIterable([1, 2, 3, 4, 5]), - '$n' => 0, - '$expected' => fromIterable([1, 2, 3, 4, 5]), + fromIterable([1, 2, 3, 4, 5]), + 0, + fromIterable([1, 2, 3, 4, 5]), ], 'should provided list when n is negative' => [ - '$a' => fromIterable([1, 2, 3, 4, 5]), - '$n' => random_int(-1000, -1), - '$expected' => fromIterable([1, 2, 3, 4, 5]), + fromIterable([1, 2, 3, 4, 5]), + random_int(-1000, -1), + fromIterable([1, 2, 3, 4, 5]), ], 'should return part of finite list' => [ - '$a' => fromIterable([1, 2, 3, 4, 5]), - '$n' => 3, - '$expected' => fromIterable([4, 5]), + fromIterable([1, 2, 3, 4, 5]), + 3, + fromIterable([4, 5]), ], 'should return nil list when drop more than in the list' => [ - '$a' => fromIterable([1, 2, 3, 4, 5]), - '$n' => 3000, - '$expected' => fromNil(), + fromIterable([1, 2, 3, 4, 5]), + 3000, + fromNil(), ], ]; } diff --git a/test/Functional/DropWhileTest.php b/test/Functional/DropWhileTest.php index 8b7471e..c781c48 100644 --- a/test/Functional/DropWhileTest.php +++ b/test/Functional/DropWhileTest.php @@ -4,17 +4,17 @@ namespace test\Functional; +use PHPUnit\Framework\Attributes\DataProvider; +use PHPUnit\Framework\TestCase; use Widmogrod\Primitive\Listt; use function Widmogrod\Functional\dropWhile; use function Widmogrod\Functional\fromIterable; use function Widmogrod\Functional\fromNil; use function Widmogrod\Functional\lt; -class DropWhileTest extends \PHPUnit\Framework\TestCase +class DropWhileTest extends TestCase { - /** - * @dataProvider provideData - */ + #[DataProvider('provideData')] public function test_it( Listt $a, callable $fn, @@ -31,28 +31,28 @@ public function test_it( ); } - public function provideData() + public static function provideData() { return [ 'should return empty list from when input is empty list' => [ - '$a' => fromNil(), - '$fn' => lt(3), - '$expected' => fromNil(), + fromNil(), + lt(3), + fromNil(), ], 'should provided list when < 100' => [ - '$a' => fromIterable([1, 2, 3, 4, 5]), - '$fn' => lt(100), - '$expected' => fromIterable([]), + fromIterable([1, 2, 3, 4, 5]), + lt(100), + fromIterable([]), ], 'should return part of finite list' => [ - '$a' => fromIterable([1, 2, 3, 4, 5]), - '$fn' => lt(4), - '$expected' => fromIterable([4, 5]), + fromIterable([1, 2, 3, 4, 5]), + lt(4), + fromIterable([4, 5]), ], 'should return nil list when drop more than in the list' => [ - '$a' => fromIterable([1, 2, 3, 4, 5]), - '$fn' => lt(400), - '$expected' => fromNil(), + fromIterable([1, 2, 3, 4, 5]), + lt(400), + fromNil(), ], ]; } diff --git a/test/Functional/FilterMTest.php b/test/Functional/FilterMTest.php index 7727dc8..84fb0f5 100644 --- a/test/Functional/FilterMTest.php +++ b/test/Functional/FilterMTest.php @@ -4,16 +4,17 @@ namespace test\Functional; +use ArrayIterator; +use PHPUnit\Framework\Attributes\DataProvider; +use PHPUnit\Framework\TestCase; use function Widmogrod\Functional\filterM; use function Widmogrod\Functional\fromIterable; use function Widmogrod\Functional\fromNil; use function Widmogrod\Monad\Maybe\just; -class FilterMTest extends \PHPUnit\Framework\TestCase +class FilterMTest extends TestCase { - /** - * @dataProvider provideData - */ + #[DataProvider('provideData')] public function test_it_should_filter_with_maybe( $list, $expected @@ -28,20 +29,20 @@ public function test_it_should_filter_with_maybe( ); } - public function provideData() + public static function provideData() { return [ 'simple list' => [ - '$list' => fromIterable([1, 2, 3, 4, 5]), - '$expected' => just(fromIterable([1, 3, 5])) + fromIterable([1, 2, 3, 4, 5]), + just(fromIterable([1, 3, 5])) ], 'empty list' => [ - '$list' => fromNil(), - '$expected' => fromNil() + fromNil(), + fromNil() ], 'traversable' => [ - '$list' => fromIterable(new \ArrayIterator([1, 2, 3, 4, 5])), - '$expected' => just(fromIterable([1, 3, 5])), + fromIterable(new ArrayIterator([1, 2, 3, 4, 5])), + just(fromIterable([1, 3, 5])), ], ]; } diff --git a/test/Functional/FilterTest.php b/test/Functional/FilterTest.php index 1f21dcf..9975898 100644 --- a/test/Functional/FilterTest.php +++ b/test/Functional/FilterTest.php @@ -4,15 +4,16 @@ namespace test\Functional; +use ArrayIterator; +use PHPUnit\Framework\Attributes\DataProvider; +use PHPUnit\Framework\TestCase; use function Widmogrod\Functional\filter; use function Widmogrod\Functional\fromIterable; use function Widmogrod\Functional\fromNil; -class FilterTest extends \PHPUnit\Framework\TestCase +class FilterTest extends TestCase { - /** - * @dataProvider provideData - */ + #[DataProvider('provideData')] public function test_it_should_filter_with_maybe( $list, $expected @@ -27,20 +28,20 @@ public function test_it_should_filter_with_maybe( ); } - public function provideData() + public static function provideData() { return [ 'simple list' => [ - '$list' => fromIterable([1, 2, 3, 4, 5]), - '$expected' => fromIterable([1, 3, 5]) + fromIterable([1, 2, 3, 4, 5]), + fromIterable([1, 3, 5]) ], 'empty list' => [ - '$list' => fromNil(), - '$expected' => fromNil() + fromNil(), + fromNil() ], 'traversable' => [ - '$list' => fromIterable(new \ArrayIterator([1, 2, 3, 4, 5])), - '$expected' => fromIterable([1, 3, 5]), + fromIterable(new ArrayIterator([1, 2, 3, 4, 5])), + fromIterable([1, 3, 5]), ], ]; } diff --git a/test/Functional/FlipTest.php b/test/Functional/FlipTest.php index 297ab1a..416a8e9 100644 --- a/test/Functional/FlipTest.php +++ b/test/Functional/FlipTest.php @@ -4,13 +4,14 @@ namespace test\Functional; +use Closure; +use PHPUnit\Framework\Attributes\DataProvider; +use PHPUnit\Framework\TestCase; use Widmogrod\Functional as f; -class FlipTest extends \PHPUnit\Framework\TestCase +class FlipTest extends TestCase { - /** - * @dataProvider provideFunctions - */ + #[DataProvider('provideFunctions')] public function test_it_should_flip_func_arguments( callable $func, array $args, @@ -24,29 +25,27 @@ public function test_it_should_flip_func_arguments( ); } - public function provideFunctions() + public static function provideFunctions() { return [ 'two arguments' => [ - '$func' => function ($a, $b) { + function ($a, $b) { return [$a, $b]; }, - '$args' => [1, 2], - '$expected' => [2, 1] + [1, 2], + [2, 1] ], 'three arguments' => [ - '$func' => function ($a, $b, $c) { + function ($a, $b, $c) { return [$a, $b, $c]; }, - '$args' => [1, 2, 3], - '$expected' => [2, 1, 3] + [1, 2, 3], + [2, 1, 3] ], ]; } - /** - * @dataProvider provideFunctionsWithNotEnoughArgs - */ + #[DataProvider('provideFunctionsWithNotEnoughArgs')] public function test_it_should_curry_if_not_enough_args_passed( callable $func, array $args @@ -54,25 +53,25 @@ public function test_it_should_curry_if_not_enough_args_passed( $curried = f\curry($func); $this->assertInstanceOf( - \Closure::class, + Closure::class, $curried(...$args) ); } - public function provideFunctionsWithNotEnoughArgs() + public static function provideFunctionsWithNotEnoughArgs() { return [ 'two arguments' => [ - '$func' => function ($a, $b) { + function ($a, $b) { return [$a, $b]; }, - '$args' => [], + [], ], 'three arguments' => [ - '$func' => function ($a, $b, $c) { + function ($a, $b, $c) { return [$a, $b, $c]; }, - '$args' => [1], + [1], ], ]; } diff --git a/test/Functional/FoldMTest.php b/test/Functional/FoldMTest.php index 1d26ae5..7505080 100644 --- a/test/Functional/FoldMTest.php +++ b/test/Functional/FoldMTest.php @@ -4,17 +4,18 @@ namespace test\Functional; +use ArrayIterator; +use PHPUnit\Framework\Attributes\DataProvider; +use PHPUnit\Framework\TestCase; use function Widmogrod\Functional\foldM; use function Widmogrod\Functional\fromIterable; use function Widmogrod\Functional\fromNil; use function Widmogrod\Monad\Maybe\just; use function Widmogrod\Monad\Maybe\nothing; -class FoldMTest extends \PHPUnit\Framework\TestCase +class FoldMTest extends TestCase { - /** - * @dataProvider provideData - */ + #[DataProvider('provideData')] public function test_it_should_work_with_maybe( $list, $expected @@ -28,24 +29,24 @@ public function test_it_should_work_with_maybe( ); } - public function provideData() + public static function provideData() { return [ 'just' => [ - '$list' => fromIterable([1, 3, 5, 7]), - '$expected' => just(16) + fromIterable([1, 3, 5, 7]), + just(16) ], 'nothing' => [ - '$list' => fromIterable([1, 3, 42, 7]), - '$expected' => nothing(), + fromIterable([1, 3, 42, 7]), + nothing(), ], 'empty array' => [ - '$list' => fromNil(), - '$expected' => fromNil(), + fromNil(), + fromNil(), ], 'traversable' => [ - '$list' => fromIterable(new \ArrayIterator([1, 3, 5, 7])), - '$expected' => just(16) + fromIterable(new ArrayIterator([1, 3, 5, 7])), + just(16) ], ]; } diff --git a/test/Functional/FoldrTest.php b/test/Functional/FoldrTest.php index 59bc251..f419561 100644 --- a/test/Functional/FoldrTest.php +++ b/test/Functional/FoldrTest.php @@ -4,9 +4,10 @@ namespace test\Functional; +use PHPUnit\Framework\TestCase; use Widmogrod\Functional as f; -class FoldrTest extends \PHPUnit\Framework\TestCase +class FoldrTest extends TestCase { public function test_foldr() { diff --git a/test/Functional/HeadTest.php b/test/Functional/HeadTest.php index d9acf4a..ff39fe3 100644 --- a/test/Functional/HeadTest.php +++ b/test/Functional/HeadTest.php @@ -4,16 +4,18 @@ namespace test\Functional; +use ArrayIterator; +use PHPUnit\Framework\Attributes\DataProvider; +use PHPUnit\Framework\TestCase; +use Widmogrod\Primitive\EmptyListError; use Widmogrod\Primitive\Listt; use function Widmogrod\Functional\fromIterable; use function Widmogrod\Functional\fromNil; use function Widmogrod\Functional\head; -class HeadTest extends \PHPUnit\Framework\TestCase +class HeadTest extends TestCase { - /** - * @dataProvider provideData - */ + #[DataProvider('provideData')] public function test_it_should_return_boxed_value( Listt $listt, $expected @@ -24,26 +26,24 @@ public function test_it_should_return_boxed_value( ); } - public function provideData() + public static function provideData() { return [ 'Should return head from finite array' => [ - '$listt' => fromIterable([1, 2, 3]), - '$expected' => 1, + fromIterable([1, 2, 3]), + 1, ], 'Should return head from finite iterator' => [ - '$listt' => fromIterable(new \ArrayIterator([1, 2, 3])), - '$expected' => 1, + fromIterable(new ArrayIterator([1, 2, 3])), + 1, ], ]; } - /** - * @expectedException \Widmogrod\Primitive\EmptyListError - * @expectedExceptionMessage Cannot call head() on empty list - */ public function test_it_should_throw_exception_when_list_is_empty() { + $this->expectException(EmptyListError::class); + $this->expectExceptionMessage('Cannot call head() on empty list'); head(fromNil()); } } diff --git a/test/Functional/IdentityTest.php b/test/Functional/IdentityTest.php index ec88c06..cfa0da8 100644 --- a/test/Functional/IdentityTest.php +++ b/test/Functional/IdentityTest.php @@ -4,33 +4,33 @@ namespace test\Functional; +use PHPUnit\Framework\Attributes\DataProvider; +use PHPUnit\Framework\TestCase; use Widmogrod\Functional as f; -class IdentityTest extends \PHPUnit\Framework\TestCase +class IdentityTest extends TestCase { - /** - * @dataProvider provideData - */ + #[DataProvider('provideData')] public function test_it_should_return_given_value( $value ) { $this->assertEquals($value, f\identity($value)); } - public function provideData() + public static function provideData() { return [ 'integer' => [ - '$value' => 1, + 1, ], 'string' => [ - '$value' => 'bar', + 'bar', ], 'list' => [ - '$value' => ['bar', 'baz'], + ['bar', 'baz'], ], 'map' => [ - '$value' => ['x' => 'bar', 'y' => 'baz'], + ['x' => 'bar', 'y' => 'baz'], ], ]; } diff --git a/test/Functional/InvokeTest.php b/test/Functional/InvokeTest.php index aee204e..5dddaf4 100644 --- a/test/Functional/InvokeTest.php +++ b/test/Functional/InvokeTest.php @@ -4,13 +4,13 @@ namespace test\Functional; +use PHPUnit\Framework\Attributes\DataProvider; +use PHPUnit\Framework\TestCase; use Widmogrod\Functional as f; -class InvokeTest extends \PHPUnit\Framework\TestCase +class InvokeTest extends TestCase { - /** - * @dataProvider provideData - */ + #[DataProvider('provideData')] public function test_it($method, $input, $output) { $curried = f\invoke($method); @@ -18,13 +18,16 @@ public function test_it($method, $input, $output) $this->assertEquals($output, $curried($input)); } - public function provideData() + public static function provideData() { return [ - 'should return value from method' => ['getString', $this, 'this-is-my-string'] + 'should return value from method' => ['getString', new InvokeTest2, 'this-is-my-string'] ]; } +} +class InvokeTest2 +{ public function getString() { return 'this-is-my-string'; diff --git a/test/Functional/IterateTest.php b/test/Functional/IterateTest.php index 4b61ec6..a8bb70b 100644 --- a/test/Functional/IterateTest.php +++ b/test/Functional/IterateTest.php @@ -6,13 +6,14 @@ use Eris\Generator; use Eris\TestTrait; -use const Widmogrod\Functional\identity; +use PHPUnit\Framework\TestCase; use function Widmogrod\Functional\iterate; use function Widmogrod\Functional\length; use function Widmogrod\Functional\reduce; use function Widmogrod\Functional\take; +use const Widmogrod\Functional\identity; -class IterateTest extends \PHPUnit\Framework\TestCase +class IterateTest extends TestCase { use TestTrait; diff --git a/test/Functional/JoinTest.php b/test/Functional/JoinTest.php index 03657cb..89cf69f 100644 --- a/test/Functional/JoinTest.php +++ b/test/Functional/JoinTest.php @@ -5,18 +5,18 @@ namespace test\Functional; use FunctionalPHP\FantasyLand\Monad; +use PHPUnit\Framework\Attributes\DataProvider; +use PHPUnit\Framework\TestCase; use Widmogrod\Monad\Identity; use Widmogrod\Monad\State; -use const Widmogrod\Functional\identity; use function Widmogrod\Functional\flip; use function Widmogrod\Functional\join; use function Widmogrod\Monad\Maybe\just; +use const Widmogrod\Functional\identity; -class JoinTest extends \PHPUnit\Framework\TestCase +class JoinTest extends TestCase { - /** - * @dataProvider provideData - */ + #[DataProvider('provideData')] public function test_it_should_remove_one_level_of_monadic_structure( Monad $monad, callable $run, @@ -26,23 +26,23 @@ public function test_it_should_remove_one_level_of_monadic_structure( $this->assertEquals($expected, $run($result)); } - public function provideData() + public static function provideData() { return [ 'Just (Just 1)' => [ - '$monad' => just(just(1)), - '$run' => identity, - '$value' => just(1), + just(just(1)), + identity, + just(1), ], 'Identity (Identity 1)' => [ - '$monad' => Identity::of(Identity::of(2)), - '$run' => identity, - '$value' => Identity::of(2), + Identity::of(Identity::of(2)), + identity, + Identity::of(2), ], 'State (State 1)' => [ - '$monad' => State\put(State\put(3)), - '$run' => flip(State\execState, 0), - '$value' => State\put(3), + State\put(State\put(3)), + flip(State\execState, 0), + State\put(3), ], ]; } diff --git a/test/Functional/LengthTest.php b/test/Functional/LengthTest.php index 3cc8709..bd1b03a 100644 --- a/test/Functional/LengthTest.php +++ b/test/Functional/LengthTest.php @@ -5,15 +5,15 @@ namespace test\Functional; use FunctionalPHP\FantasyLand\Foldable; +use PHPUnit\Framework\Attributes\DataProvider; +use PHPUnit\Framework\TestCase; use function Widmogrod\Functional\fromIterable; use function Widmogrod\Functional\fromNil; use function Widmogrod\Functional\length; -class LengthTest extends \PHPUnit\Framework\TestCase +class LengthTest extends TestCase { - /** - * @dataProvider provideData - */ + #[DataProvider('provideData')] public function test_it_should_return_boxed_value( Foldable $t, int $expected @@ -21,17 +21,17 @@ public function test_it_should_return_boxed_value( $this->assertEquals(length($t), ($expected)); } - public function provideData() + public static function provideData() { return [ 'Empty list should have length 0' => [ - '$t' => fromNil(), - '$expected' => 0, + fromNil(), + 0, ], 'Finite list should have length' => [ - '$t' => fromIterable([1, 2, 3, 4]), - '$expected' => 4, + fromIterable([1, 2, 3, 4]), + 4, ], ]; } diff --git a/test/Functional/LiftM2Test.php b/test/Functional/LiftM2Test.php index 2a18425..aafad1c 100644 --- a/test/Functional/LiftM2Test.php +++ b/test/Functional/LiftM2Test.php @@ -5,17 +5,17 @@ namespace test\Functional; use FunctionalPHP\FantasyLand\Monad; +use PHPUnit\Framework\Attributes\DataProvider; +use PHPUnit\Framework\TestCase; use Widmogrod\Common\ValueOfInterface; use Widmogrod\Functional as f; use Widmogrod\Monad\Either; use Widmogrod\Monad\IO; use Widmogrod\Monad\Maybe; -class LiftM2Test extends \PHPUnit\Framework\TestCase +class LiftM2Test extends TestCase { - /** - * @dataProvider monadsProvider - */ + #[DataProvider('monadsProvider')] public function test_it_should_lift2M( Monad $ma, Monad $mb, @@ -31,14 +31,14 @@ public function test_it_should_lift2M( } } - public function monadsProvider() + public static function monadsProvider() { $sumIntegers = static function (int $a, int $b) { return $a + $b; }; $sameValueOf = f\curryN(2, function ($expected, ValueOfInterface $actual) { - $this->assertSame($expected, f\valueOf($actual)); + self::assertSame($expected, f\valueOf($actual)); }); return [ @@ -105,7 +105,7 @@ public function monadsProvider() $sumIntegers, IO::class, function (IO $io) { - $this->assertSame(3, $io->run()); + self::assertSame(3, $io->run()); } ] ]; diff --git a/test/Functional/PipeTest.php b/test/Functional/PipeTest.php index c1c07f6..72f7134 100644 --- a/test/Functional/PipeTest.php +++ b/test/Functional/PipeTest.php @@ -4,13 +4,13 @@ namespace test\Functional; +use PHPUnit\Framework\Attributes\DataProvider; +use PHPUnit\Framework\TestCase; use Widmogrod\Functional as f; -class PipeTest extends \PHPUnit\Framework\TestCase +class PipeTest extends TestCase { - /** - * @dataProvider provideData - */ + #[DataProvider('provideData')] public function test_it_should_compose_and_inject_input_correctly( $functions, $value, @@ -22,13 +22,13 @@ public function test_it_should_compose_and_inject_input_correctly( ); } - public function provideData() + public static function provideData() { return [ 'two function' => [ - '$functions' => ['strtolower', 'strtoupper'], - '$value' => 'aBcD', - '$expected' => 'ABCD' + ['strtolower', 'strtoupper'], + 'aBcD', + 'ABCD' ], ]; } diff --git a/test/Functional/PipelineTest.php b/test/Functional/PipelineTest.php index 1c0534e..d4581fd 100644 --- a/test/Functional/PipelineTest.php +++ b/test/Functional/PipelineTest.php @@ -4,18 +4,19 @@ namespace test\Functional; +use Closure; +use PHPUnit\Framework\Attributes\DataProvider; +use PHPUnit\Framework\TestCase; use Widmogrod\Functional as f; -class PipelineTest extends \PHPUnit\Framework\TestCase +class PipelineTest extends TestCase { public function test_it_should_retun_function_accepting_arguments() { - $this->assertInstanceOf(\Closure::class, f\pipeline('strtolower', 'strtoupper')); + $this->assertInstanceOf(Closure::class, f\pipeline('strtolower', 'strtoupper')); } - /** - * @dataProvider provideData - */ + #[DataProvider('provideData')] public function test_it_should_be_curried( $functions, $value, @@ -28,13 +29,13 @@ public function test_it_should_be_curried( ); } - public function provideData() + public static function provideData() { return [ 'two function' => [ - '$functions' => ['strtolower', 'strtoupper'], - '$value' => 'aBcD', - '$expected' => 'ABCD' + ['strtolower', 'strtoupper'], + 'aBcD', + 'ABCD' ], ]; } diff --git a/test/Functional/PushTest.php b/test/Functional/PushTest.php index 462e1e6..4069d2d 100644 --- a/test/Functional/PushTest.php +++ b/test/Functional/PushTest.php @@ -4,13 +4,13 @@ namespace test\Functional; +use PHPUnit\Framework\Attributes\DataProvider; +use PHPUnit\Framework\TestCase; use Widmogrod\Functional as f; -class PushTest extends \PHPUnit\Framework\TestCase +class PushTest extends TestCase { - /** - * @dataProvider provideData - */ + #[DataProvider('provideData')] public function test_it_should_append_array_with_array_values( $array, $value, @@ -19,28 +19,28 @@ public function test_it_should_append_array_with_array_values( $this->assertEquals($expected, f\push_($array, $value)); } - public function provideData() + public static function provideData() { return [ 'list' => [ - '$array' => ['foo'], - '$value' => ['bar', 'baz'], - '$expected' => ['foo', 'bar', 'baz'], + ['foo'], + ['bar', 'baz'], + ['foo', 'bar', 'baz'], ], 'map' => [ - '$array' => ['foo'], - '$value' => ['x' => 'bar', 'y' => 'baz'], - '$expected' => ['foo', 'bar', 'baz'], + ['foo'], + ['x' => 'bar', 'y' => 'baz'], + ['foo', 'bar', 'baz'], ], 'empty array' => [ - '$array' => ['foo'], - '$value' => [], - '$expected' => ['foo'], + ['foo'], + [], + ['foo'], ], 'list with null' => [ - '$array' => ['foo'], - '$value' => [null], - '$expected' => ['foo', null], + ['foo'], + [null], + ['foo', null], ], ]; } diff --git a/test/Functional/ReduceTest.php b/test/Functional/ReduceTest.php index b2cebd3..25f992c 100644 --- a/test/Functional/ReduceTest.php +++ b/test/Functional/ReduceTest.php @@ -4,9 +4,10 @@ namespace test\Functional; +use PHPUnit\Framework\TestCase; use Widmogrod\Functional as f; -class ReduceTest extends \PHPUnit\Framework\TestCase +class ReduceTest extends TestCase { public function test_reduce() { diff --git a/test/Functional/RepeatTest.php b/test/Functional/RepeatTest.php index 78677a5..aa355f6 100644 --- a/test/Functional/RepeatTest.php +++ b/test/Functional/RepeatTest.php @@ -6,13 +6,14 @@ use Eris\Generator; use Eris\TestTrait; +use PHPUnit\Framework\TestCase; use function Widmogrod\Functional\eql; use function Widmogrod\Functional\filter; use function Widmogrod\Functional\length; use function Widmogrod\Functional\repeat; use function Widmogrod\Functional\take; -class RepeatTest extends \PHPUnit\Framework\TestCase +class RepeatTest extends TestCase { use TestTrait; diff --git a/test/Functional/ReplicateTest.php b/test/Functional/ReplicateTest.php index d84e748..26f1d38 100644 --- a/test/Functional/ReplicateTest.php +++ b/test/Functional/ReplicateTest.php @@ -6,12 +6,13 @@ use Eris\Generator; use Eris\TestTrait; +use PHPUnit\Framework\TestCase; use function Widmogrod\Functional\eql; use function Widmogrod\Functional\filter; use function Widmogrod\Functional\length; use function Widmogrod\Functional\replicate; -class ReplicateTest extends \PHPUnit\Framework\TestCase +class ReplicateTest extends TestCase { use TestTrait; diff --git a/test/Functional/ReverseTest.php b/test/Functional/ReverseTest.php index 9174ed7..b2f82f0 100644 --- a/test/Functional/ReverseTest.php +++ b/test/Functional/ReverseTest.php @@ -4,13 +4,13 @@ namespace test\Functional; +use PHPUnit\Framework\Attributes\DataProvider; +use PHPUnit\Framework\TestCase; use function Widmogrod\Functional\reverse; -class ReverseTest extends \PHPUnit\Framework\TestCase +class ReverseTest extends TestCase { - /** - * @dataProvider provideData - */ + #[DataProvider('provideData')] public function test_it_should_create_function_that_accept_args_in_reverse_order( callable $function, array $args @@ -30,26 +30,26 @@ public function test_it_should_create_function_that_accept_args_in_reverse_order ); } - public function provideData() + public static function provideData() { return [ 'non argument function' => [ - '$function' => function () { + function () { return 1; }, - '$value' => [], + [], ], 'non argument function but with args' => [ - '$function' => function () { + function () { return 1; }, - '$value' => [1, 2, 3], + [1, 2, 3], ], 'many args' => [ - '$function' => function ($a, $b, $c, $d) { + function ($a, $b, $c, $d) { return ($a - $c) * pow($b, $d); }, - '$value' => [ + [ random_int(-10, 10), random_int(-10, 10), random_int(-10, 10), @@ -57,10 +57,10 @@ public function provideData() ], ], 'variadic args' => [ - '$function' => function (...$args) { + function (...$args) { return array_product($args); }, - '$value' => [ + [ random_int(-10, 10), random_int(-10, 10), random_int(-10, 10), diff --git a/test/Functional/SpanTest.php b/test/Functional/SpanTest.php index 40003fd..8b79e21 100644 --- a/test/Functional/SpanTest.php +++ b/test/Functional/SpanTest.php @@ -5,19 +5,19 @@ namespace test\Functional; use Eris\TestTrait; -use function Widmogrod\Functional\constt; -use function Widmogrod\Functional\fromNil; +use PHPUnit\Framework\Attributes\DataProvider; +use PHPUnit\Framework\TestCase; use Widmogrod\Primitive\Listt; +use function Widmogrod\Functional\constt; use function Widmogrod\Functional\fromIterable; +use function Widmogrod\Functional\fromNil; use function Widmogrod\Functional\span; -class SpanTest extends \PHPUnit\Framework\TestCase +class SpanTest extends TestCase { use TestTrait; - /** - * @dataProvider provideData - */ + #[DataProvider('provideData')] public function test_it_should_return_spanned_list( callable $predicate, Listt $xs, @@ -41,7 +41,7 @@ public function test_it_should_return_spanned_list( ); } - public function provideData() + public static function provideData() { $lessThanTwo = function ($x) { return $x < 2; @@ -49,38 +49,38 @@ public function provideData() return [ 'span on empty list should be tuple of empty lists' => [ - '$predicate' => $lessThanTwo, - '$xs' => fromNil(), - '$expected' => [fromNil(), fromNil()], + $lessThanTwo, + fromNil(), + [fromNil(), fromNil()], ], 'span on finite list should be tuple of lists' => [ - '$predicate' => $lessThanTwo, - '$xs' => fromIterable([0, 1, 2, 3, 4]), - '$expected' => [fromIterable([0, 1]), fromIterable([2, 3, 4])], + $lessThanTwo, + fromIterable([0, 1, 2, 3, 4]), + [fromIterable([0, 1]), fromIterable([2, 3, 4])], ], 'span on finite list when predicate is always false should be:' => [ - '$predicate' => constt(false), - '$xs' => fromIterable([0, 1, 2, 3, 4]), - '$expected' => [fromNil(), fromIterable([0, 1, 2, 3, 4])], + constt(false), + fromIterable([0, 1, 2, 3, 4]), + [fromNil(), fromIterable([0, 1, 2, 3, 4])], ], 'span on finite list when predicate is always true should be:' => [ - '$predicate' => constt(true), - '$xs' => fromIterable([0, 1, 2, 3, 4]), - '$expected' => [fromIterable([0, 1, 2, 3, 4]), fromNil()], + constt(true), + fromIterable([0, 1, 2, 3, 4]), + [fromIterable([0, 1, 2, 3, 4]), fromNil()], ], ]; } -// -// public function test_it_should_work_on_infinite_lists() -// { -// $this->forAll( -// Generator\choose(1, 100), -// Generator\string(), -// Generator\string() -// )->then(function ($n, $a, $b) { -// $list = take($n, zip(repeat($a), repeat($b))); -// -// $this->assertEquals($n, length(filter(eql([$a, $b]), $list))); -// }); -// } + // + // public function test_it_should_work_on_infinite_lists() + // { + // $this->forAll( + // Generator\choose(1, 100), + // Generator\string(), + // Generator\string() + // )->then(function ($n, $a, $b) { + // $list = take($n, zip(repeat($a), repeat($b))); + // + // $this->assertEquals($n, length(filter(eql([$a, $b]), $list))); + // }); + // } } diff --git a/test/Functional/TailTest.php b/test/Functional/TailTest.php index 4b13e7c..dfb6622 100644 --- a/test/Functional/TailTest.php +++ b/test/Functional/TailTest.php @@ -4,16 +4,18 @@ namespace test\Functional; +use ArrayIterator; +use PHPUnit\Framework\Attributes\DataProvider; +use PHPUnit\Framework\TestCase; +use Widmogrod\Primitive\EmptyListError; use Widmogrod\Primitive\Listt; use function Widmogrod\Functional\fromIterable; use function Widmogrod\Functional\fromNil; use function Widmogrod\Functional\tail; -class TailTest extends \PHPUnit\Framework\TestCase +class TailTest extends TestCase { - /** - * @dataProvider provideData - */ + #[DataProvider('provideData')] public function test_it_should_return_boxed_value( Listt $listt, Listt $expected @@ -21,26 +23,24 @@ public function test_it_should_return_boxed_value( $this->assertTrue(tail($listt)->equals($expected)); } - public function provideData() + public static function provideData() { return [ 'Should return tail from finite array' => [ - '$listt' => fromIterable([1, 2, 3]), - '$expected' => fromIterable([2, 3]), + fromIterable([1, 2, 3]), + fromIterable([2, 3]), ], 'Should return tail from finite iterator' => [ - '$listt' => fromIterable(new \ArrayIterator([1, 2, 3, 4, 5, 6])), - '$expected' => fromIterable([2, 3, 4, 5, 6]), + fromIterable(new ArrayIterator([1, 2, 3, 4, 5, 6])), + fromIterable([2, 3, 4, 5, 6]), ], ]; } - /** - * @expectedException \Widmogrod\Primitive\EmptyListError - * @expectedExceptionMessage Cannot call tail() on empty list - */ public function test_it_should_throw_exception_when_list_is_empty() { + $this->expectException(EmptyListError::class); + $this->expectExceptionMessage('Cannot call tail() on empty list'); tail(fromNil()); } } diff --git a/test/Functional/TakeTest.php b/test/Functional/TakeTest.php index c226edd..20d6f35 100644 --- a/test/Functional/TakeTest.php +++ b/test/Functional/TakeTest.php @@ -4,17 +4,17 @@ namespace test\Functional; +use PHPUnit\Framework\Attributes\DataProvider; +use PHPUnit\Framework\TestCase; use Widmogrod\Primitive\Listt; use function Widmogrod\Functional\fromIterable; use function Widmogrod\Functional\fromNil; use function Widmogrod\Functional\repeat; use function Widmogrod\Functional\take; -class TakeTest extends \PHPUnit\Framework\TestCase +class TakeTest extends TestCase { - /** - * @dataProvider provideData - */ + #[DataProvider('provideData')] public function test_it( Listt $a, int $n, @@ -31,38 +31,38 @@ public function test_it( ); } - public function provideData() + public static function provideData() { return [ 'should return empty list from when input is empty list' => [ - '$a' => fromNil(), - '$n' => 1, - '$expected' => fromNil(), + fromNil(), + 1, + fromNil(), ], 'should empty list when n is zero' => [ - '$a' => fromIterable([1, 2, 3, 4, 5]), - '$n' => 0, - '$expected' => fromNil(), + fromIterable([1, 2, 3, 4, 5]), + 0, + fromNil(), ], 'should empty list when n is negative' => [ - '$a' => fromIterable([1, 2, 3, 4, 5]), - '$n' => random_int(-1000, -1), - '$expected' => fromNil(), + fromIterable([1, 2, 3, 4, 5]), + random_int(-1000, -1), + fromNil(), ], 'should return part of finite list' => [ - '$a' => fromIterable([1, 2, 3, 4, 5]), - '$n' => 3, - '$expected' => fromIterable([1, 2, 3]), + fromIterable([1, 2, 3, 4, 5]), + 3, + fromIterable([1, 2, 3]), ], 'should return whole list when take more than in the list' => [ - '$a' => fromIterable([1, 2, 3, 4, 5]), - '$n' => 3000, - '$expected' => fromIterable([1, 2, 3, 4, 5]), + fromIterable([1, 2, 3, 4, 5]), + 3000, + fromIterable([1, 2, 3, 4, 5]), ], 'should return part of infinite list' => [ - '$a' => repeat('a'), - '$n' => 3, - '$expected' => fromIterable(['a', 'a', 'a']), + repeat('a'), + 3, + fromIterable(['a', 'a', 'a']), ], ]; } diff --git a/test/Functional/TeeTest.php b/test/Functional/TeeTest.php index 7469a7d..f759899 100644 --- a/test/Functional/TeeTest.php +++ b/test/Functional/TeeTest.php @@ -4,13 +4,13 @@ namespace test\Functional; +use PHPUnit\Framework\Attributes\DataProvider; +use PHPUnit\Framework\TestCase; use Widmogrod\Functional as f; -class TeeTest extends \PHPUnit\Framework\TestCase +class TeeTest extends TestCase { - /** - * @dataProvider provideData - */ + #[DataProvider('provideData')] public function test_it_should_be_curried( $function, $value @@ -19,9 +19,7 @@ public function test_it_should_be_curried( $this->assertEquals($value, $curried($value)); } - /** - * @dataProvider provideData - */ + #[DataProvider('provideData')] public function test_it_should_return_input_value( $function, $value @@ -29,14 +27,14 @@ public function test_it_should_return_input_value( $this->assertEquals($value, f\tee($function, $value)); } - public function provideData() + public static function provideData() { return [ 'add two' => [ - '$function' => function ($v) { + function ($v) { return 2 + $v; }, - '$value' => 1, + 1, ], ]; } diff --git a/test/Functional/UnzipTest.php b/test/Functional/UnzipTest.php index 8e57674..fafadff 100644 --- a/test/Functional/UnzipTest.php +++ b/test/Functional/UnzipTest.php @@ -6,6 +6,8 @@ use Eris\Generator; use Eris\TestTrait; +use PHPUnit\Framework\Attributes\DataProvider; +use PHPUnit\Framework\TestCase; use Widmogrod\Primitive\Listt; use function Widmogrod\Functional\eql; use function Widmogrod\Functional\filter; @@ -16,13 +18,11 @@ use function Widmogrod\Functional\take; use function Widmogrod\Functional\unzip; -class UnzipTest extends \PHPUnit\Framework\TestCase +class UnzipTest extends TestCase { use TestTrait; - /** - * @dataProvider provideData - */ + #[DataProvider('provideData')] public function test_it_should_return_zipped_list( Listt $a, array $expected @@ -30,25 +30,24 @@ public function test_it_should_return_zipped_list( [$a, $b] = unzip($a); [$ea, $eb] = $expected; - $this->assertTrue($a->equals($ea)); $this->assertTrue($b->equals($eb)); } - public function provideData() + public static function provideData() { return [ 'unzipping of empty lists should be an tuple of empty lists' => [ - '$a' => fromNil(), - '$expected' => [fromNil(), fromNil()], + fromNil(), + [fromNil(), fromNil()], ], 'unzipping of lists should be an tuple of lists' => [ - '$a' => fromIterable([ + fromIterable([ [1, 'a'], [2, 'b'], [3, 'c'], ]), - '$expected' => [fromIterable([1, 2, 3]), fromIterable(['a', 'b', 'c'])], + [fromIterable([1, 2, 3]), fromIterable(['a', 'b', 'c'])], ], ]; } diff --git a/test/Functional/ValueOfTest.php b/test/Functional/ValueOfTest.php index 093c7ca..725520d 100644 --- a/test/Functional/ValueOfTest.php +++ b/test/Functional/ValueOfTest.php @@ -4,17 +4,17 @@ namespace test\Functional; +use PHPUnit\Framework\Attributes\DataProvider; +use PHPUnit\Framework\TestCase; use Widmogrod\Monad\Identity; use function Widmogrod\Functional\fromIterable; use function Widmogrod\Functional\valueOf; use function Widmogrod\Monad\Maybe\just; use function Widmogrod\Monad\Maybe\nothing; -class ValueOfTest extends \PHPUnit\Framework\TestCase +class ValueOfTest extends TestCase { - /** - * @dataProvider provideData - */ + #[DataProvider('provideData')] public function test_it_should_return_boxed_value( $value, $expected @@ -25,36 +25,36 @@ public function test_it_should_return_boxed_value( ); } - public function provideData() + public static function provideData() { return [ 'Native int should be return as is' => [ - '$value' => 1023, - '$expected' => 1023, + 1023, + 1023, ], 'Native string should be return as is' => [ - '$value' => 'Something amazing', - '$expected' => 'Something amazing', + 'Something amazing', + 'Something amazing', ], 'Native array should be return as is' => [ - '$value' => [1, 2, 3], - '$expected' => [1, 2, 3], + [1, 2, 3], + [1, 2, 3], ], 'Identity 6' => [ - '$value' => Identity::of(6), - '$expected' => 6 + Identity::of(6), + 6 ], 'Just 6' => [ - '$value' => just(6), - '$expected' => 6 + just(6), + 6 ], 'Nothing' => [ - '$value' => nothing(), - '$expected' => null + nothing(), + null ], 'Listt' => [ - '$value' => fromIterable([1, 2, 3]), - '$expected' => [1, 2, 3] + fromIterable([1, 2, 3]), + [1, 2, 3] ], ]; } diff --git a/test/Functional/ZipTest.php b/test/Functional/ZipTest.php index 1b49416..a6a1df2 100644 --- a/test/Functional/ZipTest.php +++ b/test/Functional/ZipTest.php @@ -6,6 +6,8 @@ use Eris\Generator; use Eris\TestTrait; +use PHPUnit\Framework\Attributes\DataProvider; +use PHPUnit\Framework\TestCase; use Widmogrod\Primitive\Listt; use function Widmogrod\Functional\eql; use function Widmogrod\Functional\filter; @@ -16,13 +18,11 @@ use function Widmogrod\Functional\take; use function Widmogrod\Functional\zip; -class ZipTest extends \PHPUnit\Framework\TestCase +class ZipTest extends TestCase { use TestTrait; - /** - * @dataProvider provideData - */ + #[DataProvider('provideData')] public function test_it_should_return_zipped_list( Listt $a, Listt $b, @@ -39,37 +39,37 @@ public function test_it_should_return_zipped_list( ); } - public function provideData() + public static function provideData() { return [ 'zipping of two empty lists should be an empty list' => [ - '$a' => fromNil(), - '$b' => fromNil(), - '$expected' => fromNil(), + fromNil(), + fromNil(), + fromNil(), ], 'zipping of two lists when left is an empty list' => [ - '$a' => fromNil(), - '$b' => fromIterable([1, 2, 3, 4]), - '$expected' => fromNil(), + fromNil(), + fromIterable([1, 2, 3, 4]), + fromNil(), ], 'zipping of two lists when right is an empty list' => [ - '$a' => fromIterable([1, 2, 3, 4]), - '$b' => fromNil(), - '$expected' => fromNil(), + fromIterable([1, 2, 3, 4]), + fromNil(), + fromNil(), ], 'zipping of two lists when left is shorter list' => [ - '$a' => fromIterable([1, 2, 3]), - '$b' => fromIterable(['a', 'b', 'c', 'd']), - '$expected' => fromIterable([ + fromIterable([1, 2, 3]), + fromIterable(['a', 'b', 'c', 'd']), + fromIterable([ [1, 'a'], [2, 'b'], [3, 'c'] ]), ], 'zipping of two lists when right is shorter list' => [ - '$a' => fromIterable([1, 2, 3, 4]), - '$b' => fromIterable(['a', 'b', 'c']), - '$expected' => fromIterable([ + fromIterable([1, 2, 3, 4]), + fromIterable(['a', 'b', 'c']), + fromIterable([ [1, 'a'], [2, 'b'], [3, 'c'] diff --git a/test/Monad/EitherTest.php b/test/Monad/EitherTest.php index 12579b5..b7ab615 100644 --- a/test/Monad/EitherTest.php +++ b/test/Monad/EitherTest.php @@ -6,19 +6,19 @@ use FunctionalPHP\FantasyLand\Applicative; use FunctionalPHP\FantasyLand\Functor; -use Widmogrod\Functional as f; use FunctionalPHP\FantasyLand\Helpful\ApplicativeLaws; use FunctionalPHP\FantasyLand\Helpful\FunctorLaws; use FunctionalPHP\FantasyLand\Helpful\MonadLaws; +use PHPUnit\Framework\Attributes\DataProvider; +use PHPUnit\Framework\TestCase; +use Widmogrod\Functional as f; use Widmogrod\Monad\Either; use Widmogrod\Monad\Either\Left; use Widmogrod\Monad\Either\Right; -class EitherTest extends \PHPUnit\Framework\TestCase +class EitherTest extends TestCase { - /** - * @dataProvider provideData - */ + #[DataProvider('provideData')] public function test_if_maybe_monad_obeys_the_laws($return, $f, $g, $x) { MonadLaws::test( @@ -30,36 +30,34 @@ public function test_if_maybe_monad_obeys_the_laws($return, $f, $g, $x) ); } - public function provideData() + public static function provideData() { return [ 'Right' => [ - '$return' => Right::of, - '$f' => function ($x) { + Right::of, + function ($x) { return Right::of($x + 1); }, - '$g' => function ($x) { + function ($x) { return Right::of($x + 2); }, - '$x' => 10, + 10, ], // I don't know if Left should be tested? 'Left' => [ - '$return' => Left::of, - '$f' => function ($x) { + Left::of, + function ($x) { return Left::of($x); }, - '$g' => function ($x) { + function ($x) { return Left::of($x); }, - '$x' => 10, + 10, ], ]; } - /** - * @dataProvider provideApplicativeTestData - */ + #[DataProvider('provideApplicativeTestData')] public function test_it_should_obey_applicative_laws( $pure, Applicative $u, @@ -79,47 +77,45 @@ public function test_it_should_obey_applicative_laws( ); } - public function provideApplicativeTestData() + public static function provideApplicativeTestData() { return [ 'Right' => [ - '$pure' => Either\pure, - '$u' => Right::of(function () { + Either\pure, + Right::of(function () { return 1; }), - '$v' => Right::of(function () { + Right::of(function () { return 5; }), - '$w' => Right::of(function () { + Right::of(function () { return 7; }), - '$f' => function ($x) { + function ($x) { return $x + 400; }, - '$x' => 33 + 33 ], 'Left' => [ - '$pure' => Either\pure, - '$u' => Left::of(function () { + Either\pure, + Left::of(function () { return 1; }), - '$v' => Left::of(function () { + Left::of(function () { return 5; }), - '$w' => Left::of(function () { + Left::of(function () { return 7; }), - '$f' => function ($x) { + function ($x) { return $x + 400; }, - '$x' => 33 + 33 ], ]; } - /** - * @dataProvider provideFunctorTestData - */ + #[DataProvider('provideFunctorTestData')] public function test_it_should_obey_functor_laws( callable $f, callable $g, @@ -133,26 +129,26 @@ public function test_it_should_obey_functor_laws( ); } - public function provideFunctorTestData() + public static function provideFunctorTestData() { return [ 'Right' => [ - '$f' => function ($x) { + function ($x) { return $x + 1; }, - '$g' => function ($x) { + function ($x) { return $x + 5; }, - '$x' => Right::of(1), + Right::of(1), ], 'Left' => [ - '$f' => function ($x) { + function ($x) { return $x + 1; }, - '$g' => function ($x) { + function ($x) { return $x + 5; }, - '$x' => Left::of(1), + Left::of(1), ], ]; } diff --git a/test/Monad/FreeTest.php b/test/Monad/FreeTest.php index 00373c0..0c61e5d 100644 --- a/test/Monad/FreeTest.php +++ b/test/Monad/FreeTest.php @@ -9,19 +9,19 @@ use FunctionalPHP\FantasyLand\Helpful\ApplicativeLaws; use FunctionalPHP\FantasyLand\Helpful\FunctorLaws; use FunctionalPHP\FantasyLand\Helpful\MonadLaws; +use PHPUnit\Framework\Attributes\DataProvider; +use PHPUnit\Framework\TestCase; use Widmogrod\Monad\Free\MonadFree; use Widmogrod\Monad\Free\Pure; use Widmogrod\Monad\Identity; -use const Widmogrod\Functional\identity; use function Widmogrod\Functional\curryN; use function Widmogrod\Monad\Free\foldFree; use function Widmogrod\Monad\Free\liftF; +use const Widmogrod\Functional\identity; -class FreeTest extends \PHPUnit\Framework\TestCase +class FreeTest extends TestCase { - /** - * @dataProvider provideFunctorTestData - */ + #[DataProvider('provideFunctorTestData')] public function test_it_should_obey_functor_laws( callable $f, callable $g, @@ -41,33 +41,31 @@ function (MonadFree $a, MonadFree $b, $message) { ); } - public function provideFunctorTestData() + public static function provideFunctorTestData() { return [ 'Pure' => [ - '$f' => function (int $x) { + function (int $x) { return $x + 1; }, - '$g' => function (int $x) { + function (int $x) { return $x + 5; }, - '$x' => Pure::of(1), + Pure::of(1), ], 'Free' => [ - '$f' => function (int $x) { + function (int $x) { return $x + 1; }, - '$g' => function (int $x) { + function (int $x) { return $x + 5; }, - '$x' => liftF(Pure::of(1)), + liftF(Pure::of(1)), ], ]; } - /** - * @dataProvider provideMonadTestData - */ + #[DataProvider('provideMonadTestData')] public function test_it_should_obey_monad_laws($f, $g, $x) { MonadLaws::test( @@ -85,7 +83,7 @@ function (MonadFree $f, MonadFree $g, $message) { ); } - public function provideMonadTestData() + public static function provideMonadTestData() { $addOne = function (int $x) { return Pure::of($x + 1); @@ -96,16 +94,14 @@ public function provideMonadTestData() return [ 'Identity' => [ - '$f' => $addOne, - '$g' => $addTwo, - '$x' => 10, + $addOne, + $addTwo, + 10, ], ]; } - /** - * @dataProvider provideApplicativeTestData - */ + #[DataProvider('provideApplicativeTestData')] public function test_it_should_obey_applicative_laws( $pure, Applicative $u, @@ -131,24 +127,24 @@ function (MonadFree $a, MonadFree $b, $message) { ); } - public function provideApplicativeTestData() + public static function provideApplicativeTestData() { return [ 'Pure' => [ - '$pure' => Pure::of, - '$u' => Pure::of(function () { + Pure::of, + Pure::of(function () { return 1; }), - '$v' => Pure::of(function () { + Pure::of(function () { return 5; }), - '$w' => Pure::of(function () { + Pure::of(function () { return 7; }), - '$f' => function ($x) { + function ($x) { return 400 + $x; }, - '$x' => 33 + 33 ], ]; } diff --git a/test/Monad/IOTest.php b/test/Monad/IOTest.php index f39c642..199476f 100644 --- a/test/Monad/IOTest.php +++ b/test/Monad/IOTest.php @@ -6,17 +6,17 @@ use FunctionalPHP\FantasyLand\Applicative; use FunctionalPHP\FantasyLand\Functor; -use Widmogrod\Functional as f; use FunctionalPHP\FantasyLand\Helpful\ApplicativeLaws; use FunctionalPHP\FantasyLand\Helpful\FunctorLaws; use FunctionalPHP\FantasyLand\Helpful\MonadLaws; +use PHPUnit\Framework\Attributes\DataProvider; +use PHPUnit\Framework\TestCase; +use Widmogrod\Functional as f; use Widmogrod\Monad\IO; -class IOTest extends \PHPUnit\Framework\TestCase +class IOTest extends TestCase { - /** - * @dataProvider provideData - */ + #[DataProvider('provideData')] public function test_if_io_monad_obeys_the_laws($f, $g, $x) { MonadLaws::test( @@ -38,7 +38,7 @@ function ($x) { ); } - public function provideData() + public static function provideData() { $addOne = function ($x) { return IO::of(function () use ($x) { @@ -53,16 +53,14 @@ public function provideData() return [ 'Identity' => [ - '$f' => $addOne, - '$g' => $addTwo, - '$x' => 10, + $addOne, + $addTwo, + 10, ], ]; } - /** - * @dataProvider provideApplicativeTestData - */ + #[DataProvider('provideApplicativeTestData')] public function test_it_should_obey_applicative_laws( $pure, Applicative $u, @@ -88,31 +86,29 @@ function (IO $a, IO $b, $message) { ); } - public function provideApplicativeTestData() + public static function provideApplicativeTestData() { return [ 'IO' => [ - '$pure' => IO\pure, - '$u' => IO\pure(function () { + IO\pure, + IO\pure(function () { return 1; }), - '$v' => IO\pure(function () { + IO\pure(function () { return 5; }), - '$w' => IO\pure(function () { + IO\pure(function () { return 7; }), - '$f' => function ($x) { + function ($x) { return 400 + $x; }, - '$x' => 33 + 33 ], ]; } - /** - * @dataProvider provideFunctorTestData - */ + #[DataProvider('provideFunctorTestData')] public function test_it_should_obey_functor_laws( callable $f, callable $g, @@ -132,17 +128,17 @@ function (IO $a, IO $b, $message) { ); } - public function provideFunctorTestData() + public static function provideFunctorTestData() { return [ 'IO' => [ - '$f' => function ($x) { + function ($x) { return $x + 1; }, - '$g' => function ($x) { + function ($x) { return $x + 5; }, - '$x' => IO::of(function () { + IO::of(function () { return 1; }), ], diff --git a/test/Monad/IdentityTest.php b/test/Monad/IdentityTest.php index 85ac494..230a52a 100644 --- a/test/Monad/IdentityTest.php +++ b/test/Monad/IdentityTest.php @@ -6,17 +6,17 @@ use FunctionalPHP\FantasyLand\Applicative; use FunctionalPHP\FantasyLand\Functor; -use Widmogrod\Functional as f; use FunctionalPHP\FantasyLand\Helpful\ApplicativeLaws; use FunctionalPHP\FantasyLand\Helpful\FunctorLaws; use FunctionalPHP\FantasyLand\Helpful\MonadLaws; +use PHPUnit\Framework\Attributes\DataProvider; +use PHPUnit\Framework\TestCase; +use Widmogrod\Functional as f; use Widmogrod\Monad\Identity; -class IdentityTest extends \PHPUnit\Framework\TestCase +class IdentityTest extends TestCase { - /** - * @dataProvider provideData - */ + #[DataProvider('provideData')] public function test_if_identity_monad_obeys_the_laws($f, $g, $x) { MonadLaws::test( @@ -28,7 +28,7 @@ public function test_if_identity_monad_obeys_the_laws($f, $g, $x) ); } - public function provideData() + public static function provideData() { $addOne = function ($x) { return Identity::of($x + 1); @@ -39,16 +39,14 @@ public function provideData() return [ 'Identity' => [ - '$f' => $addOne, - '$g' => $addTwo, - '$x' => 10, + $addOne, + $addTwo, + 10, ], ]; } - /** - * @dataProvider provideApplicativeTestData - */ + #[DataProvider('provideApplicativeTestData')] public function test_it_should_obey_applicative_laws( Applicative $u, Applicative $v, @@ -67,30 +65,28 @@ public function test_it_should_obey_applicative_laws( ); } - public function provideApplicativeTestData() + public static function provideApplicativeTestData() { return [ 'default' => [ - '$u' => Identity::of(function () { + Identity::of(function () { return 1; }), - '$v' => Identity::of(function () { + Identity::of(function () { return 5; }), - '$w' => Identity::of(function () { + Identity::of(function () { return 7; }), - '$f' => function ($x) { + function ($x) { return $x + 400; }, - '$x' => 33 + 33 ], ]; } - /** - * @dataProvider provideFunctorTestData - */ + #[DataProvider('provideFunctorTestData')] public function test_it_should_obey_functor_laws( callable $f, callable $g, @@ -104,17 +100,17 @@ public function test_it_should_obey_functor_laws( ); } - public function provideFunctorTestData() + public static function provideFunctorTestData() { return [ 'Identity' => [ - '$f' => function ($x) { + function ($x) { return $x + 1; }, - '$g' => function ($x) { + function ($x) { return $x + 5; }, - '$x' => Identity::of(123), + Identity::of(123), ], ]; } diff --git a/test/Monad/MaybeTest.php b/test/Monad/MaybeTest.php index b5deee8..95c087b 100644 --- a/test/Monad/MaybeTest.php +++ b/test/Monad/MaybeTest.php @@ -6,21 +6,21 @@ use FunctionalPHP\FantasyLand\Applicative; use FunctionalPHP\FantasyLand\Functor; -use Widmogrod\Functional as f; use FunctionalPHP\FantasyLand\Helpful\ApplicativeLaws; use FunctionalPHP\FantasyLand\Helpful\FunctorLaws; use FunctionalPHP\FantasyLand\Helpful\MonadLaws; use FunctionalPHP\FantasyLand\Helpful\MonoidLaws; +use PHPUnit\Framework\Attributes\DataProvider; +use PHPUnit\Framework\TestCase; +use Widmogrod\Functional as f; use Widmogrod\Monad\Maybe; use Widmogrod\Monad\Maybe\Just; use Widmogrod\Monad\Maybe\Nothing; use Widmogrod\Primitive\Stringg; -class MaybeTest extends \PHPUnit\Framework\TestCase +class MaybeTest extends TestCase { - /** - * @dataProvider provideData - */ + #[DataProvider('provideData')] public function test_if_maybe_monad_obeys_the_laws($return, $f, $g, $x) { MonadLaws::test( @@ -32,35 +32,33 @@ public function test_if_maybe_monad_obeys_the_laws($return, $f, $g, $x) ); } - public function provideData() + public static function provideData() { return [ 'Just' => [ - '$return' => Just::of, - '$f' => function ($x) { + Just::of, + function ($x) { return Just::of($x + 1); }, - '$g' => function ($x) { + function ($x) { return Just::of($x + 2); }, - '$x' => 10, + 10, ], 'Nothing' => [ - '$return' => Nothing::of, - '$f' => function ($x) { + Nothing::of, + function ($x) { return Nothing::of($x + 1); }, - '$g' => function ($x) { + function ($x) { return Nothing::of($x + 2); }, - '$x' => 10, + 10, ], ]; } - /** - * @dataProvider provideApplicativeTestData - */ + #[DataProvider('provideApplicativeTestData')] public function test_it_should_obey_applicative_laws( $pure, Applicative $u, @@ -80,47 +78,45 @@ public function test_it_should_obey_applicative_laws( ); } - public function provideApplicativeTestData() + public static function provideApplicativeTestData() { return [ 'Just' => [ - '$pure' => Maybe\pure, - '$u' => Just::of(function () { + Maybe\pure, + Just::of(function () { return 1; }), - '$v' => Just::of(function () { + Just::of(function () { return 5; }), - '$w' => Just::of(function () { + Just::of(function () { return 7; }), - '$f' => function ($x) { + function ($x) { return $x + 400; }, - '$x' => 33 + 33 ], 'Nothing' => [ - '$pure' => Maybe\pure, - '$u' => Nothing::of(function () { + Maybe\pure, + Nothing::of(function () { return 1; }), - '$v' => Nothing::of(function () { + Nothing::of(function () { return 5; }), - '$w' => Nothing::of(function () { + Nothing::of(function () { return 7; }), - '$f' => function ($x) { + function ($x) { return $x + 400; }, - '$x' => 33 + 33 ], ]; } - /** - * @dataProvider provideMonoidTestData - */ + #[DataProvider('provideMonoidTestData')] public function test_it_should_obey_monoid_laws($x, $y, $z) { MonoidLaws::test( @@ -131,35 +127,33 @@ public function test_it_should_obey_monoid_laws($x, $y, $z) ); } - public function provideMonoidTestData() + public static function provideMonoidTestData() { return [ 'Just' => [ - '$x' => Just::of(f\fromIterable([1])), - '$y' => Just::of(f\fromIterable([2])), - '$z' => Just::of(f\fromIterable([3])) + Just::of(f\fromIterable([1])), + Just::of(f\fromIterable([2])), + Just::of(f\fromIterable([3])) ], 'Nothing' => [ - '$x' => Nothing::mempty(), - '$y' => Nothing::mempty(), - '$z' => Nothing::mempty(), + Nothing::mempty(), + Nothing::mempty(), + Nothing::mempty(), ], 'Just String' => [ - '$x' => Just::of(Stringg::of("Hello")), - '$y' => Just::of(Stringg::of(" ")), - '$z' => Just::of(Stringg::of("World")) + Just::of(Stringg::of("Hello")), + Just::of(Stringg::of(" ")), + Just::of(Stringg::of("World")) ], 'Maybe String' => [ - '$x' => Just::of(Stringg::of("Hello")), - '$y' => Nothing::mempty(), - '$z' => Just::of(Stringg::of("World")) + Just::of(Stringg::of("Hello")), + Nothing::mempty(), + Just::of(Stringg::of("World")) ], ]; } - /** - * @dataProvider provideFunctorTestData - */ + #[DataProvider('provideFunctorTestData')] public function test_it_should_obey_functor_laws( callable $f, callable $g, @@ -173,26 +167,26 @@ public function test_it_should_obey_functor_laws( ); } - public function provideFunctorTestData() + public static function provideFunctorTestData() { return [ 'Just' => [ - '$f' => function ($x) { + function ($x) { return $x + 1; }, - '$g' => function ($x) { + function ($x) { return $x + 5; }, - '$x' => Just::of(1), + Just::of(1), ], 'Nothing' => [ - '$f' => function ($x) { + function ($x) { return $x + 1; }, - '$g' => function ($x) { + function ($x) { return $x + 5; }, - '$x' => Nothing::of(1), + Nothing::of(1), ], ]; } diff --git a/test/Monad/ReaderTest.php b/test/Monad/ReaderTest.php index 5805dbb..224f247 100644 --- a/test/Monad/ReaderTest.php +++ b/test/Monad/ReaderTest.php @@ -9,13 +9,13 @@ use FunctionalPHP\FantasyLand\Helpful\ApplicativeLaws; use FunctionalPHP\FantasyLand\Helpful\FunctorLaws; use FunctionalPHP\FantasyLand\Helpful\MonadLaws; +use PHPUnit\Framework\Attributes\DataProvider; +use PHPUnit\Framework\TestCase; use Widmogrod\Monad\Reader; -class ReaderTest extends \PHPUnit\Framework\TestCase +class ReaderTest extends TestCase { - /** - * @dataProvider provideData - */ + #[DataProvider('provideData')] public function test_if_reader_monad_obeys_the_laws($f, $g, $x, $env) { MonadLaws::test( @@ -33,7 +33,7 @@ function (Reader $a, Reader $b, $message) use ($env) { ); } - public function provideData() + public static function provideData() { $hello = function ($x) { return Reader\value($x + 1); @@ -44,17 +44,15 @@ public function provideData() return [ 'reader 0' => [ - '$f' => $hello, - '$g' => $hi, - '$x' => 54, - '$env' => 666, + $hello, + $hi, + 54, + 666, ], ]; } - /** - * @dataProvider provideApplicativeTestData - */ + #[DataProvider('provideApplicativeTestData')] public function test_it_should_obey_applicative_laws( $pure, Applicative $u, @@ -81,32 +79,30 @@ function (Reader $a, Reader $b, $message) use ($reader) { ); } - public function provideApplicativeTestData() + public static function provideApplicativeTestData() { return [ 'Reader' => [ - '$pure' => Reader\pure, - '$u' => Reader\pure(function () { + Reader\pure, + Reader\pure(function () { return 1; }), - '$v' => Reader\pure(function () { + Reader\pure(function () { return 5; }), - '$w' => Reader\pure(function () { + Reader\pure(function () { return 7; }), - '$f' => function ($x) { + function ($x) { return 400 + $x; }, - '$x' => 33, - '$reader' => 3, + 33, + 3, ], ]; } - /** - * @dataProvider provideFunctorTestData - */ + #[DataProvider('provideFunctorTestData')] public function test_it_should_obey_functor_laws( callable $f, callable $g, @@ -127,18 +123,18 @@ function (Reader $a, Reader $b, $message) use ($reader) { ); } - public function provideFunctorTestData() + public static function provideFunctorTestData() { return [ 'Reader' => [ - '$f' => function ($x) { + function ($x) { return $x + 1; }, - '$g' => function ($x) { + function ($x) { return $x + 5; }, - '$x' => Reader\value(3), - '$reader' => 'asd', + Reader\value(3), + 'asd', ], ]; } diff --git a/test/Monad/StateTest.php b/test/Monad/StateTest.php index cde0110..b768ecd 100644 --- a/test/Monad/StateTest.php +++ b/test/Monad/StateTest.php @@ -6,17 +6,17 @@ use FunctionalPHP\FantasyLand\Applicative; use FunctionalPHP\FantasyLand\Functor; -use Widmogrod\Functional as f; use FunctionalPHP\FantasyLand\Helpful\ApplicativeLaws; use FunctionalPHP\FantasyLand\Helpful\FunctorLaws; use FunctionalPHP\FantasyLand\Helpful\MonadLaws; +use PHPUnit\Framework\Attributes\DataProvider; +use PHPUnit\Framework\TestCase; +use Widmogrod\Functional as f; use Widmogrod\Monad\State; -class StateTest extends \PHPUnit\Framework\TestCase +class StateTest extends TestCase { - /** - * @dataProvider provideData - */ + #[DataProvider('provideData')] public function test_if_state_monad_obeys_the_laws($f, $g, $x, $state) { MonadLaws::test( @@ -34,7 +34,7 @@ function (State $a, State $b, $message) use ($state) { ); } - public function provideData() + public static function provideData() { $addOne = function ($x) { return State\value($x + 1); @@ -45,17 +45,15 @@ public function provideData() return [ 'state 0' => [ - '$f' => $addOne, - '$g' => $addTwo, - '$x' => 10, - '$state' => 0, + $addOne, + $addTwo, + 10, + 0, ], ]; } - /** - * @dataProvider provideApplicativeTestData - */ + #[DataProvider('provideApplicativeTestData')] public function test_it_should_obey_applicative_laws( $pure, Applicative $u, @@ -82,32 +80,30 @@ function (State $a, State $b, $message) use ($state) { ); } - public function provideApplicativeTestData() + public static function provideApplicativeTestData() { return [ 'State' => [ - '$pure' => State\pure, - '$u' => State\pure(function () { + State\pure, + State\pure(function () { return 1; }), - '$v' => State\pure(function ($x) { + State\pure(function ($x) { return 5; }), - '$w' => State\pure(function ($x) { + State\pure(function ($x) { return 7; }), - '$f' => function ($x) { + function ($x) { return 400 + $x; }, - '$x' => 33, - '$state' => 3, + 33, + 3, ], ]; } - /** - * @dataProvider provideFunctorTestData - */ + #[DataProvider('provideFunctorTestData')] public function test_it_should_obey_functor_laws( callable $f, callable $g, @@ -128,18 +124,18 @@ function (State $a, State $b, $message) use ($state) { ); } - public function provideFunctorTestData() + public static function provideFunctorTestData() { return [ 'State' => [ - '$f' => function ($x) { + function ($x) { return $x + 1; }, - '$g' => function ($x) { + function ($x) { return $x + 5; }, - '$x' => State\value(3), - '$state' => 'asd', + State\value(3), + 'asd', ], ]; } diff --git a/test/Monad/WriterTest.php b/test/Monad/WriterTest.php index 89f40d5..e742c82 100644 --- a/test/Monad/WriterTest.php +++ b/test/Monad/WriterTest.php @@ -9,13 +9,13 @@ use FunctionalPHP\FantasyLand\Helpful\ApplicativeLaws; use FunctionalPHP\FantasyLand\Helpful\FunctorLaws; use FunctionalPHP\FantasyLand\Helpful\MonadLaws; +use PHPUnit\Framework\Attributes\DataProvider; +use PHPUnit\Framework\TestCase; use Widmogrod\Monad\Writer; -class WriterTest extends \PHPUnit\Framework\TestCase +class WriterTest extends TestCase { - /** - * @dataProvider provideData - */ + #[DataProvider('provideData')] public function test_if_writer_monad_obeys_the_laws($f, $g, $x) { MonadLaws::test( @@ -33,7 +33,7 @@ function (Writer $a, Writer $b, $message) { ); } - public function provideData() + public static function provideData() { $addOne = function ($x) { return Writer::of($x + 1); @@ -44,16 +44,14 @@ public function provideData() return [ 'writer 0' => [ - '$f' => $addOne, - '$g' => $addTwo, - '$x' => 10, + $addOne, + $addTwo, + 10, ], ]; } - /** - * @dataProvider provideApplicativeTestData - */ + #[DataProvider('provideApplicativeTestData')] public function test_it_should_obey_applicative_laws( $pure, Applicative $u, @@ -79,31 +77,29 @@ function (Writer $a, Writer $b, $message) { ); } - public function provideApplicativeTestData() + public static function provideApplicativeTestData() { return [ 'Writer' => [ - '$pure' => Writer\pure, - '$u' => Writer\pure(function () { + Writer\pure, + Writer\pure(function () { return 1; }), - '$v' => Writer\pure(function () { + Writer\pure(function () { return 5; }), - '$w' => Writer\pure(function () { + Writer\pure(function () { return 7; }), - '$f' => function ($x) { + function ($x) { return 400 + $x; }, - '$x' => 33, + 33, ], ]; } - /** - * @dataProvider provideFunctorTestData - */ + #[DataProvider('provideFunctorTestData')] public function test_it_should_obey_functor_laws( callable $f, callable $g, @@ -123,17 +119,17 @@ function (Writer $a, Writer $b, $message) { ); } - public function provideFunctorTestData() + public static function provideFunctorTestData() { return [ 'Writer' => [ - '$f' => function ($x) { + function ($x) { return $x + 1; }, - '$g' => function ($x) { + function ($x) { return $x + 5; }, - '$x' => Writer\pure(3), + Writer\pure(3), ], ]; } diff --git a/test/Primitive/ListtTest.php b/test/Primitive/ListtTest.php index b81730d..3a5a1fc 100644 --- a/test/Primitive/ListtTest.php +++ b/test/Primitive/ListtTest.php @@ -7,24 +7,24 @@ use Eris\TestTrait; use FunctionalPHP\FantasyLand\Applicative; use FunctionalPHP\FantasyLand\Functor; -use FunctionalPHP\FantasyLand\Monoid; -use Widmogrod\Functional as f; use FunctionalPHP\FantasyLand\Helpful\ApplicativeLaws; use FunctionalPHP\FantasyLand\Helpful\FunctorLaws; use FunctionalPHP\FantasyLand\Helpful\MonadLaws; use FunctionalPHP\FantasyLand\Helpful\MonoidLaws; -use const Widmogrod\Functional\fromValue; +use FunctionalPHP\FantasyLand\Monoid; +use PHPUnit\Framework\Attributes\DataProvider; +use PHPUnit\Framework\TestCase; +use Widmogrod\Functional as f; use function Eris\Generator\choose; use function Eris\Generator\vector; use function Widmogrod\Functional\fromNil; +use const Widmogrod\Functional\fromValue; -class ListtTest extends \PHPUnit\Framework\TestCase +class ListtTest extends TestCase { use TestTrait; - /** - * @dataProvider provideData - */ + #[DataProvider('provideData')] public function test_if_list_obeys_the_laws($f, $g, $x) { MonadLaws::test( @@ -36,7 +36,7 @@ public function test_if_list_obeys_the_laws($f, $g, $x) ); } - public function provideData() + public static function provideData() { $addOne = function ($x) { return f\fromIterable([$x + 1]); @@ -47,16 +47,14 @@ public function provideData() return [ 'Listt' => [ - '$f' => $addOne, - '$g' => $addTwo, - '$x' => 10, + $addOne, + $addTwo, + 10, ], ]; } - /** - * @dataProvider provideApplicativeTestData - */ + #[DataProvider('provideApplicativeTestData')] public function test_it_should_obey_applicative_laws( $pure, Applicative $u, @@ -76,31 +74,29 @@ public function test_it_should_obey_applicative_laws( ); } - public function provideApplicativeTestData() + public static function provideApplicativeTestData() { return [ 'Listt' => [ - '$pure' => fromValue, - '$u' => f\fromIterable([function () { + fromValue, + f\fromIterable([function () { return 1; }]), - '$v' => f\fromIterable([function () { + f\fromIterable([function () { return 5; }]), - '$w' => f\fromIterable([function () { + f\fromIterable([function () { return 7; }]), - '$f' => function ($x) { + function ($x) { return $x + 400; }, - '$x' => 33 + 33 ], ]; } - /** - * @dataProvider provideFunctorTestData - */ + #[DataProvider('provideFunctorTestData')] public function test_it_should_obey_functor_laws( callable $f, callable $g, @@ -114,24 +110,22 @@ public function test_it_should_obey_functor_laws( ); } - public function provideFunctorTestData() + public static function provideFunctorTestData() { return [ 'Listt' => [ - '$f' => function ($x) { + function ($x) { return $x + 1; }, - '$g' => function ($x) { + function ($x) { return $x + 5; }, - '$x' => f\fromIterable([1, 2, 3]), + f\fromIterable([1, 2, 3]), ], ]; } - /** - * @dataProvider provideRandomizedData - */ + #[DataProvider('provideRandomizedData')] public function test_it_should_obey_monoid_laws(Monoid $x, Monoid $y, Monoid $z) { MonoidLaws::test( @@ -142,18 +136,18 @@ public function test_it_should_obey_monoid_laws(Monoid $x, Monoid $y, Monoid $z) ); } - private function randomize() + public static function randomize() { return f\fromIterable(array_keys(array_fill(0, random_int(20, 100), null))); } - public function provideRandomizedData() + public static function provideRandomizedData() { return array_map(function () { return [ - $this->randomize(), - $this->randomize(), - $this->randomize(), + self::randomize(), + self::randomize(), + self::randomize(), ]; }, array_fill(0, 50, null)); } diff --git a/test/Primitive/NumTest.php b/test/Primitive/NumTest.php index c7c478a..9625f8c 100644 --- a/test/Primitive/NumTest.php +++ b/test/Primitive/NumTest.php @@ -4,12 +4,13 @@ namespace test\Primitive; -use Eris\TestTrait; use Eris\Generator; +use Eris\TestTrait; use FunctionalPHP\FantasyLand\Helpful\SetoidLaws; +use PHPUnit\Framework\TestCase; use Widmogrod\Primitive\Num; -class NumTest extends \PHPUnit\Framework\TestCase +class NumTest extends TestCase { use TestTrait; diff --git a/test/Primitive/ProductTest.php b/test/Primitive/ProductTest.php index 7e0f8a0..0baba97 100644 --- a/test/Primitive/ProductTest.php +++ b/test/Primitive/ProductTest.php @@ -8,10 +8,12 @@ use Eris\TestTrait; use FunctionalPHP\FantasyLand\Helpful\MonoidLaws; use FunctionalPHP\FantasyLand\Helpful\SetoidLaws; +use PHPUnit\Framework\TestCase; use Widmogrod\Primitive\Product; use Widmogrod\Primitive\Stringg; +use Widmogrod\Primitive\TypeMismatchError; -class ProductTest extends \PHPUnit\Framework\TestCase +class ProductTest extends TestCase { use TestTrait; @@ -47,12 +49,10 @@ public function test_it_should_obay_monoid_laws() }); } - /** - * @expectedException \Widmogrod\Primitive\TypeMismatchError - * @expectedExceptionMessage Expected type is Widmogrod\Primitive\Product but given Widmogrod\Primitive\Stringg - */ public function test_it_should_reject_concat_on_different_type() { + $this->expectException(TypeMismatchError::class); + $this->expectExceptionMessage('Expected type is Widmogrod\Primitive\Product but given Widmogrod\Primitive\Stringg'); $this->forAll( Generator\int(), Generator\string() diff --git a/test/Primitive/StringgTest.php b/test/Primitive/StringgTest.php index 41a854e..a62e3e4 100644 --- a/test/Primitive/StringgTest.php +++ b/test/Primitive/StringgTest.php @@ -8,10 +8,12 @@ use Eris\TestTrait; use FunctionalPHP\FantasyLand\Helpful\MonoidLaws; use FunctionalPHP\FantasyLand\Helpful\SetoidLaws; +use PHPUnit\Framework\TestCase; use Widmogrod\Primitive\Product; use Widmogrod\Primitive\Stringg; +use Widmogrod\Primitive\TypeMismatchError; -class StringgTest extends \PHPUnit\Framework\TestCase +class StringgTest extends TestCase { use TestTrait; @@ -47,12 +49,10 @@ public function test_it_should_obey_monoid_laws() }); } - /** - * @expectedException \Widmogrod\Primitive\TypeMismatchError - * @expectedExceptionMessage Expected type is Widmogrod\Primitive\Stringg but given Widmogrod\Primitive\Product - */ public function test_it_should_reject_concat_on_different_type() { + $this->expectException(TypeMismatchError::class); + $this->expectExceptionMessage('Expected type is Widmogrod\Primitive\Stringg but given Widmogrod\Primitive\Product'); $this->forAll( Generator\string(), Generator\int() diff --git a/test/Primitive/SumTest.php b/test/Primitive/SumTest.php index 3d29b2e..d085871 100644 --- a/test/Primitive/SumTest.php +++ b/test/Primitive/SumTest.php @@ -4,14 +4,16 @@ namespace test\Primitive; -use Eris\TestTrait; use Eris\Generator; +use Eris\TestTrait; use FunctionalPHP\FantasyLand\Helpful\MonoidLaws; use FunctionalPHP\FantasyLand\Helpful\SetoidLaws; +use PHPUnit\Framework\TestCase; use Widmogrod\Primitive\Product; use Widmogrod\Primitive\Sum; +use Widmogrod\Primitive\TypeMismatchError; -class SumTest extends \PHPUnit\Framework\TestCase +class SumTest extends TestCase { use TestTrait; @@ -47,13 +49,10 @@ public function test_it_should_obay_monoid_laws() }); } - - /** - * @expectedException \Widmogrod\Primitive\TypeMismatchError - * @expectedExceptionMessage Expected type is Widmogrod\Primitive\Sum but given Widmogrod\Primitive\Product - */ public function test_it_should_reject_concat_on_different_type() { + $this->expectException(TypeMismatchError::class); + $this->expectExceptionMessage('Expected type is Widmogrod\Primitive\Sum but given Widmogrod\Primitive\Product'); $this->forAll( Generator\int(), Generator\string() diff --git a/test/Useful/MatchTest.php b/test/Useful/MatchTest.php index 269899c..3b27789 100644 --- a/test/Useful/MatchTest.php +++ b/test/Useful/MatchTest.php @@ -4,17 +4,19 @@ namespace test\Useful; +use Exception; +use PHPUnit\Framework\Attributes\DataProvider; +use PHPUnit\Framework\TestCase; +use stdClass; use Widmogrod\Useful\PatternMatcher; use Widmogrod\Useful\PatternNotMatchedError; use function Widmogrod\Useful\matchPatterns; use const Widmogrod\Functional\identity; use const Widmogrod\Useful\any; -class MatchTest extends \PHPUnit\Framework\TestCase +class MatchTest extends TestCase { - /** - * @dataProvider provideInvalidPatterns - */ + #[DataProvider('provideInvalidPatterns')] public function test_it_should_fail_on_not_matched_patterns( array $patterns, $value, @@ -26,36 +28,34 @@ public function test_it_should_fail_on_not_matched_patterns( matchPatterns($patterns, $value); } - public function provideInvalidPatterns() + public static function provideInvalidPatterns() { return [ 'Empty pattern list' => [ - '$patterns' => [], - '$value' => random_int(-1000, 1000), - '$expectedMessage' => 'Cannot match "integer" type. List of patterns is empty.', + [], + random_int(-1000, 1000), + 'Cannot match "integer" type. List of patterns is empty.', ], 'Value not in pattern list' => [ - '$patterns' => [ + [ self::class => identity, "RandomString" => identity, ], - '$value' => random_int(-1000, 1000), - '$expectedMessage' => 'Cannot match "integer" type. Defined patterns are: "test\Useful\MatchTest", "RandomString"', + random_int(-1000, 1000), + 'Cannot match "integer" type. Defined patterns are: "test\Useful\MatchTest", "RandomString"', ], 'Value not in tuple pattern list' => [ - '$patterns' => [ - [[self::class, \stdClass::class], identity], + [ + [[self::class, stdClass::class], identity], [["RandomString"], identity], ], - '$value' => [random_int(-1000, 1000)], - '$expectedMessage' => 'Cannot match "array" type. Defined patterns are: "0", "1"', + [random_int(-1000, 1000)], + 'Cannot match "array" type. Defined patterns are: "0", "1"', ], ]; } - /** - * @dataProvider providePatterns - */ + #[DataProvider('providePatterns')] public function test_it_should_match_given_value( array $patterns, $value, @@ -68,69 +68,69 @@ public function test_it_should_match_given_value( ); } - public function providePatterns() + public static function providePatterns() { - $std = new \stdClass(); - $e = new \Exception(); + $std = new stdClass(); + $e = new Exception(); $m = new MyPatternMatcher(100, 123); return [ 'single pattern' => [ - '$patterns' => [ - \stdClass::class => identity, + [ + stdClass::class => identity, ], - '$value' => $std, - '$expected' => $std, + $std, + $std, ], 'single pattern fallback to any' => [ - '$patterns' => [ - \stdClass::class => identity, + [ + stdClass::class => identity, any => identity, ], - '$value' => $e, - '$expected' => $e, + $e, + $e, ], 'many patterns' => [ - '$patterns' => [ - \Exception::class => identity, + [ + Exception::class => identity, self::class => identity, - \stdClass::class => identity, + stdClass::class => identity, ], - '$value' => $std, - '$expected' => $std, + $std, + $std, ], 'tuple patterns' => [ - '$patterns' => [ - [[\stdClass::class, \stdClass::class], function () { + [ + [[stdClass::class, stdClass::class], function () { return func_get_args(); }], ], - '$value' => [$std, $std], - '$expected' => [$std, $std], + [$std, $std], + [$std, $std], ], 'tuple fallback to any patterns' => [ - '$patterns' => [ - [[\stdClass::class, \stdClass::class], function () { + [ + [[stdClass::class, stdClass::class], function () { return func_get_args(); }], [[any, any], function () { return ['any', func_get_args()]; }], ], - '$value' => [$std, $m], - '$expected' => ['any', [$std, $m]], + [$std, $m], + ['any', [$std, $m]], ], 'value as a PatternMatcher patterns' => [ - '$patterns' => [ - \Exception::class => identity, + [ + Exception::class => identity, self::class => identity, - \stdClass::class => identity, + stdClass::class => identity, MyPatternMatcher::class => function ($a, $b) { return $a + $b; } ], - '$value' => new MyPatternMatcher(100, 123), - '$expected' => 223, + new MyPatternMatcher(100, 123), + 223, ], ]; }