diff --git a/.github/workflows/tag_meged_pull_request.yml b/.github/workflows/tag_meged_pull_request.yml new file mode 100644 index 0000000..5739c59 --- /dev/null +++ b/.github/workflows/tag_meged_pull_request.yml @@ -0,0 +1,61 @@ +name: Set Tag to Merged Pull Request + +on: + pull_request: + branches: + - main + types: + - closed + +jobs: + set-tag: + name: Get tags, Check and Set tag + runs-on: ubuntu-latest + permissions: + contents: write + + steps: + - name: Set up PHP + uses: shivammathur/setup-php@v2 + with: + php-version: 8.2 + coverage: xdebug + tools: composer:v2 + + - name: Checkout code + uses: actions/checkout@v3 + with: + fetch-depth: 0 + + - name: PHP Version Check + run: php -v + + - name: Validate Composer JSON + run: composer validate + + - name: Get Version From Comopser JSON + id: new-version + run: | + echo version=$(cat composer.json | grep version | head -1 | grep -Po '\d+\.\d+\.\d+') >> $GITHUB_OUTPUT + + - name: Show New Version + run: echo "version=${{ steps.new-version.outputs.version}}" + + - name: Show Tags + run: git tag + + - name: Check If The Version Is Not In The Tag List + run: | + for tag in `git tag` + do + if [ $tag = ${{ steps.new-version.outputs.version }} ]; then + echo "version ${{ steps.new-version.outputs.version }} already exists." + exit 1 + fi + done + echo "[OK.]" + + - name: Set tag + run: | + git tag ${{ steps.new-version.outputs.version }} + git push origin ${{ steps.new-version.outputs.version }} diff --git a/.github/workflows/test_pull_request.yml b/.github/workflows/test_pull_request.yml new file mode 100644 index 0000000..3aae850 --- /dev/null +++ b/.github/workflows/test_pull_request.yml @@ -0,0 +1,150 @@ +name: Test and Static Analysis (Pull Request) + +on: pull_request + +jobs: + check-version-in-composer-json: + name: Check Version + runs-on: ubuntu-latest + + steps: + - name: Set up PHP + uses: shivammathur/setup-php@v2 + with: + php-version: 8.2 + tools: composer:v2 + + - name: Checkout code + uses: actions/checkout@v3 + with: + fetch-depth: 0 + + - name: PHP Version Check + run: php -v + + - name: Validate Composer JSON + run: composer validate + + - name: Get Version From Comopser JSON + id: new-version + run: | + echo version=$(cat composer.json | grep version | head -1 | grep -Po '\d+\.\d+\.\d+') >> $GITHUB_OUTPUT + + - name: Show New Version + run: echo "version=${{ steps.new-version.outputs.version }}" + + - name: Show Tags + run: git tag + + - name: Check If The Version Is Not In The Tag List + run: | + for tag in `git tag` + do + if [ $tag = ${{ steps.new-version.outputs.version }} ]; then + echo "version ${{ steps.new-version.outputs.version }} already exists." + exit 1 + fi + done + echo "OK." + + test-and-static-analysis: + name: Test and Lint + runs-on: ubuntu-latest + strategy: + matrix: + php: ['8.1', '8.2', '8.3'] + + steps: + - name: Set up PHP + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php }} + coverage: xdebug + tools: composer:v2 + + - name: Set up Node + uses: actions/setup-node@v3 + with: + node-version: '14.x' + + - name: Checkout code + uses: actions/checkout@v3 + with: + fetch-depth: 0 + + - name: PHP Version Check + run: php -v + + - name: Validate Composer JSON + run: composer validate + + - name: Run Composer Install + id: composerinstall + run: composer install --no-interaction + + - name: PHP Lint + run: ./vendor/bin/parallel-lint src tests examples + + #- name: Neon Lint + # run: ./vendor/nette/neon/bin/neon-lint conf + + - name: PHP MD + run: | + ./vendor/bin/phpmd --version + ./vendor/bin/phpmd ./src/ ./examples/ ./tests/ text phpmd.xml + + - name: PHP Code Sniffer + run: | + ./vendor/bin/phpcs --version + ./vendor/bin/phpcs --ignore=vendor --standard=phpcs.xml -s -p . + + - name: PHPStan + run: | + ./vendor/bin/phpstan --version + ./vendor/bin/phpstan analyze -c phpstan.neon + + - name: Unit tests + run: | + mkdir -p build/logs + ./vendor/bin/phpunit --version + echo "Test suite All" + ./vendor/bin/phpunit ./tests/ + + code-coverage: + name: Code coverage + runs-on: ubuntu-latest + strategy: + matrix: + php: ['8.1'] + + steps: + - name: Set up PHP + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php }} + coverage: xdebug + tools: composer:v2 + + - name: Set up Node + uses: actions/setup-node@v3 + with: + node-version: '14.x' + + - name: Checkout code + uses: actions/checkout@v3 + with: + fetch-depth: 0 + + - name: Run Composer + run: composer install --no-interaction + + - name: Update PHPUnit for Code Coverage + run: composer require phpunit/phpunit:^9.6 phploc/phploc:* sebastian/version:* --with-all-dependencies + + - name: PHP Lint + run: ./vendor/bin/parallel-lint src tests examples + + - name: Unit tests + run: | + mkdir -p build/logs + ./vendor/bin/phpunit ./tests/ --coverage-clover build/logs/clover.xml diff --git a/.php-version b/.php-version new file mode 100644 index 0000000..b8eb026 --- /dev/null +++ b/.php-version @@ -0,0 +1 @@ +8.1 diff --git a/PHP_VERSIONS b/PHP_VERSIONS new file mode 100644 index 0000000..4215b26 --- /dev/null +++ b/PHP_VERSIONS @@ -0,0 +1,3 @@ +8.3 +8.2 +8.1 diff --git a/README.md b/README.md index 2e4897c..b8713c8 100644 --- a/README.md +++ b/README.md @@ -1,55 +1,72 @@ # PHP-Combination -A simple PHP library to make combinations from array elements. - -## Contents -- [Requirements](#requirements) -- [Installation](#installation) -- [Classes](#classes) - - [Combination](#combination) - - [CombinationGenerator](#combinationgenerator) - - [How to choose the class to use](#how-to-choose-the-class-to-use) -- [Methods](#methods) -- [Limit on the Number of Array Elements](#limit-on-the-number-of-array-elements) -- [Usage](#usage) - - [Using Combination](#using-combination) - - [Using Combination with Sorting](#using-combination-with-sorting) - - [Using CombinationGenerator](#using-combinationgenerator) -- [Example](#example) -- [LICENSE](#license) - -## Requirements - -- PHP 8.0.0 (CLI) or later +## 1. Features + +`PHP-Combination` is a simple PHP library to make combinations from array elements. + +`PHP-Combination` can: + +- create `all` combinations +- `sort` combinations +- create `pairs` +- create all combinations `of N` elements +- create all combinations `of A 2 B` elements + + +## 2. Contents +- [1. Features](#1-features) +- 2\. Contents +- [3. Requirements](#3-requirements) +- [4. Installation](#4-installation) +- [5. Classes](#5-classes) + - [5.1. Combination](#51-combination) + - [5.2. CombinationGenerator](#52-combinationgenerator) + - [5.3. How to choose the class to use](#53-how-to-choose-the-class-to-use) +- [6. Methods](#6-methods) +- [7. Limit on the Number of Array Elements](#7-limit-on-the-number-of-array-elements) +- [8. Usage](#8-usage) + - [8.1. Basic Usage](#81-basic-usage) + - [8.1.1. Combination](#811-combination) + - [8.1.2. CombinationGenerator](#812-combinationgenerator) + - [8.2. Using Combination](#82-using-combination) + - [8.3. Using Combination with Sorting](#83-using-combination-with-sorting) + - [8.4. Using CombinationGenerator](#84-using-combinationgenerator) + - [8.5. Using In PHPUnit](#85-using-in-phpunit) +- [9. Examples](#9-examples) +- [10. LICENSE](#10-license) + +## 3. Requirements + +- PHP 8.1 or later - Composer -## Installation +## 4. Installation ```bash composer require macocci7/php-combination ``` -## Classes +## 5. Classes There're 2 types of classes for the same methods. -### Combination +### 5.1. Combination ```php Macocci7\PhpCombination\Combination ``` -This class returns the result as type of array. +This class returns the result as type of `array`. -### CombinationGenerator +### 5.2. CombinationGenerator ```php Macocci7\PhpCombination\CombinationGenerator ``` -This class returns the result as type of Generator object. +This class returns the result as type of `Generator` object. -### How to choose the class to use +### 5.3. How to choose the class to use There might be 3 factors. @@ -88,13 +105,15 @@ There might be 3 factors. In some cases, `CombinationGenerator` takes several times longer than `Combination`. -But, `Combination` mostly might exceed memory limit when using param array with more than 22 elements. +But, `Combination` mostly might exceed memory limit (128MB) when using param array with more than 22 elements. Use `CombinationGenerator` then. It will never exceeds the memory limit, and certanily complete the task. -## Methods +## 6. Methods + +### 6.1. Macocci7\PhpCombination\Combination - `all()`: returns all combinations of the param - `pairs()`: returns all pairs of the param @@ -104,7 +123,14 @@ It will never exceeds the memory limit, and certanily complete the task. `fromArrays()` is only implemented in `Combination` class. -## Limit on the Number of Array Elements +### 6.2. Macocci7\PhpCombination\CombinationGenenrator + +- `all()`: returns all combinations of the param +- `pairs()`: returns all pairs of the param +- `ofN()`: returns all combinations of N elements of the param +- `ofA2B()`: returns all combinations of A to B elements of the param + +## 7. Limit on the Number of Array Elements The number of array elements of the param: - 32bit-system: 30 elements @@ -118,9 +144,89 @@ The max index number of array in PHP equals to `PHP_INT_MAX`. - 32bit-system: 2147483647 === 2 ** 31 - 1 - 64bit-system: 9223372036854775807 === 2 ** 63 - 1 -## Usage +## 8. Usage + +- [8.1. Basic Usage](#81-basic-usage) + - [8.1.1. Combination](#811-combination) + - [8.1.2. CombinationGenerator](#812-combinationgenerator) +- [8.2. Using Combination](#82-using-combination) +- [8.3. Using Combination with Sorting](#83-using-combination-with-sorting) +- [8.4. Using CombinationGenerator](#84-using-combinationgenerator) +- [8.5. Using In PHPUnit](#85-using-in-phpunit) + +### 8.1. Basic Usage + +#### 8.1.1 Combination + +- PHP: + + ```php + all($items) as $index => $item) { + echo sprintf( + "%d: (%s)\n", + $index, + implode(', ', $item) + ); + } + ``` + +- Result: + + ``` + 0: (A, B, C) + 1: (A, B) + 2: (A, C) + 3: (A) + 4: (B, C) + 5: (B) + 6: (C) + ``` + +#### 8.1.2. CombinationGenerator + +- PHP: + + ```php + all($items) as $index => $item) { + echo sprintf( + "%d: (%s)\n", + $index, + implode(', ', $item) + ); + } + ``` + +- Result: -### Using Combination + ``` + 0: (A, B, C) + 1: (A, B) + 2: (A, C) + 3: (A) + 4: (B, C) + 5: (B) + 6: (C) + ``` + +### 8.2. Using Combination - PHP: @@ -302,7 +408,7 @@ The max index number of array in PHP equals to `PHP_INT_MAX`. 24: (A2, B3, C4) ``` -### Using Combination with Sorting +### 8.3. Using Combination with Sorting - PHP: @@ -487,7 +593,7 @@ The max index number of array in PHP equals to `PHP_INT_MAX`. 24: (A2, B3, C4) ``` -### Using CombinationGenerator +### 8.4. Using CombinationGenerator - PHP: @@ -626,13 +732,191 @@ The max index number of array in PHP equals to `PHP_INT_MAX`. ``` -## Example +### 8.5. Using In PHPUnit + +For Example, `fromArray()` method is useful for testing with data provider. + +Here's an example of testing the class for ordering products, + +with patterns of `size`, `color` and `amount`. + +- Install MONOLOG: Just for this example + + ```bash + composer require monolog/monolog + ``` + +- PHP: Class to be tested + + ```php + log = new Logger('UseInPhpUnit'); + $this->log->pushHandler( + new StreamHandler(__DIR__ . '/UseInPhpUnit.log', Level::Debug) + ); + } + + public function order( + int $productId, + string $size, + string $color, + int $amount + ) { + $this->log->info('Adding a new order', [ + 'productId' => $productId, + 'size' => $size, + 'color' => $color, + 'amount' => $amount, + ]); + return true; + } + } + ``` + +- PHP: Test Class + + ```php + fromArrays([$products, $sizes, $colors, $amount]) as $e + ) { + $data[implode(', ', $e)] = $e; + } + return $data; + } + + /** + * @dataProvider provide_order_can_order_correctly + */ + public function test_order_can_order_correctly( + int $productId, + string $size, + string $color, + int $amount + ): void { + $u = new UseInPhpUnit(); + $this->assertTrue($u->order( + $productId, + $size, + $color, + $amount + )); + } + } + ``` + +- Result: STDOUT + + ```bash + examples$ ../vendor/bin/phpunit ./UseInPhpUnitTest.php --color auto --testdox + PHPUnit 9.6.17 by Sebastian Bergmann and contributors. + + Use In Php Unit (Macocci7\PhpCombination\UseInPhpUnit) + ✔ Order can order correctly with 1101,·S,·White,·1 + ✔ Order can order correctly with 1101,·S,·White,·2 + ✔ Order can order correctly with 1101,·S,·Black,·1 + ✔ Order can order correctly with 1101,·S,·Black,·2 + ✔ Order can order correctly with 1101,·M,·White,·1 + ✔ Order can order correctly with 1101,·M,·White,·2 + ✔ Order can order correctly with 1101,·M,·Black,·1 + ✔ Order can order correctly with 1101,·M,·Black,·2 + ✔ Order can order correctly with 1101,·L,·White,·1 + ✔ Order can order correctly with 1101,·L,·White,·2 + ✔ Order can order correctly with 1101,·L,·Black,·1 + ✔ Order can order correctly with 1101,·L,·Black,·2 + ✔ Order can order correctly with 1102,·S,·White,·1 + ✔ Order can order correctly with 1102,·S,·White,·2 + ✔ Order can order correctly with 1102,·S,·Black,·1 + ✔ Order can order correctly with 1102,·S,·Black,·2 + ✔ Order can order correctly with 1102,·M,·White,·1 + ✔ Order can order correctly with 1102,·M,·White,·2 + ✔ Order can order correctly with 1102,·M,·Black,·1 + ✔ Order can order correctly with 1102,·M,·Black,·2 + ✔ Order can order correctly with 1102,·L,·White,·1 + ✔ Order can order correctly with 1102,·L,·White,·2 + ✔ Order can order correctly with 1102,·L,·Black,·1 + ✔ Order can order correctly with 1102,·L,·Black,·2 + + Time: 00:00.040, Memory: 6.00 MB + + OK (24 tests, 24 assertions) + examples$ + ``` + +- Result: LOG + + ```log + [2024-03-17T04:52:17.411553+00:00] UseInPhpUnit.INFO: Adding a new order {"productId":1101,"size":"S","color":"White","amount":1} [] + [2024-03-17T04:52:17.416904+00:00] UseInPhpUnit.INFO: Adding a new order {"productId":1101,"size":"S","color":"White","amount":2} [] + [2024-03-17T04:52:17.417719+00:00] UseInPhpUnit.INFO: Adding a new order {"productId":1101,"size":"S","color":"Black","amount":1} [] + [2024-03-17T04:52:17.418655+00:00] UseInPhpUnit.INFO: Adding a new order {"productId":1101,"size":"S","color":"Black","amount":2} [] + [2024-03-17T04:52:17.419389+00:00] UseInPhpUnit.INFO: Adding a new order {"productId":1101,"size":"M","color":"White","amount":1} [] + [2024-03-17T04:52:17.420132+00:00] UseInPhpUnit.INFO: Adding a new order {"productId":1101,"size":"M","color":"White","amount":2} [] + [2024-03-17T04:52:17.421430+00:00] UseInPhpUnit.INFO: Adding a new order {"productId":1101,"size":"M","color":"Black","amount":1} [] + [2024-03-17T04:52:17.422601+00:00] UseInPhpUnit.INFO: Adding a new order {"productId":1101,"size":"M","color":"Black","amount":2} [] + [2024-03-17T04:52:17.423908+00:00] UseInPhpUnit.INFO: Adding a new order {"productId":1101,"size":"L","color":"White","amount":1} [] + [2024-03-17T04:52:17.424508+00:00] UseInPhpUnit.INFO: Adding a new order {"productId":1101,"size":"L","color":"White","amount":2} [] + [2024-03-17T04:52:17.425057+00:00] UseInPhpUnit.INFO: Adding a new order {"productId":1101,"size":"L","color":"Black","amount":1} [] + [2024-03-17T04:52:17.425742+00:00] UseInPhpUnit.INFO: Adding a new order {"productId":1101,"size":"L","color":"Black","amount":2} [] + [2024-03-17T04:52:17.426767+00:00] UseInPhpUnit.INFO: Adding a new order {"productId":1102,"size":"S","color":"White","amount":1} [] + [2024-03-17T04:52:17.427574+00:00] UseInPhpUnit.INFO: Adding a new order {"productId":1102,"size":"S","color":"White","amount":2} [] + [2024-03-17T04:52:17.428547+00:00] UseInPhpUnit.INFO: Adding a new order {"productId":1102,"size":"S","color":"Black","amount":1} [] + [2024-03-17T04:52:17.429686+00:00] UseInPhpUnit.INFO: Adding a new order {"productId":1102,"size":"S","color":"Black","amount":2} [] + [2024-03-17T04:52:17.430336+00:00] UseInPhpUnit.INFO: Adding a new order {"productId":1102,"size":"M","color":"White","amount":1} [] + [2024-03-17T04:52:17.430916+00:00] UseInPhpUnit.INFO: Adding a new order {"productId":1102,"size":"M","color":"White","amount":2} [] + [2024-03-17T04:52:17.431495+00:00] UseInPhpUnit.INFO: Adding a new order {"productId":1102,"size":"M","color":"Black","amount":1} [] + [2024-03-17T04:52:17.431949+00:00] UseInPhpUnit.INFO: Adding a new order {"productId":1102,"size":"M","color":"Black","amount":2} [] + [2024-03-17T04:52:17.432371+00:00] UseInPhpUnit.INFO: Adding a new order {"productId":1102,"size":"L","color":"White","amount":1} [] + [2024-03-17T04:52:17.432744+00:00] UseInPhpUnit.INFO: Adding a new order {"productId":1102,"size":"L","color":"White","amount":2} [] + [2024-03-17T04:52:17.433138+00:00] UseInPhpUnit.INFO: Adding a new order {"productId":1102,"size":"L","color":"Black","amount":1} [] + [2024-03-17T04:52:17.433508+00:00] UseInPhpUnit.INFO: Adding a new order {"productId":1102,"size":"L","color":"Black","amount":2} [] + ``` + +## 9. Examples -- [UseCombination.php](example/UseCombination.php) >> results in [UseCombination.txt](example/UseCombination.txt) -- [UseCombinationSort.php](example/UseCombinationSort.php) >> results in [UseCombinationSort.txt](example/UseCombinationSort.txt) -- [UseCombinationGenerator.php](example/UseCombinationGenerator.php) >> results in [UseCombinationGenerator.txt](example/UseCombinationGenerator.txt) +- [BasicUsage.php](examples/BasiUsage.php) >> results in [BasicUsage.txt](examples/BasicUsage.txt) +- [BasicUsageGenerator.php](examples/BasicUsageGenerator.php) >> results in [BasicUsageGenerator.txt](examples/BasicUsageGenerator.txt) +- [UseCombination.php](examples/UseCombination.php) >> results in [UseCombination.txt](examples/UseCombination.txt) +- [UseCombinationSort.php](examples/UseCombinationSort.php) >> results in [UseCombinationSort.txt](examples/UseCombinationSort.txt) +- [UseCombinationGenerator.php](examples/UseCombinationGenerator.php) >> results in [UseCombinationGenerator.txt](examples/UseCombinationGenerator.txt) +- [UseInPhpUnit.class.php](examples/UseInPhpUnit.class.php) & [UseInPhpUnitTest.php](examples/UseInPhpUnitTest.php) >> results in [UseInPhpUnit.log](examples/UseInPhpUnit.log) -## LICENSE +## 10. LICENSE [MIT](LICENSE) @@ -640,6 +924,6 @@ The max index number of array in PHP equals to `PHP_INT_MAX`. *Document Created: 2023/11/11* -*Document Updated: 2023/12/18* +*Document Updated: 2024/03/17* -Copyright 2023 macocci7 +Copyright 2023 - 2024 macocci7 diff --git a/bin/CheckVersion.sh b/bin/CheckVersion.sh new file mode 100644 index 0000000..48f03e1 --- /dev/null +++ b/bin/CheckVersion.sh @@ -0,0 +1,35 @@ +#!/usr/bin/bash + +# Script to check +# if the version in composer.json +# is not in git tags + +if [ ! -r composer.json ]; then + echo "composer.json not found." + echo "operation aborted." + exit 1 +fi + +VERSION=$(cat composer.json | grep version | head -1 | grep -Po '\d+\.\d+\.\d+') +printf 'version in composer.json: \033[1;33m%s\033[m\n' $VERSION + + +show_latest_tags() { + echo "The latest $1 tags are:" + for tag in `git tag | sort | tail -$1` + do + printf '\033[93m%s\033[m\n' $tag + done +} + +for tag in `git tag` +do + if [ $tag = $VERSION ]; then + printf '\033[41m Error! version %s already exists in git tags. \033[m\n' $VERSION + show_latest_tags 3 + exit 1 + fi +done +printf '\033[1;102m%s\033[m\n' " OK! versoin $VERSION is not in git tags. " +show_latest_tags 3 +printf '\033[93m%s\033[m\n' "Don't forget to run \`composer update\` before commit." diff --git a/bin/TestAndLint.sh b/bin/TestAndLint.sh new file mode 100644 index 0000000..c1bc825 --- /dev/null +++ b/bin/TestAndLint.sh @@ -0,0 +1,79 @@ +#!/usr/bin/bash + +# Script to Test and Lint +# - for the repository: macocci7/php-combination +# requirement: +# - phpenv/phpenv +# - PHP versions defined in ../PHP_VERSIONS installed + +CMD=phpenv +$CMD -v &> /dev/null +if [ $? -ne 0 ]; then + echo "command [${CMD}] not found!" + exit 1 +fi +echo "-----------------------------------------------------------" +echo "[composer validate]" +composer validate +if [ $? -ne 0 ]; then + echo "Operation aborted." + exit 1 +fi + +test_and_lint() { + echo "===========================================================" + echo "[PHP $1][phpenv local $1]" + phpenv local $1 + if [ $? -ne 0 ]; then + echo "Failed to switch version to $i. skipped." + return 1 + fi + echo "-----------------------------------------------------------" + echo "[PHP $1][php -v]" + php -v + echo "-----------------------------------------------------------" + echo "[PHP $1][parallel-lint]" + ./vendor/bin/parallel-lint src tests examples + #echo "-----------------------------------------------------------" + #echo "[PHP $1][neon-lint]" + #./vendor/nette/neon/bin/neon-lint conf + echo "-----------------------------------------------------------" + echo "[PHP $1][phpcs]" + ./vendor/bin/phpcs --ignore=vendor \ + --standard=phpcs.xml \ + -p \ + -s \ + . + echo "-----------------------------------------------------------" + echo "[PHP $1][phpmd]" + ./vendor/bin/phpmd \ + ./src/ ./examples/ ./tests/ text \ + phpmd.xml + echo "-----------------------------------------------------------" + echo "[PHP $1][phpstan]" + ./vendor/bin/phpstan analyze -c phpstan.neon + echo "-----------------------------------------------------------" + echo "[PHP $1][phpunit]" + ./vendor/bin/phpunit ./tests/ \ + --color auto + echo "-----------------------------------------------------------" +} + +echo "[[TesAndLint.sh]]" + +SUPPORTED_PHP_VERSIONS=PHP_VERSIONS +if [ ! -f $SUPPORTED_PHP_VERSIONS ]; then + echo "file [$SUPPORTED_PHP_VERSIONS] not found." + echo "operation aborted." + exit 1 +fi +if [ ! -r $SUPPORTED_PHP_VERSIONS ]; then + echo "cannot read file[$SUPPORTED_PHP_VERSIONS]." + echo "operation aborted." + exit 1 +fi +STR_CMD='' +while read version ; do + STR_CMD="$STR_CMD test_and_lint $version;" +done < $SUPPORTED_PHP_VERSIONS +eval $STR_CMD diff --git a/composer.json b/composer.json index 82fd4c4..86aecb7 100644 --- a/composer.json +++ b/composer.json @@ -1,6 +1,6 @@ { "name": "macocci7/php-combination", - "version": "1.0.2", + "version": "1.0.3", "description": "a simple PHP library to make combinations", "type": "library", "license": "MIT", @@ -17,6 +17,14 @@ ], "minimum-stability": "stable", "require-dev": { - "squizlabs/php_codesniffer": "^3.7" + "squizlabs/php_codesniffer": "^3.7", + "phpunit/phpunit": "^9.6", + "phpmd/phpmd": "^2.15", + "phpstan/phpstan": "^1.10", + "phploc/phploc": "^7.0", + "php-parallel-lint/php-parallel-lint": "^1.3" + }, + "require": { + "monolog/monolog": "^3.5" } } diff --git a/composer.lock b/composer.lock index 198129e..284e1d4 100644 --- a/composer.lock +++ b/composer.lock @@ -4,40 +4,463 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "5186ade051d119ae4ef866710052cb05", - "packages": [], + "content-hash": "ecffd7b5cadc223f31fb6d83a484c409", + "packages": [ + { + "name": "monolog/monolog", + "version": "3.5.0", + "source": { + "type": "git", + "url": "https://github.com/Seldaek/monolog.git", + "reference": "c915e2634718dbc8a4a15c61b0e62e7a44e14448" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Seldaek/monolog/zipball/c915e2634718dbc8a4a15c61b0e62e7a44e14448", + "reference": "c915e2634718dbc8a4a15c61b0e62e7a44e14448", + "shasum": "" + }, + "require": { + "php": ">=8.1", + "psr/log": "^2.0 || ^3.0" + }, + "provide": { + "psr/log-implementation": "3.0.0" + }, + "require-dev": { + "aws/aws-sdk-php": "^3.0", + "doctrine/couchdb": "~1.0@dev", + "elasticsearch/elasticsearch": "^7 || ^8", + "ext-json": "*", + "graylog2/gelf-php": "^1.4.2 || ^2.0", + "guzzlehttp/guzzle": "^7.4.5", + "guzzlehttp/psr7": "^2.2", + "mongodb/mongodb": "^1.8", + "php-amqplib/php-amqplib": "~2.4 || ^3", + "phpstan/phpstan": "^1.9", + "phpstan/phpstan-deprecation-rules": "^1.0", + "phpstan/phpstan-strict-rules": "^1.4", + "phpunit/phpunit": "^10.1", + "predis/predis": "^1.1 || ^2", + "ruflin/elastica": "^7", + "symfony/mailer": "^5.4 || ^6", + "symfony/mime": "^5.4 || ^6" + }, + "suggest": { + "aws/aws-sdk-php": "Allow sending log messages to AWS services like DynamoDB", + "doctrine/couchdb": "Allow sending log messages to a CouchDB server", + "elasticsearch/elasticsearch": "Allow sending log messages to an Elasticsearch server via official client", + "ext-amqp": "Allow sending log messages to an AMQP server (1.0+ required)", + "ext-curl": "Required to send log messages using the IFTTTHandler, the LogglyHandler, the SendGridHandler, the SlackWebhookHandler or the TelegramBotHandler", + "ext-mbstring": "Allow to work properly with unicode symbols", + "ext-mongodb": "Allow sending log messages to a MongoDB server (via driver)", + "ext-openssl": "Required to send log messages using SSL", + "ext-sockets": "Allow sending log messages to a Syslog server (via UDP driver)", + "graylog2/gelf-php": "Allow sending log messages to a GrayLog2 server", + "mongodb/mongodb": "Allow sending log messages to a MongoDB server (via library)", + "php-amqplib/php-amqplib": "Allow sending log messages to an AMQP server using php-amqplib", + "rollbar/rollbar": "Allow sending log messages to Rollbar", + "ruflin/elastica": "Allow sending log messages to an Elastic Search server" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "3.x-dev" + } + }, + "autoload": { + "psr-4": { + "Monolog\\": "src/Monolog" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jordi Boggiano", + "email": "j.boggiano@seld.be", + "homepage": "https://seld.be" + } + ], + "description": "Sends your logs to files, sockets, inboxes, databases and various web services", + "homepage": "https://github.com/Seldaek/monolog", + "keywords": [ + "log", + "logging", + "psr-3" + ], + "support": { + "issues": "https://github.com/Seldaek/monolog/issues", + "source": "https://github.com/Seldaek/monolog/tree/3.5.0" + }, + "funding": [ + { + "url": "https://github.com/Seldaek", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/monolog/monolog", + "type": "tidelift" + } + ], + "time": "2023-10-27T15:32:31+00:00" + }, + { + "name": "psr/log", + "version": "3.0.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/log.git", + "reference": "fe5ea303b0887d5caefd3d431c3e61ad47037001" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/log/zipball/fe5ea303b0887d5caefd3d431c3e61ad47037001", + "reference": "fe5ea303b0887d5caefd3d431c3e61ad47037001", + "shasum": "" + }, + "require": { + "php": ">=8.0.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Log\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" + } + ], + "description": "Common interface for logging libraries", + "homepage": "https://github.com/php-fig/log", + "keywords": [ + "log", + "psr", + "psr-3" + ], + "support": { + "source": "https://github.com/php-fig/log/tree/3.0.0" + }, + "time": "2021-07-14T16:46:02+00:00" + } + ], "packages-dev": [ { - "name": "squizlabs/php_codesniffer", - "version": "3.7.2", + "name": "composer/pcre", + "version": "3.1.2", "source": { "type": "git", - "url": "https://github.com/squizlabs/PHP_CodeSniffer.git", - "reference": "ed8e00df0a83aa96acf703f8c2979ff33341f879" + "url": "https://github.com/composer/pcre.git", + "reference": "4775f35b2d70865807c89d32c8e7385b86eb0ace" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/ed8e00df0a83aa96acf703f8c2979ff33341f879", - "reference": "ed8e00df0a83aa96acf703f8c2979ff33341f879", + "url": "https://api.github.com/repos/composer/pcre/zipball/4775f35b2d70865807c89d32c8e7385b86eb0ace", + "reference": "4775f35b2d70865807c89d32c8e7385b86eb0ace", "shasum": "" }, "require": { - "ext-simplexml": "*", + "php": "^7.4 || ^8.0" + }, + "require-dev": { + "phpstan/phpstan": "^1.3", + "phpstan/phpstan-strict-rules": "^1.1", + "symfony/phpunit-bridge": "^5" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "3.x-dev" + } + }, + "autoload": { + "psr-4": { + "Composer\\Pcre\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jordi Boggiano", + "email": "j.boggiano@seld.be", + "homepage": "http://seld.be" + } + ], + "description": "PCRE wrapping library that offers type-safe preg_* replacements.", + "keywords": [ + "PCRE", + "preg", + "regex", + "regular expression" + ], + "support": { + "issues": "https://github.com/composer/pcre/issues", + "source": "https://github.com/composer/pcre/tree/3.1.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": "2024-03-07T15:38:35+00:00" + }, + { + "name": "composer/xdebug-handler", + "version": "3.0.3", + "source": { + "type": "git", + "url": "https://github.com/composer/xdebug-handler.git", + "reference": "ced299686f41dce890debac69273b47ffe98a40c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/composer/xdebug-handler/zipball/ced299686f41dce890debac69273b47ffe98a40c", + "reference": "ced299686f41dce890debac69273b47ffe98a40c", + "shasum": "" + }, + "require": { + "composer/pcre": "^1 || ^2 || ^3", + "php": "^7.2.5 || ^8.0", + "psr/log": "^1 || ^2 || ^3" + }, + "require-dev": { + "phpstan/phpstan": "^1.0", + "phpstan/phpstan-strict-rules": "^1.1", + "symfony/phpunit-bridge": "^6.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Composer\\XdebugHandler\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "John Stevenson", + "email": "john-stevenson@blueyonder.co.uk" + } + ], + "description": "Restarts a process without Xdebug.", + "keywords": [ + "Xdebug", + "performance" + ], + "support": { + "irc": "irc://irc.freenode.org/composer", + "issues": "https://github.com/composer/xdebug-handler/issues", + "source": "https://github.com/composer/xdebug-handler/tree/3.0.3" + }, + "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": "2022-02-25T21:32:43+00:00" + }, + { + "name": "doctrine/instantiator", + "version": "2.0.0", + "source": { + "type": "git", + "url": "https://github.com/doctrine/instantiator.git", + "reference": "c6222283fa3f4ac679f8b9ced9a4e23f163e80d0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/instantiator/zipball/c6222283fa3f4ac679f8b9ced9a4e23f163e80d0", + "reference": "c6222283fa3f4ac679f8b9ced9a4e23f163e80d0", + "shasum": "" + }, + "require": { + "php": "^8.1" + }, + "require-dev": { + "doctrine/coding-standard": "^11", + "ext-pdo": "*", + "ext-phar": "*", + "phpbench/phpbench": "^1.2", + "phpstan/phpstan": "^1.9.4", + "phpstan/phpstan-phpunit": "^1.3", + "phpunit/phpunit": "^9.5.27", + "vimeo/psalm": "^5.4" + }, + "type": "library", + "autoload": { + "psr-4": { + "Doctrine\\Instantiator\\": "src/Doctrine/Instantiator/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Marco Pivetta", + "email": "ocramius@gmail.com", + "homepage": "https://ocramius.github.io/" + } + ], + "description": "A small, lightweight utility to instantiate objects in PHP without invoking their constructors", + "homepage": "https://www.doctrine-project.org/projects/instantiator.html", + "keywords": [ + "constructor", + "instantiate" + ], + "support": { + "issues": "https://github.com/doctrine/instantiator/issues", + "source": "https://github.com/doctrine/instantiator/tree/2.0.0" + }, + "funding": [ + { + "url": "https://www.doctrine-project.org/sponsorship.html", + "type": "custom" + }, + { + "url": "https://www.patreon.com/phpdoctrine", + "type": "patreon" + }, + { + "url": "https://tidelift.com/funding/github/packagist/doctrine%2Finstantiator", + "type": "tidelift" + } + ], + "time": "2022-12-30T00:23:10+00:00" + }, + { + "name": "myclabs/deep-copy", + "version": "1.11.1", + "source": { + "type": "git", + "url": "https://github.com/myclabs/DeepCopy.git", + "reference": "7284c22080590fb39f2ffa3e9057f10a4ddd0e0c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/7284c22080590fb39f2ffa3e9057f10a4ddd0e0c", + "reference": "7284c22080590fb39f2ffa3e9057f10a4ddd0e0c", + "shasum": "" + }, + "require": { + "php": "^7.1 || ^8.0" + }, + "conflict": { + "doctrine/collections": "<1.6.8", + "doctrine/common": "<2.13.3 || >=3,<3.2.2" + }, + "require-dev": { + "doctrine/collections": "^1.6.8", + "doctrine/common": "^2.13.3 || ^3.2.2", + "phpunit/phpunit": "^7.5.20 || ^8.5.23 || ^9.5.13" + }, + "type": "library", + "autoload": { + "files": [ + "src/DeepCopy/deep_copy.php" + ], + "psr-4": { + "DeepCopy\\": "src/DeepCopy/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "Create deep copies (clones) of your objects", + "keywords": [ + "clone", + "copy", + "duplicate", + "object", + "object graph" + ], + "support": { + "issues": "https://github.com/myclabs/DeepCopy/issues", + "source": "https://github.com/myclabs/DeepCopy/tree/1.11.1" + }, + "funding": [ + { + "url": "https://tidelift.com/funding/github/packagist/myclabs/deep-copy", + "type": "tidelift" + } + ], + "time": "2023-03-08T13:26:56+00:00" + }, + { + "name": "nikic/php-parser", + "version": "v5.0.2", + "source": { + "type": "git", + "url": "https://github.com/nikic/PHP-Parser.git", + "reference": "139676794dc1e9231bf7bcd123cfc0c99182cb13" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/139676794dc1e9231bf7bcd123cfc0c99182cb13", + "reference": "139676794dc1e9231bf7bcd123cfc0c99182cb13", + "shasum": "" + }, + "require": { + "ext-ctype": "*", + "ext-json": "*", "ext-tokenizer": "*", - "ext-xmlwriter": "*", - "php": ">=5.4.0" + "php": ">=7.4" }, "require-dev": { - "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0" + "ircmaxell/php-yacc": "^0.0.7", + "phpunit/phpunit": "^7.0 || ^8.0 || ^9.0" }, "bin": [ - "bin/phpcs", - "bin/phpcbf" + "bin/php-parse" ], "type": "library", "extra": { "branch-alias": { - "dev-master": "3.x-dev" + "dev-master": "5.0-dev" + } + }, + "autoload": { + "psr-4": { + "PhpParser\\": "lib/PhpParser" } }, "notification-url": "https://packagist.org/downloads/", @@ -46,23 +469,2633 @@ ], "authors": [ { - "name": "Greg Sherwood", - "role": "lead" + "name": "Nikita Popov" } ], - "description": "PHP_CodeSniffer tokenizes PHP, JavaScript and CSS files and detects violations of a defined set of coding standards.", - "homepage": "https://github.com/squizlabs/PHP_CodeSniffer", + "description": "A PHP parser written in PHP", "keywords": [ - "phpcs", - "standards", - "static analysis" + "parser", + "php" + ], + "support": { + "issues": "https://github.com/nikic/PHP-Parser/issues", + "source": "https://github.com/nikic/PHP-Parser/tree/v5.0.2" + }, + "time": "2024-03-05T20:51:40+00:00" + }, + { + "name": "pdepend/pdepend", + "version": "2.16.2", + "source": { + "type": "git", + "url": "https://github.com/pdepend/pdepend.git", + "reference": "f942b208dc2a0868454d01b29f0c75bbcfc6ed58" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/pdepend/pdepend/zipball/f942b208dc2a0868454d01b29f0c75bbcfc6ed58", + "reference": "f942b208dc2a0868454d01b29f0c75bbcfc6ed58", + "shasum": "" + }, + "require": { + "php": ">=5.3.7", + "symfony/config": "^2.3.0|^3|^4|^5|^6.0|^7.0", + "symfony/dependency-injection": "^2.3.0|^3|^4|^5|^6.0|^7.0", + "symfony/filesystem": "^2.3.0|^3|^4|^5|^6.0|^7.0", + "symfony/polyfill-mbstring": "^1.19" + }, + "require-dev": { + "easy-doc/easy-doc": "0.0.0|^1.2.3", + "gregwar/rst": "^1.0", + "squizlabs/php_codesniffer": "^2.0.0" + }, + "bin": [ + "src/bin/pdepend" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.x-dev" + } + }, + "autoload": { + "psr-4": { + "PDepend\\": "src/main/php/PDepend" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "description": "Official version of pdepend to be handled with Composer", + "keywords": [ + "PHP Depend", + "PHP_Depend", + "dev", + "pdepend" ], "support": { - "issues": "https://github.com/squizlabs/PHP_CodeSniffer/issues", - "source": "https://github.com/squizlabs/PHP_CodeSniffer", - "wiki": "https://github.com/squizlabs/PHP_CodeSniffer/wiki" + "issues": "https://github.com/pdepend/pdepend/issues", + "source": "https://github.com/pdepend/pdepend/tree/2.16.2" + }, + "funding": [ + { + "url": "https://tidelift.com/funding/github/packagist/pdepend/pdepend", + "type": "tidelift" + } + ], + "time": "2023-12-17T18:09:59+00:00" + }, + { + "name": "phar-io/manifest", + "version": "2.0.4", + "source": { + "type": "git", + "url": "https://github.com/phar-io/manifest.git", + "reference": "54750ef60c58e43759730615a392c31c80e23176" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phar-io/manifest/zipball/54750ef60c58e43759730615a392c31c80e23176", + "reference": "54750ef60c58e43759730615a392c31c80e23176", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-libxml": "*", + "ext-phar": "*", + "ext-xmlwriter": "*", + "phar-io/version": "^3.0.1", + "php": "^7.2 || ^8.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] }, - "time": "2023-02-22T23:07:41+00:00" + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Arne Blankerts", + "email": "arne@blankerts.de", + "role": "Developer" + }, + { + "name": "Sebastian Heuer", + "email": "sebastian@phpeople.de", + "role": "Developer" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "Developer" + } + ], + "description": "Component for reading phar.io manifest information from a PHP Archive (PHAR)", + "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": "3.2.1", + "source": { + "type": "git", + "url": "https://github.com/phar-io/version.git", + "reference": "4f7fd7836c6f332bb2933569e566a0d6c4cbed74" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phar-io/version/zipball/4f7fd7836c6f332bb2933569e566a0d6c4cbed74", + "reference": "4f7fd7836c6f332bb2933569e566a0d6c4cbed74", + "shasum": "" + }, + "require": { + "php": "^7.2 || ^8.0" + }, + "type": "library", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Arne Blankerts", + "email": "arne@blankerts.de", + "role": "Developer" + }, + { + "name": "Sebastian Heuer", + "email": "sebastian@phpeople.de", + "role": "Developer" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "Developer" + } + ], + "description": "Library for handling version information and constraints", + "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-parallel-lint/php-parallel-lint", + "version": "v1.3.2", + "source": { + "type": "git", + "url": "https://github.com/php-parallel-lint/PHP-Parallel-Lint.git", + "reference": "6483c9832e71973ed29cf71bd6b3f4fde438a9de" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-parallel-lint/PHP-Parallel-Lint/zipball/6483c9832e71973ed29cf71bd6b3f4fde438a9de", + "reference": "6483c9832e71973ed29cf71bd6b3f4fde438a9de", + "shasum": "" + }, + "require": { + "ext-json": "*", + "php": ">=5.3.0" + }, + "replace": { + "grogy/php-parallel-lint": "*", + "jakub-onderka/php-parallel-lint": "*" + }, + "require-dev": { + "nette/tester": "^1.3 || ^2.0", + "php-parallel-lint/php-console-highlighter": "0.* || ^1.0", + "squizlabs/php_codesniffer": "^3.6" + }, + "suggest": { + "php-parallel-lint/php-console-highlighter": "Highlight syntax in code snippet" + }, + "bin": [ + "parallel-lint" + ], + "type": "library", + "autoload": { + "classmap": [ + "./src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-2-Clause" + ], + "authors": [ + { + "name": "Jakub Onderka", + "email": "ahoj@jakubonderka.cz" + } + ], + "description": "This tool check syntax of PHP files about 20x faster than serial check.", + "homepage": "https://github.com/php-parallel-lint/PHP-Parallel-Lint", + "support": { + "issues": "https://github.com/php-parallel-lint/PHP-Parallel-Lint/issues", + "source": "https://github.com/php-parallel-lint/PHP-Parallel-Lint/tree/v1.3.2" + }, + "time": "2022-02-21T12:50:22+00:00" + }, + { + "name": "phploc/phploc", + "version": "7.0.2", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/phploc.git", + "reference": "af0d5fc84f3f7725513ba59cdcbe670ac2a4532a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/phploc/zipball/af0d5fc84f3f7725513ba59cdcbe670ac2a4532a", + "reference": "af0d5fc84f3f7725513ba59cdcbe670ac2a4532a", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-json": "*", + "php": ">=7.3", + "phpunit/php-file-iterator": "^3.0", + "sebastian/cli-parser": "^1.0", + "sebastian/version": "^3.0" + }, + "bin": [ + "phploc" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "7.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": "A tool for quickly measuring the size of a PHP project.", + "homepage": "https://github.com/sebastianbergmann/phploc", + "support": { + "issues": "https://github.com/sebastianbergmann/phploc/issues", + "source": "https://github.com/sebastianbergmann/phploc/tree/7.0.2" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-12-07T05:51:20+00:00" + }, + { + "name": "phpmd/phpmd", + "version": "2.15.0", + "source": { + "type": "git", + "url": "https://github.com/phpmd/phpmd.git", + "reference": "74a1f56e33afad4128b886e334093e98e1b5e7c0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpmd/phpmd/zipball/74a1f56e33afad4128b886e334093e98e1b5e7c0", + "reference": "74a1f56e33afad4128b886e334093e98e1b5e7c0", + "shasum": "" + }, + "require": { + "composer/xdebug-handler": "^1.0 || ^2.0 || ^3.0", + "ext-xml": "*", + "pdepend/pdepend": "^2.16.1", + "php": ">=5.3.9" + }, + "require-dev": { + "easy-doc/easy-doc": "0.0.0 || ^1.3.2", + "ext-json": "*", + "ext-simplexml": "*", + "gregwar/rst": "^1.0", + "mikey179/vfsstream": "^1.6.8", + "squizlabs/php_codesniffer": "^2.9.2 || ^3.7.2" + }, + "bin": [ + "src/bin/phpmd" + ], + "type": "library", + "autoload": { + "psr-0": { + "PHPMD\\": "src/main/php" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Manuel Pichler", + "email": "github@manuel-pichler.de", + "homepage": "https://github.com/manuelpichler", + "role": "Project Founder" + }, + { + "name": "Marc Würth", + "email": "ravage@bluewin.ch", + "homepage": "https://github.com/ravage84", + "role": "Project Maintainer" + }, + { + "name": "Other contributors", + "homepage": "https://github.com/phpmd/phpmd/graphs/contributors", + "role": "Contributors" + } + ], + "description": "PHPMD is a spin-off project of PHP Depend and aims to be a PHP equivalent of the well known Java tool PMD.", + "homepage": "https://phpmd.org/", + "keywords": [ + "dev", + "mess detection", + "mess detector", + "pdepend", + "phpmd", + "pmd" + ], + "support": { + "irc": "irc://irc.freenode.org/phpmd", + "issues": "https://github.com/phpmd/phpmd/issues", + "source": "https://github.com/phpmd/phpmd/tree/2.15.0" + }, + "funding": [ + { + "url": "https://tidelift.com/funding/github/packagist/phpmd/phpmd", + "type": "tidelift" + } + ], + "time": "2023-12-11T08:22:20+00:00" + }, + { + "name": "phpstan/phpstan", + "version": "1.10.62", + "source": { + "type": "git", + "url": "https://github.com/phpstan/phpstan.git", + "reference": "cd5c8a1660ed3540b211407c77abf4af193a6af9" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpstan/phpstan/zipball/cd5c8a1660ed3540b211407c77abf4af193a6af9", + "reference": "cd5c8a1660ed3540b211407c77abf4af193a6af9", + "shasum": "" + }, + "require": { + "php": "^7.2|^8.0" + }, + "conflict": { + "phpstan/phpstan-shim": "*" + }, + "bin": [ + "phpstan", + "phpstan.phar" + ], + "type": "library", + "autoload": { + "files": [ + "bootstrap.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "PHPStan - PHP Static Analysis Tool", + "keywords": [ + "dev", + "static analysis" + ], + "support": { + "docs": "https://phpstan.org/user-guide/getting-started", + "forum": "https://github.com/phpstan/phpstan/discussions", + "issues": "https://github.com/phpstan/phpstan/issues", + "security": "https://github.com/phpstan/phpstan/security/policy", + "source": "https://github.com/phpstan/phpstan-src" + }, + "funding": [ + { + "url": "https://github.com/ondrejmirtes", + "type": "github" + }, + { + "url": "https://github.com/phpstan", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/phpstan/phpstan", + "type": "tidelift" + } + ], + "time": "2024-03-13T12:27:20+00:00" + }, + { + "name": "phpunit/php-code-coverage", + "version": "9.2.31", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-code-coverage.git", + "reference": "48c34b5d8d983006bd2adc2d0de92963b9155965" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/48c34b5d8d983006bd2adc2d0de92963b9155965", + "reference": "48c34b5d8d983006bd2adc2d0de92963b9155965", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-libxml": "*", + "ext-xmlwriter": "*", + "nikic/php-parser": "^4.18 || ^5.0", + "php": ">=7.3", + "phpunit/php-file-iterator": "^3.0.3", + "phpunit/php-text-template": "^2.0.2", + "sebastian/code-unit-reverse-lookup": "^2.0.2", + "sebastian/complexity": "^2.0", + "sebastian/environment": "^5.1.2", + "sebastian/lines-of-code": "^1.0.3", + "sebastian/version": "^3.0.1", + "theseer/tokenizer": "^1.2.0" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "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-master": "9.2-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 that provides collection, processing, and rendering functionality for PHP code coverage information.", + "homepage": "https://github.com/sebastianbergmann/php-code-coverage", + "keywords": [ + "coverage", + "testing", + "xunit" + ], + "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/9.2.31" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2024-03-02T06:37:42+00:00" + }, + { + "name": "phpunit/php-file-iterator", + "version": "3.0.6", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-file-iterator.git", + "reference": "cf1c2e7c203ac650e352f4cc675a7021e7d1b3cf" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/cf1c2e7c203ac650e352f4cc675a7021e7d1b3cf", + "reference": "cf1c2e7c203ac650e352f4cc675a7021e7d1b3cf", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "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": "FilterIterator implementation that filters files based on a list of suffixes.", + "homepage": "https://github.com/sebastianbergmann/php-file-iterator/", + "keywords": [ + "filesystem", + "iterator" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/php-file-iterator/issues", + "source": "https://github.com/sebastianbergmann/php-file-iterator/tree/3.0.6" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2021-12-02T12:48:52+00:00" + }, + { + "name": "phpunit/php-invoker", + "version": "3.1.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-invoker.git", + "reference": "5a10147d0aaf65b58940a0b72f71c9ac0423cc67" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-invoker/zipball/5a10147d0aaf65b58940a0b72f71c9ac0423cc67", + "reference": "5a10147d0aaf65b58940a0b72f71c9ac0423cc67", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "ext-pcntl": "*", + "phpunit/phpunit": "^9.3" + }, + "suggest": { + "ext-pcntl": "*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.1-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": "Invoke callables with a timeout", + "homepage": "https://github.com/sebastianbergmann/php-invoker/", + "keywords": [ + "process" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/php-invoker/issues", + "source": "https://github.com/sebastianbergmann/php-invoker/tree/3.1.1" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-09-28T05:58:55+00:00" + }, + { + "name": "phpunit/php-text-template", + "version": "2.0.4", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-text-template.git", + "reference": "5da5f67fc95621df9ff4c4e5a84d6a8a2acf7c28" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/5da5f67fc95621df9ff4c4e5a84d6a8a2acf7c28", + "reference": "5da5f67fc95621df9ff4c4e5a84d6a8a2acf7c28", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.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": "Simple template engine.", + "homepage": "https://github.com/sebastianbergmann/php-text-template/", + "keywords": [ + "template" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/php-text-template/issues", + "source": "https://github.com/sebastianbergmann/php-text-template/tree/2.0.4" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-10-26T05:33:50+00:00" + }, + { + "name": "phpunit/php-timer", + "version": "5.0.3", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-timer.git", + "reference": "5a63ce20ed1b5bf577850e2c4e87f4aa902afbd2" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/5a63ce20ed1b5bf577850e2c4e87f4aa902afbd2", + "reference": "5a63ce20ed1b5bf577850e2c4e87f4aa902afbd2", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "5.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": "Utility class for timing", + "homepage": "https://github.com/sebastianbergmann/php-timer/", + "keywords": [ + "timer" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/php-timer/issues", + "source": "https://github.com/sebastianbergmann/php-timer/tree/5.0.3" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-10-26T13:16:10+00:00" + }, + { + "name": "phpunit/phpunit", + "version": "9.6.17", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/phpunit.git", + "reference": "1a156980d78a6666721b7e8e8502fe210b587fcd" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/1a156980d78a6666721b7e8e8502fe210b587fcd", + "reference": "1a156980d78a6666721b7e8e8502fe210b587fcd", + "shasum": "" + }, + "require": { + "doctrine/instantiator": "^1.3.1 || ^2", + "ext-dom": "*", + "ext-json": "*", + "ext-libxml": "*", + "ext-mbstring": "*", + "ext-xml": "*", + "ext-xmlwriter": "*", + "myclabs/deep-copy": "^1.10.1", + "phar-io/manifest": "^2.0.3", + "phar-io/version": "^3.0.2", + "php": ">=7.3", + "phpunit/php-code-coverage": "^9.2.28", + "phpunit/php-file-iterator": "^3.0.5", + "phpunit/php-invoker": "^3.1.1", + "phpunit/php-text-template": "^2.0.3", + "phpunit/php-timer": "^5.0.2", + "sebastian/cli-parser": "^1.0.1", + "sebastian/code-unit": "^1.0.6", + "sebastian/comparator": "^4.0.8", + "sebastian/diff": "^4.0.3", + "sebastian/environment": "^5.1.3", + "sebastian/exporter": "^4.0.5", + "sebastian/global-state": "^5.0.1", + "sebastian/object-enumerator": "^4.0.3", + "sebastian/resource-operations": "^3.0.3", + "sebastian/type": "^3.2", + "sebastian/version": "^3.0.2" + }, + "suggest": { + "ext-soap": "To be able to generate mocks based on WSDL files", + "ext-xdebug": "PHP extension that provides line coverage as well as branch and path coverage" + }, + "bin": [ + "phpunit" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "9.6-dev" + } + }, + "autoload": { + "files": [ + "src/Framework/Assert/Functions.php" + ], + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "The PHP Unit Testing framework.", + "homepage": "https://phpunit.de/", + "keywords": [ + "phpunit", + "testing", + "xunit" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/phpunit/issues", + "security": "https://github.com/sebastianbergmann/phpunit/security/policy", + "source": "https://github.com/sebastianbergmann/phpunit/tree/9.6.17" + }, + "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-02-23T13:14:51+00:00" + }, + { + "name": "psr/container", + "version": "2.0.2", + "source": { + "type": "git", + "url": "https://github.com/php-fig/container.git", + "reference": "c71ecc56dfe541dbd90c5360474fbc405f8d5963" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/container/zipball/c71ecc56dfe541dbd90c5360474fbc405f8d5963", + "reference": "c71ecc56dfe541dbd90c5360474fbc405f8d5963", + "shasum": "" + }, + "require": { + "php": ">=7.4.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Container\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" + } + ], + "description": "Common Container Interface (PHP FIG PSR-11)", + "homepage": "https://github.com/php-fig/container", + "keywords": [ + "PSR-11", + "container", + "container-interface", + "container-interop", + "psr" + ], + "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": "sebastian/cli-parser", + "version": "1.0.2", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/cli-parser.git", + "reference": "2b56bea83a09de3ac06bb18b92f068e60cc6f50b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/cli-parser/zipball/2b56bea83a09de3ac06bb18b92f068e60cc6f50b", + "reference": "2b56bea83a09de3ac06bb18b92f068e60cc6f50b", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.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 parsing CLI options", + "homepage": "https://github.com/sebastianbergmann/cli-parser", + "support": { + "issues": "https://github.com/sebastianbergmann/cli-parser/issues", + "source": "https://github.com/sebastianbergmann/cli-parser/tree/1.0.2" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2024-03-02T06:27:43+00:00" + }, + { + "name": "sebastian/code-unit", + "version": "1.0.8", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/code-unit.git", + "reference": "1fc9f64c0927627ef78ba436c9b17d967e68e120" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/code-unit/zipball/1fc9f64c0927627ef78ba436c9b17d967e68e120", + "reference": "1fc9f64c0927627ef78ba436c9b17d967e68e120", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.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": "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", + "source": "https://github.com/sebastianbergmann/code-unit/tree/1.0.8" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-10-26T13:08:54+00:00" + }, + { + "name": "sebastian/code-unit-reverse-lookup", + "version": "2.0.3", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/code-unit-reverse-lookup.git", + "reference": "ac91f01ccec49fb77bdc6fd1e548bc70f7faa3e5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/ac91f01ccec49fb77bdc6fd1e548bc70f7faa3e5", + "reference": "ac91f01ccec49fb77bdc6fd1e548bc70f7faa3e5", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Looks up which function or method a line of code belongs to", + "homepage": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/", + "support": { + "issues": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/issues", + "source": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/tree/2.0.3" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-09-28T05:30:19+00:00" + }, + { + "name": "sebastian/comparator", + "version": "4.0.8", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/comparator.git", + "reference": "fa0f136dd2334583309d32b62544682ee972b51a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/fa0f136dd2334583309d32b62544682ee972b51a", + "reference": "fa0f136dd2334583309d32b62544682ee972b51a", + "shasum": "" + }, + "require": { + "php": ">=7.3", + "sebastian/diff": "^4.0", + "sebastian/exporter": "^4.0" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + }, + { + "name": "Jeff Welch", + "email": "whatthejeff@gmail.com" + }, + { + "name": "Volker Dusch", + "email": "github@wallbash.com" + }, + { + "name": "Bernhard Schussek", + "email": "bschussek@2bepublished.at" + } + ], + "description": "Provides the functionality to compare PHP values for equality", + "homepage": "https://github.com/sebastianbergmann/comparator", + "keywords": [ + "comparator", + "compare", + "equality" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/comparator/issues", + "source": "https://github.com/sebastianbergmann/comparator/tree/4.0.8" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2022-09-14T12:41:17+00:00" + }, + { + "name": "sebastian/complexity", + "version": "2.0.3", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/complexity.git", + "reference": "25f207c40d62b8b7aa32f5ab026c53561964053a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/complexity/zipball/25f207c40d62b8b7aa32f5ab026c53561964053a", + "reference": "25f207c40d62b8b7aa32f5ab026c53561964053a", + "shasum": "" + }, + "require": { + "nikic/php-parser": "^4.18 || ^5.0", + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.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", + "source": "https://github.com/sebastianbergmann/complexity/tree/2.0.3" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2023-12-22T06:19:30+00:00" + }, + { + "name": "sebastian/diff", + "version": "4.0.6", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/diff.git", + "reference": "ba01945089c3a293b01ba9badc29ad55b106b0bc" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/ba01945089c3a293b01ba9badc29ad55b106b0bc", + "reference": "ba01945089c3a293b01ba9badc29ad55b106b0bc", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3", + "symfony/process": "^4.2 || ^5" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "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", + "udiff", + "unidiff", + "unified diff" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/diff/issues", + "source": "https://github.com/sebastianbergmann/diff/tree/4.0.6" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2024-03-02T06:30:58+00:00" + }, + { + "name": "sebastian/environment", + "version": "5.1.5", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/environment.git", + "reference": "830c43a844f1f8d5b7a1f6d6076b784454d8b7ed" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/830c43a844f1f8d5b7a1f6d6076b784454d8b7ed", + "reference": "830c43a844f1f8d5b7a1f6d6076b784454d8b7ed", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "suggest": { + "ext-posix": "*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "5.1-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Provides functionality to handle HHVM/PHP environments", + "homepage": "http://www.github.com/sebastianbergmann/environment", + "keywords": [ + "Xdebug", + "environment", + "hhvm" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/environment/issues", + "source": "https://github.com/sebastianbergmann/environment/tree/5.1.5" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2023-02-03T06:03:51+00:00" + }, + { + "name": "sebastian/exporter", + "version": "4.0.6", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/exporter.git", + "reference": "78c00df8f170e02473b682df15bfcdacc3d32d72" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/78c00df8f170e02473b682df15bfcdacc3d32d72", + "reference": "78c00df8f170e02473b682df15bfcdacc3d32d72", + "shasum": "" + }, + "require": { + "php": ">=7.3", + "sebastian/recursion-context": "^4.0" + }, + "require-dev": { + "ext-mbstring": "*", + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + }, + { + "name": "Jeff Welch", + "email": "whatthejeff@gmail.com" + }, + { + "name": "Volker Dusch", + "email": "github@wallbash.com" + }, + { + "name": "Adam Harvey", + "email": "aharvey@php.net" + }, + { + "name": "Bernhard Schussek", + "email": "bschussek@gmail.com" + } + ], + "description": "Provides the functionality to export PHP variables for visualization", + "homepage": "https://www.github.com/sebastianbergmann/exporter", + "keywords": [ + "export", + "exporter" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/exporter/issues", + "source": "https://github.com/sebastianbergmann/exporter/tree/4.0.6" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2024-03-02T06:33:00+00:00" + }, + { + "name": "sebastian/global-state", + "version": "5.0.7", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/global-state.git", + "reference": "bca7df1f32ee6fe93b4d4a9abbf69e13a4ada2c9" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/bca7df1f32ee6fe93b4d4a9abbf69e13a4ada2c9", + "reference": "bca7df1f32ee6fe93b4d4a9abbf69e13a4ada2c9", + "shasum": "" + }, + "require": { + "php": ">=7.3", + "sebastian/object-reflector": "^2.0", + "sebastian/recursion-context": "^4.0" + }, + "require-dev": { + "ext-dom": "*", + "phpunit/phpunit": "^9.3" + }, + "suggest": { + "ext-uopz": "*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "5.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Snapshotting of global state", + "homepage": "http://www.github.com/sebastianbergmann/global-state", + "keywords": [ + "global state" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/global-state/issues", + "source": "https://github.com/sebastianbergmann/global-state/tree/5.0.7" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2024-03-02T06:35:11+00:00" + }, + { + "name": "sebastian/lines-of-code", + "version": "1.0.4", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/lines-of-code.git", + "reference": "e1e4a170560925c26d424b6a03aed157e7dcc5c5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/lines-of-code/zipball/e1e4a170560925c26d424b6a03aed157e7dcc5c5", + "reference": "e1e4a170560925c26d424b6a03aed157e7dcc5c5", + "shasum": "" + }, + "require": { + "nikic/php-parser": "^4.18 || ^5.0", + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.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", + "source": "https://github.com/sebastianbergmann/lines-of-code/tree/1.0.4" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2023-12-22T06:20:34+00:00" + }, + { + "name": "sebastian/object-enumerator", + "version": "4.0.4", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/object-enumerator.git", + "reference": "5c9eeac41b290a3712d88851518825ad78f45c71" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/5c9eeac41b290a3712d88851518825ad78f45c71", + "reference": "5c9eeac41b290a3712d88851518825ad78f45c71", + "shasum": "" + }, + "require": { + "php": ">=7.3", + "sebastian/object-reflector": "^2.0", + "sebastian/recursion-context": "^4.0" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Traverses array structures and object graphs to enumerate all referenced objects", + "homepage": "https://github.com/sebastianbergmann/object-enumerator/", + "support": { + "issues": "https://github.com/sebastianbergmann/object-enumerator/issues", + "source": "https://github.com/sebastianbergmann/object-enumerator/tree/4.0.4" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-10-26T13:12:34+00:00" + }, + { + "name": "sebastian/object-reflector", + "version": "2.0.4", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/object-reflector.git", + "reference": "b4f479ebdbf63ac605d183ece17d8d7fe49c15c7" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/object-reflector/zipball/b4f479ebdbf63ac605d183ece17d8d7fe49c15c7", + "reference": "b4f479ebdbf63ac605d183ece17d8d7fe49c15c7", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Allows reflection of object attributes, including inherited and non-public ones", + "homepage": "https://github.com/sebastianbergmann/object-reflector/", + "support": { + "issues": "https://github.com/sebastianbergmann/object-reflector/issues", + "source": "https://github.com/sebastianbergmann/object-reflector/tree/2.0.4" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-10-26T13:14:26+00:00" + }, + { + "name": "sebastian/recursion-context", + "version": "4.0.5", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/recursion-context.git", + "reference": "e75bd0f07204fec2a0af9b0f3cfe97d05f92efc1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/e75bd0f07204fec2a0af9b0f3cfe97d05f92efc1", + "reference": "e75bd0f07204fec2a0af9b0f3cfe97d05f92efc1", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "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": "https://github.com/sebastianbergmann/recursion-context", + "support": { + "issues": "https://github.com/sebastianbergmann/recursion-context/issues", + "source": "https://github.com/sebastianbergmann/recursion-context/tree/4.0.5" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2023-02-03T06:07:39+00:00" + }, + { + "name": "sebastian/resource-operations", + "version": "3.0.4", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/resource-operations.git", + "reference": "05d5692a7993ecccd56a03e40cd7e5b09b1d404e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/resource-operations/zipball/05d5692a7993ecccd56a03e40cd7e5b09b1d404e", + "reference": "05d5692a7993ecccd56a03e40cd7e5b09b1d404e", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.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" + } + ], + "description": "Provides a list of PHP built-in functions that operate on resources", + "homepage": "https://www.github.com/sebastianbergmann/resource-operations", + "support": { + "source": "https://github.com/sebastianbergmann/resource-operations/tree/3.0.4" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2024-03-14T16:00:52+00:00" + }, + { + "name": "sebastian/type", + "version": "3.2.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/type.git", + "reference": "75e2c2a32f5e0b3aef905b9ed0b179b953b3d7c7" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/75e2c2a32f5e0b3aef905b9ed0b179b953b3d7c7", + "reference": "75e2c2a32f5e0b3aef905b9ed0b179b953b3d7c7", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.5" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.2-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": "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", + "source": "https://github.com/sebastianbergmann/type/tree/3.2.1" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2023-02-03T06:13:03+00:00" + }, + { + "name": "sebastian/version", + "version": "3.0.2", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/version.git", + "reference": "c6c1022351a901512170118436c764e473f6de8c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/c6c1022351a901512170118436c764e473f6de8c", + "reference": "c6c1022351a901512170118436c764e473f6de8c", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "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 that helps with managing the version number of Git-hosted PHP projects", + "homepage": "https://github.com/sebastianbergmann/version", + "support": { + "issues": "https://github.com/sebastianbergmann/version/issues", + "source": "https://github.com/sebastianbergmann/version/tree/3.0.2" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-09-28T06:39:44+00:00" + }, + { + "name": "squizlabs/php_codesniffer", + "version": "3.9.0", + "source": { + "type": "git", + "url": "https://github.com/PHPCSStandards/PHP_CodeSniffer.git", + "reference": "d63cee4890a8afaf86a22e51ad4d97c91dd4579b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/PHPCSStandards/PHP_CodeSniffer/zipball/d63cee4890a8afaf86a22e51ad4d97c91dd4579b", + "reference": "d63cee4890a8afaf86a22e51ad4d97c91dd4579b", + "shasum": "" + }, + "require": { + "ext-simplexml": "*", + "ext-tokenizer": "*", + "ext-xmlwriter": "*", + "php": ">=5.4.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0 || ^8.0 || ^9.3.4" + }, + "bin": [ + "bin/phpcbf", + "bin/phpcs" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.x-dev" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Greg Sherwood", + "role": "Former lead" + }, + { + "name": "Juliette Reinders Folmer", + "role": "Current lead" + }, + { + "name": "Contributors", + "homepage": "https://github.com/PHPCSStandards/PHP_CodeSniffer/graphs/contributors" + } + ], + "description": "PHP_CodeSniffer tokenizes PHP, JavaScript and CSS files and detects violations of a defined set of coding standards.", + "homepage": "https://github.com/PHPCSStandards/PHP_CodeSniffer", + "keywords": [ + "phpcs", + "standards", + "static analysis" + ], + "support": { + "issues": "https://github.com/PHPCSStandards/PHP_CodeSniffer/issues", + "security": "https://github.com/PHPCSStandards/PHP_CodeSniffer/security/policy", + "source": "https://github.com/PHPCSStandards/PHP_CodeSniffer", + "wiki": "https://github.com/PHPCSStandards/PHP_CodeSniffer/wiki" + }, + "funding": [ + { + "url": "https://github.com/PHPCSStandards", + "type": "github" + }, + { + "url": "https://github.com/jrfnl", + "type": "github" + }, + { + "url": "https://opencollective.com/php_codesniffer", + "type": "open_collective" + } + ], + "time": "2024-02-16T15:06:51+00:00" + }, + { + "name": "symfony/config", + "version": "v6.4.4", + "source": { + "type": "git", + "url": "https://github.com/symfony/config.git", + "reference": "6ea4affc27f2086c9d16b92ab5429ce1e3c38047" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/config/zipball/6ea4affc27f2086c9d16b92ab5429ce1e3c38047", + "reference": "6ea4affc27f2086c9d16b92ab5429ce1e3c38047", + "shasum": "" + }, + "require": { + "php": ">=8.1", + "symfony/deprecation-contracts": "^2.5|^3", + "symfony/filesystem": "^5.4|^6.0|^7.0", + "symfony/polyfill-ctype": "~1.8" + }, + "conflict": { + "symfony/finder": "<5.4", + "symfony/service-contracts": "<2.5" + }, + "require-dev": { + "symfony/event-dispatcher": "^5.4|^6.0|^7.0", + "symfony/finder": "^5.4|^6.0|^7.0", + "symfony/messenger": "^5.4|^6.0|^7.0", + "symfony/service-contracts": "^2.5|^3", + "symfony/yaml": "^5.4|^6.0|^7.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\Config\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Helps you find, load, combine, autofill and validate configuration values of any kind", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/config/tree/v6.4.4" + }, + "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-02-26T07:52:26+00:00" + }, + { + "name": "symfony/dependency-injection", + "version": "v6.4.4", + "source": { + "type": "git", + "url": "https://github.com/symfony/dependency-injection.git", + "reference": "6236e5e843cb763e9d0f74245678b994afea5363" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/6236e5e843cb763e9d0f74245678b994afea5363", + "reference": "6236e5e843cb763e9d0f74245678b994afea5363", + "shasum": "" + }, + "require": { + "php": ">=8.1", + "psr/container": "^1.1|^2.0", + "symfony/deprecation-contracts": "^2.5|^3", + "symfony/service-contracts": "^2.5|^3.0", + "symfony/var-exporter": "^6.2.10|^7.0" + }, + "conflict": { + "ext-psr": "<1.1|>=2", + "symfony/config": "<6.1", + "symfony/finder": "<5.4", + "symfony/proxy-manager-bridge": "<6.3", + "symfony/yaml": "<5.4" + }, + "provide": { + "psr/container-implementation": "1.1|2.0", + "symfony/service-implementation": "1.1|2.0|3.0" + }, + "require-dev": { + "symfony/config": "^6.1|^7.0", + "symfony/expression-language": "^5.4|^6.0|^7.0", + "symfony/yaml": "^5.4|^6.0|^7.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\DependencyInjection\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Allows you to standardize and centralize the way objects are constructed in your application", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/dependency-injection/tree/v6.4.4" + }, + "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-02-22T20:27:10+00:00" + }, + { + "name": "symfony/deprecation-contracts", + "version": "v3.4.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/deprecation-contracts.git", + "reference": "7c3aff79d10325257a001fcf92d991f24fc967cf" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/7c3aff79d10325257a001fcf92d991f24fc967cf", + "reference": "7c3aff79d10325257a001fcf92d991f24fc967cf", + "shasum": "" + }, + "require": { + "php": ">=8.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "3.4-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", + "support": { + "source": "https://github.com/symfony/deprecation-contracts/tree/v3.4.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": "2023-05-23T14:45:45+00:00" + }, + { + "name": "symfony/filesystem", + "version": "v6.4.3", + "source": { + "type": "git", + "url": "https://github.com/symfony/filesystem.git", + "reference": "7f3b1755eb49297a0827a7575d5d2b2fd11cc9fb" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/7f3b1755eb49297a0827a7575d5d2b2fd11cc9fb", + "reference": "7f3b1755eb49297a0827a7575d5d2b2fd11cc9fb", + "shasum": "" + }, + "require": { + "php": ">=8.1", + "symfony/polyfill-ctype": "~1.8", + "symfony/polyfill-mbstring": "~1.8" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\Filesystem\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Provides basic utilities for the filesystem", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/filesystem/tree/v6.4.3" + }, + "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-01-23T14:51:35+00:00" + }, + { + "name": "symfony/polyfill-ctype", + "version": "v1.29.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-ctype.git", + "reference": "ef4d7e442ca910c4764bce785146269b30cb5fc4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/ef4d7e442ca910c4764bce785146269b30cb5fc4", + "reference": "ef4d7e442ca910c4764bce785146269b30cb5fc4", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "provide": { + "ext-ctype": "*" + }, + "suggest": { + "ext-ctype": "For best performance" + }, + "type": "library", + "extra": { + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Ctype\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Gert de Pagter", + "email": "BackEndTea@gmail.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for ctype functions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "ctype", + "polyfill", + "portable" + ], + "support": { + "source": "https://github.com/symfony/polyfill-ctype/tree/v1.29.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-01-29T20:11:03+00:00" + }, + { + "name": "symfony/polyfill-mbstring", + "version": "v1.29.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-mbstring.git", + "reference": "9773676c8a1bb1f8d4340a62efe641cf76eda7ec" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/9773676c8a1bb1f8d4340a62efe641cf76eda7ec", + "reference": "9773676c8a1bb1f8d4340a62efe641cf76eda7ec", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "provide": { + "ext-mbstring": "*" + }, + "suggest": { + "ext-mbstring": "For best performance" + }, + "type": "library", + "extra": { + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "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.29.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-01-29T20:11:03+00:00" + }, + { + "name": "symfony/service-contracts", + "version": "v3.4.1", + "source": { + "type": "git", + "url": "https://github.com/symfony/service-contracts.git", + "reference": "fe07cbc8d837f60caf7018068e350cc5163681a0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/service-contracts/zipball/fe07cbc8d837f60caf7018068e350cc5163681a0", + "reference": "fe07cbc8d837f60caf7018068e350cc5163681a0", + "shasum": "" + }, + "require": { + "php": ">=8.1", + "psr/container": "^1.1|^2.0" + }, + "conflict": { + "ext-psr": "<1.1|>=2" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "3.4-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": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Generic abstractions related to writing services", + "homepage": "https://symfony.com", + "keywords": [ + "abstractions", + "contracts", + "decoupling", + "interfaces", + "interoperability", + "standards" + ], + "support": { + "source": "https://github.com/symfony/service-contracts/tree/v3.4.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": "2023-12-26T14:02:43+00:00" + }, + { + "name": "symfony/var-exporter", + "version": "v6.4.4", + "source": { + "type": "git", + "url": "https://github.com/symfony/var-exporter.git", + "reference": "0bd342e24aef49fc82a21bd4eedd3e665d177e5b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/var-exporter/zipball/0bd342e24aef49fc82a21bd4eedd3e665d177e5b", + "reference": "0bd342e24aef49fc82a21bd4eedd3e665d177e5b", + "shasum": "" + }, + "require": { + "php": ">=8.1", + "symfony/deprecation-contracts": "^2.5|^3" + }, + "require-dev": { + "symfony/var-dumper": "^5.4|^6.0|^7.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\VarExporter\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "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": "Allows exporting any serializable PHP data structure to plain PHP code", + "homepage": "https://symfony.com", + "keywords": [ + "clone", + "construct", + "export", + "hydrate", + "instantiate", + "lazy-loading", + "proxy", + "serialize" + ], + "support": { + "source": "https://github.com/symfony/var-exporter/tree/v6.4.4" + }, + "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-02-26T08:37:45+00:00" + }, + { + "name": "theseer/tokenizer", + "version": "1.2.3", + "source": { + "type": "git", + "url": "https://github.com/theseer/tokenizer.git", + "reference": "737eda637ed5e28c3413cb1ebe8bb52cbf1ca7a2" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/theseer/tokenizer/zipball/737eda637ed5e28c3413cb1ebe8bb52cbf1ca7a2", + "reference": "737eda637ed5e28c3413cb1ebe8bb52cbf1ca7a2", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-tokenizer": "*", + "ext-xmlwriter": "*", + "php": "^7.2 || ^8.0" + }, + "type": "library", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Arne Blankerts", + "email": "arne@blankerts.de", + "role": "Developer" + } + ], + "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": "2024-03-03T12:36:25+00:00" } ], "aliases": [], @@ -72,5 +3105,5 @@ "prefer-lowest": false, "platform": [], "platform-dev": [], - "plugin-api-version": "2.2.0" + "plugin-api-version": "2.6.0" } diff --git a/examples/BasicUsage.php b/examples/BasicUsage.php new file mode 100644 index 0000000..018f64c --- /dev/null +++ b/examples/BasicUsage.php @@ -0,0 +1,16 @@ +all($items) as $index => $item) { + echo sprintf( + "%d: (%s)\n", + $index, + implode(', ', $item) + ); +} diff --git a/examples/BasicUsage.txt b/examples/BasicUsage.txt new file mode 100644 index 0000000..778f014 --- /dev/null +++ b/examples/BasicUsage.txt @@ -0,0 +1,7 @@ +0: (A, B, C) +1: (A, B) +2: (A, C) +3: (A) +4: (B, C) +5: (B) +6: (C) diff --git a/examples/BasicUsageGenerator.php b/examples/BasicUsageGenerator.php new file mode 100644 index 0000000..f7d6ff5 --- /dev/null +++ b/examples/BasicUsageGenerator.php @@ -0,0 +1,16 @@ +all($items) as $index => $item) { + echo sprintf( + "%d: (%s)\n", + $index, + implode(', ', $item) + ); +} diff --git a/examples/BasicUsageGenerator.txt b/examples/BasicUsageGenerator.txt new file mode 100644 index 0000000..778f014 --- /dev/null +++ b/examples/BasicUsageGenerator.txt @@ -0,0 +1,7 @@ +0: (A, B, C) +1: (A, B) +2: (A, C) +3: (A) +4: (B, C) +5: (B) +6: (C) diff --git a/example/UseCombination.php b/examples/UseCombination.php similarity index 91% rename from example/UseCombination.php rename to examples/UseCombination.php index acd961a..b9680bc 100644 --- a/example/UseCombination.php +++ b/examples/UseCombination.php @@ -8,7 +8,7 @@ $c = new Combination(); // All Items -$items = ['A', 'B', 'C', 'D', 'E', ]; +$items = [ 'A', 'B', 'C', 'D', 'E', ]; echo sprintf("All Items:\n\t(%s)\n\n", implode(", ", $items)); // Call back @@ -47,9 +47,9 @@ ); // All Combinations of $a1, $a2 and $a3 -$a1 = ['A1', 'A2', ]; -$a2 = ['B1', 'B2', 'B3', ]; -$a3 = ['C1', 'C2', 'C3', 'C4', ]; +$a1 = [ 'A1', 'A2', ]; +$a2 = [ 'B1', 'B2', 'B3', ]; +$a3 = [ 'C1', 'C2', 'C3', 'C4', ]; echo "All Combinations of multiple arrays:\n"; echo sprintf("\tArray1: (%s)\n", implode(', ', $a1)); diff --git a/example/UseCombination.txt b/examples/UseCombination.txt similarity index 100% rename from example/UseCombination.txt rename to examples/UseCombination.txt diff --git a/example/UseCombinationGenerator.php b/examples/UseCombinationGenerator.php similarity index 96% rename from example/UseCombinationGenerator.php rename to examples/UseCombinationGenerator.php index c6ec1b2..9258814 100644 --- a/example/UseCombinationGenerator.php +++ b/examples/UseCombinationGenerator.php @@ -8,7 +8,7 @@ $c = new CombinationGenerator(); // All Items -$items = ['A', 'B', 'C', 'D', 'E', ]; +$items = [ 'A', 'B', 'C', 'D', 'E', ]; echo sprintf("All Items:\n\t(%s)\n\n", implode(", ", $items)); // Common Format diff --git a/example/UseCombinationGenerator.txt b/examples/UseCombinationGenerator.txt similarity index 100% rename from example/UseCombinationGenerator.txt rename to examples/UseCombinationGenerator.txt diff --git a/example/UseCombinationSort.php b/examples/UseCombinationSort.php similarity index 92% rename from example/UseCombinationSort.php rename to examples/UseCombinationSort.php index d2c19e5..1f6ba50 100644 --- a/example/UseCombinationSort.php +++ b/examples/UseCombinationSort.php @@ -8,7 +8,7 @@ $c = new Combination(); // All Items -$items = ['A', 'B', 'C', 'D', 'E', ]; +$items = [ 'A', 'B', 'C', 'D', 'E', ]; echo sprintf("All Items:\n\t(%s)\n\n", implode(", ", $items)); // Set a flag to sort @@ -50,9 +50,9 @@ ); // All Combinations of $a1, $a2 and $a3: does not support sorting -$a1 = ['A1', 'A2', ]; -$a2 = ['B1', 'B2', 'B3', ]; -$a3 = ['C1', 'C2', 'C3', 'C4', ]; +$a1 = [ 'A1', 'A2', ]; +$a2 = [ 'B1', 'B2', 'B3', ]; +$a3 = [ 'C1', 'C2', 'C3', 'C4', ]; echo "All Combinations of multiple arrays:\n"; echo sprintf("\tArray1: (%s)\n", implode(', ', $a1)); diff --git a/example/UseCombinationSort.txt b/examples/UseCombinationSort.txt similarity index 100% rename from example/UseCombinationSort.txt rename to examples/UseCombinationSort.txt diff --git a/examples/UseInPhpUnit.class.php b/examples/UseInPhpUnit.class.php new file mode 100644 index 0000000..ea11f06 --- /dev/null +++ b/examples/UseInPhpUnit.class.php @@ -0,0 +1,35 @@ +log = new Logger('UseInPhpUnit'); + $this->log->pushHandler( + new StreamHandler(__DIR__ . '/UseInPhpUnit.log', Level::Debug) + ); + } + + public function order( + int $productId, + string $size, + string $color, + int $amount + ) { + $this->log->info('Adding a new order', [ + 'productId' => $productId, + 'size' => $size, + 'color' => $color, + 'amount' => $amount, + ]); + return true; + } +} diff --git a/examples/UseInPhpUnit.log b/examples/UseInPhpUnit.log new file mode 100644 index 0000000..c72a731 --- /dev/null +++ b/examples/UseInPhpUnit.log @@ -0,0 +1,24 @@ +[2024-03-17T05:21:18.875257+00:00] UseInPhpUnit.INFO: Adding a new order {"productId":1101,"size":"S","color":"White","amount":1} [] +[2024-03-17T05:21:18.879375+00:00] UseInPhpUnit.INFO: Adding a new order {"productId":1101,"size":"S","color":"White","amount":2} [] +[2024-03-17T05:21:18.880274+00:00] UseInPhpUnit.INFO: Adding a new order {"productId":1101,"size":"S","color":"Black","amount":1} [] +[2024-03-17T05:21:18.881237+00:00] UseInPhpUnit.INFO: Adding a new order {"productId":1101,"size":"S","color":"Black","amount":2} [] +[2024-03-17T05:21:18.882179+00:00] UseInPhpUnit.INFO: Adding a new order {"productId":1101,"size":"M","color":"White","amount":1} [] +[2024-03-17T05:21:18.883150+00:00] UseInPhpUnit.INFO: Adding a new order {"productId":1101,"size":"M","color":"White","amount":2} [] +[2024-03-17T05:21:18.884307+00:00] UseInPhpUnit.INFO: Adding a new order {"productId":1101,"size":"M","color":"Black","amount":1} [] +[2024-03-17T05:21:18.885616+00:00] UseInPhpUnit.INFO: Adding a new order {"productId":1101,"size":"M","color":"Black","amount":2} [] +[2024-03-17T05:21:18.886943+00:00] UseInPhpUnit.INFO: Adding a new order {"productId":1101,"size":"L","color":"White","amount":1} [] +[2024-03-17T05:21:18.888118+00:00] UseInPhpUnit.INFO: Adding a new order {"productId":1101,"size":"L","color":"White","amount":2} [] +[2024-03-17T05:21:18.888915+00:00] UseInPhpUnit.INFO: Adding a new order {"productId":1101,"size":"L","color":"Black","amount":1} [] +[2024-03-17T05:21:18.889651+00:00] UseInPhpUnit.INFO: Adding a new order {"productId":1101,"size":"L","color":"Black","amount":2} [] +[2024-03-17T05:21:18.890314+00:00] UseInPhpUnit.INFO: Adding a new order {"productId":1102,"size":"S","color":"White","amount":1} [] +[2024-03-17T05:21:18.891062+00:00] UseInPhpUnit.INFO: Adding a new order {"productId":1102,"size":"S","color":"White","amount":2} [] +[2024-03-17T05:21:18.891687+00:00] UseInPhpUnit.INFO: Adding a new order {"productId":1102,"size":"S","color":"Black","amount":1} [] +[2024-03-17T05:21:18.892481+00:00] UseInPhpUnit.INFO: Adding a new order {"productId":1102,"size":"S","color":"Black","amount":2} [] +[2024-03-17T05:21:18.893799+00:00] UseInPhpUnit.INFO: Adding a new order {"productId":1102,"size":"M","color":"White","amount":1} [] +[2024-03-17T05:21:18.894578+00:00] UseInPhpUnit.INFO: Adding a new order {"productId":1102,"size":"M","color":"White","amount":2} [] +[2024-03-17T05:21:18.895254+00:00] UseInPhpUnit.INFO: Adding a new order {"productId":1102,"size":"M","color":"Black","amount":1} [] +[2024-03-17T05:21:18.895810+00:00] UseInPhpUnit.INFO: Adding a new order {"productId":1102,"size":"M","color":"Black","amount":2} [] +[2024-03-17T05:21:18.896418+00:00] UseInPhpUnit.INFO: Adding a new order {"productId":1102,"size":"L","color":"White","amount":1} [] +[2024-03-17T05:21:18.897375+00:00] UseInPhpUnit.INFO: Adding a new order {"productId":1102,"size":"L","color":"White","amount":2} [] +[2024-03-17T05:21:18.899410+00:00] UseInPhpUnit.INFO: Adding a new order {"productId":1102,"size":"L","color":"Black","amount":1} [] +[2024-03-17T05:21:18.900579+00:00] UseInPhpUnit.INFO: Adding a new order {"productId":1102,"size":"L","color":"Black","amount":2} [] diff --git a/examples/UseInPhpUnitTest.php b/examples/UseInPhpUnitTest.php new file mode 100644 index 0000000..6bba7f9 --- /dev/null +++ b/examples/UseInPhpUnitTest.php @@ -0,0 +1,49 @@ +fromArrays([$products, $sizes, $colors, $amount]) as $e + ) { + $data[implode(', ', $e)] = $e; + } + return $data; + } + + /** + * @dataProvider provide_order_can_order_correctly + */ + public function test_order_can_order_correctly( + int $productId, + string $size, + string $color, + int $amount + ): void { + $u = new UseInPhpUnit(); + $this->assertTrue($u->order( + $productId, + $size, + $color, + $amount + )); + } +} diff --git a/phpcs.xml b/phpcs.xml index 579c839..65d55f2 100644 --- a/phpcs.xml +++ b/phpcs.xml @@ -7,12 +7,15 @@ */tests/* + *Test.php */tests/* + *Test.php */tests/* + *Test.php diff --git a/phpmd.xml b/phpmd.xml new file mode 100644 index 0000000..21ff8a9 --- /dev/null +++ b/phpmd.xml @@ -0,0 +1,21 @@ + + + Custom ruleset PHPMD + + + + + + + + + + + + + + + + + + diff --git a/phpstan.neon b/phpstan.neon new file mode 100644 index 0000000..2a9580d --- /dev/null +++ b/phpstan.neon @@ -0,0 +1,5 @@ +parameters: + level: 6 + paths: + - ./src + treatPhpDocTypesAsCertain: false diff --git a/src/Combination.php b/src/Combination.php index 6cad015..016755b 100644 --- a/src/Combination.php +++ b/src/Combination.php @@ -4,20 +4,25 @@ use Macocci7\PhpCombination\Util; +/** + * Class for generating combinations. + * @author macocci7 + * @license MIT + */ class Combination { /** - * returns all combinations - * @param array $items - * @param bool $sort = false - * @return array + * returns all combinations from single array. + * returns sorted array when the second param is set as true. + * @param array $items + * @param bool $sort = false + * @return array> + * @thrown \Exception */ public function all(array $items, bool $sort = false) { $count = count($items); - if (0 === $count) { - throw new \Exception("Empty array set."); - } + Util::validateArray($items); if ($count >= Util::systemBit() - 1) { throw new \Exception("Too many elements."); } @@ -42,11 +47,12 @@ public function all(array $items, bool $sort = false) /** * returns all pairs - * @param array $items - * @return array + * @param array $items + * @return array> */ public function pairs(array $items) { + Util::validateArray($items); if (count($items) < 2) { throw new \Exception("Too few elements."); } @@ -62,10 +68,11 @@ public function pairs(array $items) /** * returns all combinations of $n elements - * @param array $items - * @param int $n - * @param bool $sort = false - * @return array + * @param array $items + * @param int $n + * @param bool $sort = false + * @return array> + * @thrown \Exception */ public function ofN(array $items, int $n, bool $sort = false) { @@ -73,6 +80,7 @@ public function ofN(array $items, int $n, bool $sort = false) * ex) $items = [1,2,3,4], $n = 3 * ==> [1,2,3], [1,2,4], [1,3,4], [2,3,4] */ + Util::validateArray($items); if ($n < 1 || count($items) < $n) { throw new \Exception("Invalid number specified."); } @@ -87,14 +95,16 @@ public function ofN(array $items, int $n, bool $sort = false) /** * returns all combinations of $a to $b elements - * @param array $items - * @param int $a - * @param int $b - * @param bool $sort = false - * @return array + * @param array $items + * @param int $a + * @param int $b + * @param bool $sort = false + * @return array> + * @thrown \Exception */ public function ofA2B(array $items, int $a, int $b, bool $sort = false) { + Util::validateArray($items); if ($a < 1 || $b < 1) { throw new \Exception("Invalid number specified."); } @@ -115,52 +125,20 @@ public function ofA2B(array $items, int $a, int $b, bool $sort = false) return $combinations; } - /** - * validates the param - * @param array $arrays - * @return void - * @thrown \Exception - */ - public function validateArrays(array $arrays): void - { - // check if empty - if (empty($arrays)) { - throw new \Exception("Empty array set."); - } - // check types - $counts = []; - foreach ($arrays as $index => $array) { - if (!is_array($array)) { - $message = sprintf("index[%d]: Array expected.", $index); - throw new \Exception($message); - } - $counts[] = count($array); - } - // check number of combination patterns - $patterns = 1; - foreach ($counts as $count) { - $patterns *= $count; - } - if (is_float($patterns)) { - $message = $patterns . " patterns found (over limit)."; - throw new \Exception($message); - } - } - /** * returns all combinations from arrays - * @param array $arrays each elements must be array. - * @return array + * @param list> $arrays each elements must be array. + * @return array> * @thrown \Exception */ public function fromArrays(array $arrays): array { // validate - $this->validateArrays($arrays); + Util::validateArrays($arrays); // initialize $combinations = []; // make combinations - foreach ($arrays[0] as $i => $a) { + foreach ($arrays[0] as $a) { $this->makeCombinationsRecursive([$a], $arrays, $combinations); } return $combinations; @@ -168,9 +146,9 @@ public function fromArrays(array $arrays): array /** * makes combinations recusively - * @param array $a - * @param array &$arrays - * @param array &$combinations + * @param array $a + * @param list> &$arrays + * @param array &$combinations * @return void */ private function makeCombinationsRecursive($a, &$arrays, &$combinations) diff --git a/src/CombinationGenerator.php b/src/CombinationGenerator.php index d49bf96..4cdc287 100644 --- a/src/CombinationGenerator.php +++ b/src/CombinationGenerator.php @@ -4,25 +4,28 @@ use Macocci7\PhpCombination\Util; +/** + * Class for generating combinations with Generator. + * @author macocci7 + * @license MIT + */ class CombinationGenerator { /** * returns all combinations - * @param array $items + * @param array $items * @return \Generator + * @thrown \Exception */ public function all(array $items) { $count = count($items); - if (0 === $count) { - throw new \Exception("Empty array set."); - } + Util::validateArray($items); if ($count >= Util::systemBit() - 1) { throw new \Exception("Too many elements."); } $numberOfAllPatterns = 2 ** $count; $format = '%0' . $count . 'b'; - $combinations = []; for ($i = $numberOfAllPatterns - 1; $i > 0; $i--) { $combination = []; foreach (str_split(sprintf($format, $i)) as $index => $bit) { @@ -36,15 +39,16 @@ public function all(array $items) /** * returns all pairs - * @param array $items + * @param array $items * @return \Generator + * @thrown \Exception */ public function pairs(array $items) { + Util::validateArray($items); if (count($items) < 2) { throw new \Exception("Too few elements."); } - $pairs = []; $lastIndex = count($items) - 1; for ($x = 0; $x < $lastIndex; $x++) { for ($y = $x + 1; $y <= $lastIndex; $y++) { @@ -55,9 +59,10 @@ public function pairs(array $items) /** * returns all combinations of $n elements - * @param array $items - * @param int $n + * @param array $items + * @param int $n * @return \Generator + * @thrown \Exception */ public function ofN(array $items, int $n) { @@ -65,10 +70,10 @@ public function ofN(array $items, int $n) * ex) $items = [1,2,3,4], $n = 3 * ==> [1,2,3], [1,2,4], [1,3,4], [2,3,4] */ + Util::validateArray($items); if ($n < 1 || count($items) < $n) { throw new \Exception("Invalid number specified."); } - $r = []; foreach ($this->all($items) as $c) { if (count($c) === $n) { yield $c; @@ -78,13 +83,15 @@ public function ofN(array $items, int $n) /** * returns all combinations of $a to $b elements - * @param array $items - * @param int $a - * @param int $b + * @param array $items + * @param int $a + * @param int $b * @return \Generator + * @thrown \Exception */ public function ofA2B(array $items, int $a, int $b) { + Util::validateArray($items); if ($a < 1 || $b < 1) { throw new \Exception("Invalid number specified."); } @@ -95,7 +102,6 @@ public function ofA2B(array $items, int $a, int $b) if ($b > $count) { throw new \Exception("B exceeds the number of elements."); } - $combinations = []; foreach ($this->all($items) as $c) { $count = count($c); if ($a <= $count && $count <= $b) { diff --git a/src/Util.php b/src/Util.php index 161a3a9..1b4d625 100644 --- a/src/Util.php +++ b/src/Util.php @@ -2,11 +2,15 @@ namespace Macocci7\PhpCombination; +/** + * class for utility + * @author macocci7 + * @license MIT + */ class Util { /** * returns system bit - * @param * @return int */ public static function systemBit() @@ -16,4 +20,59 @@ public static function systemBit() // - 64bit-system: 8 (bytes) return PHP_INT_MAX * 8; } + + /** + * validates the array + * @param array $array + * @return true + * @thrown \Exception + */ + public static function validateArray(array $array) + { + if (empty($array)) { + throw new \Exception("Empty array set."); + } + foreach ($array as $i => $v) { + if (!is_int($i)) { + throw new \Exception("Array keys must be integer."); + } + if (!is_int($v) && !is_float($v) && !is_string($v)) { + throw new \Exception("Array elements must be int, float or strings."); + } + } + return true; + } + + /** + * validates the arrays + * @param mixed[] $arrays + * @return true + * @thrown \Exception + */ + public static function validateArrays(array $arrays): bool + { + // check if empty + if (empty($arrays)) { + throw new \Exception("Empty array set."); + } + // check types + $counts = []; + foreach ($arrays as $index => $array) { + if (!is_array($array)) { + $message = sprintf("index[%d]: Array expected.", $index); + throw new \Exception($message); + } + $counts[] = count($array); + } + // check number of combination patterns + $patterns = 1; + foreach ($counts as $count) { + $patterns *= $count; + } + if (is_float($patterns)) { // @phpstan-ignore-line conditionalType.alwaysFalse + $message = $patterns . " patterns found (over limit)."; + throw new \Exception($message); + } + return true; + } } diff --git a/tests/CombinationGeneratorTest.php b/tests/CombinationGeneratorTest.php index 62d40dc..7f885ea 100644 --- a/tests/CombinationGeneratorTest.php +++ b/tests/CombinationGeneratorTest.php @@ -1,4 +1,4 @@ - ['items' => [], ], "1 element" => ['items' => [1], ], ]; } @@ -64,6 +63,7 @@ public function test_pairs_can_throw_exception_with_invalid_param(array $items): $this->expectException(\Exception::class); $this->expectExceptionMessage("Too few elements."); foreach ($c->pairs($items) as $e) { + isset($e); } } @@ -95,7 +95,6 @@ public static function provide_ofN_can_throw_exception_with_invalid_param(): arr "2 elements, n = 0" => ['items' => [1, 2, ], 'n' => 0, ], "3 elements, n = 0" => ['items' => [1, 2, 3, ], 'n' => 0, ], - "0 element, n = 1" => ['items' => [], 'n' => 1, ], "1 element, n = 2" => ['items' => [1], 'n' => 2, ], "2 elements, n = 3" => ['items' => [1, 2, ], 'n' => 3, ], "3 elements, n = 4" => ['items' => [1, 2, 3, ], 'n' => 4, ], @@ -111,6 +110,7 @@ public function test_ofN_can_throw_exception_with_invalid_param(array $items, in $this->expectException(\Exception::class); $this->expectExceptionMessage("Invalid number specified."); foreach ($c->ofN($items, $n) as $e) { + isset($e); } } @@ -161,6 +161,7 @@ public function test_ofA2B_can_throw_exception_with_invalid_params(array $items, $this->expectException(\Exception::class); $this->expectExceptionMessage($message); foreach ($c->ofA2B($items, $a, $b) as $e) { + isset($e); } } diff --git a/tests/CombinationTest.php b/tests/CombinationTest.php index 4adbbb3..b14e543 100644 --- a/tests/CombinationTest.php +++ b/tests/CombinationTest.php @@ -62,7 +62,6 @@ public function test_all_can_sort_correctly(array $items, array $expect): void public static function provide_pairs_can_throw_exception_with_invalid_param(): array { return [ - "0 element" => ['items' => [], ], "1 element" => ['items' => [1], ], ]; } @@ -99,7 +98,6 @@ public function test_pairs_can_return_all_pairs_correctly(array $items, array $e public static function provide_ofN_can_throw_exception_with_invalid_param(): array { return [ - "0 element, n = 1" => ['items' => [], 'n' => 1, ], "1 element, n = -1" => ['items' => [1], 'n' => -1, ], "1 element, n = 0" => ['items' => [1], 'n' => 0, ], @@ -190,26 +188,6 @@ public function test_ofA2B_can_return_all_combinations_of_A_2_B_elements(array $ $this->assertSame($expect, $c->ofA2B($items, $a, $b)); } - public static function provide_validateArrays_can_throw_exception_with_invalid_param(): array - { - return [ - "Empty" => ['arrays' => [], 'message' => "Empty array set.", ], - "non-array included" => ['arrays' => [[1], [2], 3, ], 'message' => "index[2]: Array expected.", ], - "over limit" => ['arrays' => [array_fill(0, 55109, null), array_fill(0, 55109, null), array_fill(0, 55109, null), array_fill(0, 55109, null), ], 'message' => " patterns found (over limit).", ], - ]; - } - - /** - * @dataProvider provide_validateArrays_can_throw_exception_with_invalid_param - */ - public function test_validateArrays_can_throw_exception_with_invalid_param(array $arrays, string $message): void - { - $c = new Combination(); - $this->expectException(\Exception::class); - $this->expectExceptionMessage($message); - $c->validateArrays($arrays); - } - public static function provide_fromArrays_can_return_combinations_correctly(): array { return [ diff --git a/tests/UtilTest.php b/tests/UtilTest.php new file mode 100644 index 0000000..08029d5 --- /dev/null +++ b/tests/UtilTest.php @@ -0,0 +1,102 @@ + [], 'message' => 'Empty array set.', ], + [ 'array' => [ 'a' => 1, ], 'message' => 'Array keys must be integer.', ], + [ 'array' => [ 0 => 1, 'b' => 2, ], 'message' => 'Array keys must be integer.', ], + [ 'array' => [ null, ], 'message' => 'Array elements must be int, float or strings.', ], + [ 'array' => [ true, ], 'message' => 'Array elements must be int, float or strings.', ], + [ 'array' => [ false, ], 'message' => 'Array elements must be int, float or strings.', ], + [ 'array' => [ [ 1, ], ], 'message' => 'Array elements must be int, float or strings.', ], + [ 'array' => [ 1, null, ], 'message' => 'Array elements must be int, float or strings.', ], + [ 'array' => [ 1, true, ], 'message' => 'Array elements must be int, float or strings.', ], + [ 'array' => [ 1, false, ], 'message' => 'Array elements must be int, float or strings.', ], + [ 'array' => [ 1, [ 1, ], ], 'message' => 'Array elements must be int, float or strings.', ], + ]; + } + + /** + * @dataProvider provide_validateArray_can_throw_exception_with_invalid_param + */ + public function test_validateArray_can_throw_exception_with_invalid_param(array $array, string $message): void + { + $this->expectException(\Exception::class); + $this->expectExceptionMessage($message); + Util::validateArray($array); + } + + public static function provide_validateArray_can_validate_array_correctly(): array + { + return [ + [ 'array' => [ 1, ], ], + [ 'array' => [ 1.2, ], ], + [ 'array' => [ 'A'], ], + [ 'array' => [ 1, 1.2, ], ], + [ 'array' => [ 1, 'A', ], ], + [ 'array' => [ 1.2, 1, ], ], + [ 'array' => [ 1.2, 'A', ], ], + [ 'array' => [ 'A', 1, ], ], + [ 'array' => [ 'A', 1.2, ], ], + [ 'array' => [ 1, 1.2, 'A', ], ], + ]; + } + + /** + * @dataProvider provide_validateArray_can_validate_array_correctly + */ + public function test_validateArray_can_validate_array_correctly(array $array): void + { + $this->assertTrue(Util::validateArray($array)); + } + + public static function provide_validateArrays_can_throw_exception_with_invalid_param(): array + { + return [ + "Empty" => ['arrays' => [], 'message' => "Empty array set.", ], + "non-array included" => ['arrays' => [[1], [2], 3, ], 'message' => "index[2]: Array expected.", ], + "over limit" => ['arrays' => [array_fill(0, 55109, null), array_fill(0, 55109, null), array_fill(0, 55109, null), array_fill(0, 55109, null), ], 'message' => " patterns found (over limit).", ], + ]; + } + + /** + * @dataProvider provide_validateArrays_can_throw_exception_with_invalid_param + */ + public function test_validateArrays_can_throw_exception_with_invalid_param(array $arrays, string $message): void + { + $this->expectException(\Exception::class); + $this->expectExceptionMessage($message); + Util::validateArrays($arrays); + } + + public static function provide_validateArrays_can_return_true_correctly(): array + { + return [ + "int index, 1 child array" => [ 'arrays' => [ [1], ], ], + "int index, 2 child arrays" => [ 'arrays' => [ [1], [2], ], ], + "int index, 2 child arrays, multiple grand child elements" => [ 'arrays' => [ [ 1, 2, ], [ 3, 4, 5, ], ], ], + "string index, 1 child array" => [ 'arrays' => [ 'a' => [1], ], ], + "string index, 2 child arrays" => [ 'arrays' => [ 'a' => [1], 'b' => [2], ], ], + ]; + } + + /** + * @dataProvider provide_validateArrays_can_return_true_correctly + */ + public function test_validateArrays_can_return_true_correctly(array $arrays): void + { + $this->assertTrue(Util::validateArrays($arrays)); + } +}