From f182be4b2759a9c694630fb26d67097f9ab0aa7c Mon Sep 17 00:00:00 2001 From: Asif Nawaz Date: Thu, 21 Mar 2024 13:10:49 +0000 Subject: [PATCH] fix(idna translator): refactoring of code and bug patches --- .github/dependabot.yml | 9 +- .github/linters/phpstan.neon | 6 + .releaserc.json | 1 - composer.lock | 1837 -------------------- lib/IDNATranslator.php | 240 --- reports/logging/logfile.xml | 16 + reports/logging/testdox.html | 65 + reports/logging/testdox.txt | 9 + src/IDNA/Converter/ASCIIConverter.php | 42 + src/IDNA/Converter/ConversionInterface.php | 9 + src/IDNA/Converter/UnicodeConverter.php | 55 + src/IDNA/Factory/ConverterFactory.php | 137 ++ tests/IDNATranslatorTest.php | 79 +- 13 files changed, 391 insertions(+), 2114 deletions(-) create mode 100644 .github/linters/phpstan.neon delete mode 100644 composer.lock delete mode 100644 lib/IDNATranslator.php create mode 100644 reports/logging/logfile.xml create mode 100644 reports/logging/testdox.html create mode 100644 reports/logging/testdox.txt create mode 100644 src/IDNA/Converter/ASCIIConverter.php create mode 100644 src/IDNA/Converter/ConversionInterface.php create mode 100644 src/IDNA/Converter/UnicodeConverter.php create mode 100644 src/IDNA/Factory/ConverterFactory.php diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 6df74d7..d1f215f 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -1,6 +1,5 @@ version: 2 updates: -#PHP PROJECT - package-ecosystem: "composer" directory: "/" schedule: @@ -9,3 +8,11 @@ updates: prefix: "fix" prefix-development: "chore" include: "scope" + - package-ecosystem: "npm" + directory: "/" + schedule: + interval: "daily" + commit-message: + prefix: "fix" + prefix-development: "chore" + include: "scope" \ No newline at end of file diff --git a/.github/linters/phpstan.neon b/.github/linters/phpstan.neon new file mode 100644 index 0000000..e2c06e1 --- /dev/null +++ b/.github/linters/phpstan.neon @@ -0,0 +1,6 @@ +parameters: + level: 5 + paths: + - src + bootstrapFiles: + - ../../vendor/autoload.php \ No newline at end of file diff --git a/.releaserc.json b/.releaserc.json index 0406a96..68f05a0 100644 --- a/.releaserc.json +++ b/.releaserc.json @@ -20,7 +20,6 @@ "assets": [ "HISTORY.md", "@(package?(-lock)|composer).json", - "docs", "report", "src" ] diff --git a/composer.lock b/composer.lock deleted file mode 100644 index 5a48244..0000000 --- a/composer.lock +++ /dev/null @@ -1,1837 +0,0 @@ -{ - "_readme": [ - "This file locks the dependencies of your project to a known state", - "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", - "This file is @generated automatically" - ], - "content-hash": "905b474c24780fa29661bf7332d75dfe", - "packages": [], - "packages-dev": [ - { - "name": "doctrine/instantiator", - "version": "1.5.0", - "source": { - "type": "git", - "url": "https://github.com/doctrine/instantiator.git", - "reference": "0a0fa9780f5d4e507415a065172d26a98d02047b" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/doctrine/instantiator/zipball/0a0fa9780f5d4e507415a065172d26a98d02047b", - "reference": "0a0fa9780f5d4e507415a065172d26a98d02047b", - "shasum": "" - }, - "require": { - "php": "^7.1 || ^8.0" - }, - "require-dev": { - "doctrine/coding-standard": "^9 || ^11", - "ext-pdo": "*", - "ext-phar": "*", - "phpbench/phpbench": "^0.16 || ^1", - "phpstan/phpstan": "^1.4", - "phpstan/phpstan-phpunit": "^1", - "phpunit/phpunit": "^7.5 || ^8.5 || ^9.5", - "vimeo/psalm": "^4.30 || ^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/1.5.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:15:36+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": "v4.19.1", - "source": { - "type": "git", - "url": "https://github.com/nikic/PHP-Parser.git", - "reference": "4e1b88d21c69391150ace211e9eaf05810858d0b" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/4e1b88d21c69391150ace211e9eaf05810858d0b", - "reference": "4e1b88d21c69391150ace211e9eaf05810858d0b", - "shasum": "" - }, - "require": { - "ext-tokenizer": "*", - "php": ">=7.1" - }, - "require-dev": { - "ircmaxell/php-yacc": "^0.0.7", - "phpunit/phpunit": "^6.5 || ^7.0 || ^8.0 || ^9.0" - }, - "bin": [ - "bin/php-parse" - ], - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "4.9-dev" - } - }, - "autoload": { - "psr-4": { - "PhpParser\\": "lib/PhpParser" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Nikita Popov" - } - ], - "description": "A PHP parser written in PHP", - "keywords": [ - "parser", - "php" - ], - "support": { - "issues": "https://github.com/nikic/PHP-Parser/issues", - "source": "https://github.com/nikic/PHP-Parser/tree/v4.19.1" - }, - "time": "2024-03-17T08:10:35+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/" - ] - }, - "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": "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": "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": "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": [], - "minimum-stability": "stable", - "stability-flags": [], - "prefer-stable": true, - "prefer-lowest": false, - "platform": [], - "platform-dev": [], - "plugin-api-version": "2.3.0" -} diff --git a/lib/IDNATranslator.php b/lib/IDNATranslator.php deleted file mode 100644 index 77e7044..0000000 --- a/lib/IDNATranslator.php +++ /dev/null @@ -1,240 +0,0 @@ - true])); //convert to unicode then try again - } - return $domain; // If not, return the original domain - } - - // Split domain into Second-Level Domain (SLD) and Top-Level Domain (TLD) - list($sld, $tld) = explode(".", trim($domain), 2); - - // Check if both SLD and TLD are already in neither IDN nor Punycode format - if (!self::isUnicode($sld) && !self::isASCII($sld) && !self::isUnicode($tld) && !self::isASCII($tld)) { - return $domain; // If so, return the original domain - } - - $transitionalProcessing = self::isNonTransitionalTld($tld, $options); - - // Convert both SLD and TLD to IDN and Punycode formats - $convertDomain["IDN"] = self::convertToUnicode($sld, $transitionalProcessing) . "." . self::convertToUnicode($tld, $transitionalProcessing); - $convertDomain["PUNYCODE"] = self::convertToASCII($sld, $transitionalProcessing) . "." . self::convertToASCII($tld, $transitionalProcessing); - - return $convertDomain; // Return the array containing both IDN and Punycode variants - } - - /** - * Get the Unicode variant of the domain name. - * - * @param string $domain Domain name - * @return string Returns the IDN variant of the domain name. - */ - public static function toUnicode($domain, $options = []) - { - if (empty($domain)) { - return false; - } - - // Check if a dot exists in the domain - if (strpos($domain, '.') === false) { - // if dot does not found check if the dot is a unicode character and retry again - if (!isset($options["retry"])) { - return self::toUnicode(self::convertToUnicode($domain, $options["transitionalProcessing"] ?? false), array_merge($options, ["retry" => true])); //convert to unicode then try again - } - return $domain; // If not, return the original domain - } - - // Split domain into Second-Level Domain (SLD) and Top-Level Domain (TLD) - list($sld, $tld) = explode(".", trim($domain), 2); - - // Convert either SLD or TLD (whichever is in ASCII format) to Unicode - $sld = self::convertToUnicode($sld, $options); - $tld = self::convertToUnicode($tld, $options); - - // Return the domain in IDN format - return $sld . "." . $tld; - } - - - /** - * Get the ASCII variant of the domain name. - * - * @param string $domain Domain name - * @param array $options Additional options for the conversion process - * @return string Returns the IDN variant of the domain name. - */ - public static function toASCII($domain, $options = []) - { - if (empty($domain)) { - return false; - } - - // Check if a dot exists in the domain - if (strpos($domain, '.') === false) { - // if dot does not found check if the dot is a unicode character and retry again - if (!isset($options["retry"])) { - return self::toASCII(self::convertToUnicode($domain, $options["transitionalProcessing"] ?? false), array_merge($options, ["retry" => true])); //convert to unicode then try again - } - return $domain; // If not, return the original domain - } - - // Split domain into Second-Level Domain (SLD) and Top-Level Domain (TLD) - list($sld, $tld) = explode(".", trim($domain), 2); - - // Check if neither SLD nor TLD are in Unicode format - if (!self::isUnicode($sld) && !self::isUnicode($tld) && !isset($options["transitionalProcessing"])) { - return strtolower($domain); // If so, return the original domain - } - - $transitionalProcessing = self::isNonTransitionalTld($tld, $options); - - // Convert either SLD or TLD (whichever is in Punycode format) to IDN - $sld = self::convertToASCII($sld, $transitionalProcessing); - $tld = self::convertToASCII($tld, $transitionalProcessing); - - // Return the domain in IDN format - return $sld . "." . $tld; - } - - /** - * Check if the keyword is in ASCII format. - * - * @param string $keyword The keyword to check - * @return bool True if the keyword is in Punycode format, false otherwise - */ - public static function isASCII($keyword) - { - return preg_match('/^xn--/', $keyword) === 1; // Check if keyword starts with "xn--" - } - - /** - * Check if the keyword is in Unicode format. - * - * @param string $keyword The keyword to check - * @return bool True if the keyword is in IDN format, false otherwise - */ - public static function isUnicode($keyword) - { - return preg_match('/[^\x00-\x7F]/', self::decodeUnicode($keyword)) !== 0; // Check if keyword contains non-ASCII characters - } - - /** - * Convert domain names to Unicode + ASCII if necessary - * @param array $domains Array of domain names (or TLDs) - * @param bool $returnIDNOnly Optional flag to return only IDN variants - * @return array|string Array of converted domains (IDN and Punycode) or IDN variant only - */ - private static function convertBulk(array $domains) - { - if (empty($domains)) { - return false; - } - - $convertedDomains = []; - - foreach ($domains as $domain) { - $convertedDomain = self::convert($domain); - $convertedDomains[$domain] = $convertedDomain; - } - - return $convertedDomains; - } - - /** - * Convert the keyword to ASCII format. - * - * @param string $keyword The keyword to convert - * @return string Returns the Punycode representation of the keyword - */ - private static function convertToASCII($keyword, $transitionalProcessing) - { - // Convert domain to Punycode - $punycode = idn_to_ascii( - self::decodeUnicode($keyword), - $transitionalProcessing ? IDNA_NONTRANSITIONAL_TO_ASCII : IDNA_DEFAULT, - INTL_IDNA_VARIANT_UTS46 - ); - if ($punycode !== false) { - return $punycode; // If successful, return the Punycode representation - } - return $keyword; // If conversion fails, return the original keyword - } - - /** - * Convert the keyword to Unicode format. - * - * @param string $keyword The keyword to convert - * @return string Returns the IDN representation of the keyword - */ - private static function convertToUnicode($keyword, $transitionalProcessing = false) - { - // Convert Punycode (ASCII) back to IDN (Unicode) - $idn = idn_to_utf8( - self::decodeUnicode($keyword), - $transitionalProcessing ? IDNA_NONTRANSITIONAL_TO_UNICODE : IDNA_DEFAULT, - INTL_IDNA_VARIANT_UTS46 - ); - if ($idn !== false) { - return $idn; // If successful, return the IDN representation - } - return $keyword; // If conversion fails, return the original keyword - } - - /** - * Check if the provided top-level domain (TLD) is non-transitional. - * - * @param string $tld The top-level domain (TLD) to check. - * @param array $options Additional options for the conversion process - * @return bool Returns true if the TLD is non-transitional, false otherwise. - */ - private static function isNonTransitionalTld($tld, $options = []) - { - if (isset($options["transitionalProcessing"])) { - return $options["transitionalProcessing"]; - } - - // Regular expression to match non-transitional TLDs - // Case-insensitive matching enabled with the "i" modifier - return (bool)preg_match("/(be|ca|de|fr|pm|re|swiss|tf|wf|yt)\.?$/i", $tld); - } - - /** - * Convert Unicode escape sequences to their corresponding characters. - * - * @param string $unicodeString String with Unicode escape sequences - * @return string Converted string with actual Unicode characters - */ - private static function decodeUnicode($unicodeString) - { - // Decode Unicode escape sequences - return mb_strtolower(json_decode('"' . $unicodeString . '"', true, 512, JSON_UNESCAPED_UNICODE)); - } -} diff --git a/reports/logging/logfile.xml b/reports/logging/logfile.xml new file mode 100644 index 0000000..5db31b0 --- /dev/null +++ b/reports/logging/logfile.xml @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + diff --git a/reports/logging/testdox.html b/reports/logging/testdox.html new file mode 100644 index 0000000..8428c4c --- /dev/null +++ b/reports/logging/testdox.html @@ -0,0 +1,65 @@ + + + + + Test Documentation + + + +

IDNATranslator (CNIC\IDNA\Tests\IDNATranslator)

+ + + \ No newline at end of file diff --git a/reports/logging/testdox.txt b/reports/logging/testdox.txt new file mode 100644 index 0000000..ff8fc95 --- /dev/null +++ b/reports/logging/testdox.txt @@ -0,0 +1,9 @@ +IDNATranslator (CNIC\IDNA\Tests\IDNATranslator) + [x] Convert + [x] Convert bulk + [x] Idn to punycode conversion + [x] To a s c i i + [x] To a s c i i with transitional + [x] To a s c i i without transitional + [x] To unicode + diff --git a/src/IDNA/Converter/ASCIIConverter.php b/src/IDNA/Converter/ASCIIConverter.php new file mode 100644 index 0000000..72773f3 --- /dev/null +++ b/src/IDNA/Converter/ASCIIConverter.php @@ -0,0 +1,42 @@ + $keyword) { + $translatedKeywords[$idx]["IDN"] = self::toUnicode($keyword, $options); + $translatedKeywords[$idx]["PUNYCODE"] = self::toASCII($keyword, $options); + } + + return $translatedKeywords; + } + + $translatedKeyword["IDN"] = self::toUnicode($keywords, $options); + $translatedKeyword["PUNYCODE"] = self::toASCII($keywords, $options); + + return $translatedKeyword; + } + + /** + * Convert a domain string to Unicode format. + * + * @param string $keyword The domain string to convert. + * @param array $options Additional options for the conversion process. + * @return string|false Returns the converted domain in Unicode format or false if the keyword is empty. + */ + public static function toUnicode($keyword, $options = []) + { + if (empty($keyword)) { + return false; + } + + if (mb_strpos($keyword, '.') === false) { + return self::handleConversion($keyword, $options, 'toUnicode'); + } else { + $domainArray = explode(".", trim($keyword)); + $options["domain"] = $keyword; + foreach ($domainArray as &$tmpKeyword) { + if (ASCIIConverter::check($tmpKeyword) || UnicodeConverter::check($tmpKeyword)) { + $tmpKeyword = UnicodeConverter::convert($tmpKeyword, $options); + } + } + + return implode(".", $domainArray); + } + } + + /** + * Convert a domain string to Punycode format. + * + * @param string $keyword The domain string to convert. + * @param array $options Additional options for the conversion process. + * @return string|false Returns the converted domain in Punycode format or false if the keyword is empty. + */ + public static function toASCII($keyword, $options = []) + { + if (empty($keyword)) { + return false; + } + + if (mb_strpos($keyword, '.') === false) { + return self::handleConversion($keyword, $options, 'toASCII'); + } else { + $domainArray = explode(".", trim($keyword)); + $options["domain"] = $keyword; + foreach ($domainArray as &$tmpKeyword) { + $tmpKeyword = UnicodeConverter::decode($tmpKeyword); + if (UnicodeConverter::check($tmpKeyword)) { + $tmpKeyword = ASCIIConverter::convert($tmpKeyword, $options); + } + } + + return implode(".", $domainArray); + } + } + + /** + * Handle conversion of a keyword between Unicode and Punycode formats. + * + * @param string $keyword The domain string to convert. + * @param array $options Additional options for the conversion process. + * @param string $method The conversion method to use. + * @return string Returns the converted domain string. + */ + private static function handleConversion($keyword, $options, $method) + { + if (!isset($options["retry"]) && UnicodeConverter::check($keyword)) { + $tmpKeyword = UnicodeConverter::convert($keyword, $options); + if (mb_strpos($tmpKeyword, '.') !== false) { + return self::$method($tmpKeyword, array_merge($options, ["retry" => true])); + } + } + + if (ASCIIConverter::check($keyword) || UnicodeConverter::check($keyword)) { + return UnicodeConverter::convert($keyword, $options); + } + + return $keyword; + } + + /** + * Check if the provided top-level domain (TLD) is non-transitional. + * + * @param string $keyword The domain string to check. + * @param array $options Additional options for the conversion process. + * @return bool Returns true if the TLD is non-transitional, false otherwise. + */ + public static function transitionalProcessing($keyword, $options = []) + { + if (isset($options["transitionalProcessing"])) { + return $options["transitionalProcessing"]; + } + + return mb_ereg("\./(be|ca|de|fr|pm|re|swiss|tf|wf|yt)\.?$/i", $options["domain"] ?? $keyword) !== false; + } +} diff --git a/tests/IDNATranslatorTest.php b/tests/IDNATranslatorTest.php index 9f9fad0..12f8759 100644 --- a/tests/IDNATranslatorTest.php +++ b/tests/IDNATranslatorTest.php @@ -3,14 +3,14 @@ namespace CNIC\IDNA\Tests; use PHPUnit\Framework\TestCase; -use CNIC\IDNA\IDNATranslator; +use CNIC\IDNA\Factory\ConverterFactory; class IDNATranslatorTest extends TestCase { private static $data = [ 'convert' => [ 'öbb.at' => 'xn--bb-eka.at', - 'faß.de' => 'xn--fa-hia.de', + 'faß.de' => 'fass.de', ], 'toAscii' => [ '' => '', @@ -69,13 +69,26 @@ class IDNATranslatorTest extends TestCase ], 'toUnicode' => [ 'öbb.at' => 'öbb.at', + 'Öbb.at' => 'öbb.at', + 'ÖBB.at' => 'öbb.at', + 'O\u0308bb.at' => 'öbb.at', 'xn--bb-eka.at' => 'öbb.at', 'faß.de' => 'faß.de', 'fass.de' => 'fass.de', 'xn--fa-hia.de' => 'faß.de', + 'not=std3' => 'not=std3', + '\ud83d\udca9' => '💩', + '\ud87e\udcca' => '𣀊', + '\udb40\udd00\ud87e\udcca' => '𣀊', + //'\ud83d\udca9' => '\ud83d\udca9', + //'\ud87e\udcca' => '\ud84c\udc0a', + //'\udb40\udd00\ud87e\udcca' => '\ud84c\udc0a', 'fäß.de' => 'fäß.de', '₹.com' => '₹.com', '𑀓.com' => '𑀓.com', + //'a‌b' => 'a\u200Cb', + 'a‌b' => 'a‌b', + 'xn--ab-j1t' => 'a‌b', 'ȡog.de' => 'ȡog.de', '☕.de' => '☕.de', 'I♥NY.de' => 'i♥ny.de', @@ -95,16 +108,16 @@ class IDNATranslatorTest extends TestCase public function testConvert() { - $result = IDNATranslator::convert('münchen.de'); + $result = ConverterFactory::convert('münchen.de'); $this->assertEquals(['IDN' => 'münchen.de', 'PUNYCODE' => 'xn--mnchen-3ya.de'], $result); - $result = IDNATranslator::convert('xn--mnchen-3ya.de'); + $result = ConverterFactory::convert('xn--mnchen-3ya.de'); $this->assertEquals(['IDN' => 'münchen.de', 'PUNYCODE' => 'xn--mnchen-3ya.de'], $result); - $result = IDNATranslator::convert('🌐.ws'); + $result = ConverterFactory::convert('🌐.ws'); $this->assertEquals(['IDN' => '🌐.ws', 'PUNYCODE' => 'xn--wg8h.ws'], $result); - $result = IDNATranslator::convert('xn--wg8h.ws'); + $result = ConverterFactory::convert('xn--wg8h.ws'); $this->assertEquals(['IDN' => '🌐.ws', 'PUNYCODE' => 'xn--wg8h.ws'], $result); } @@ -123,34 +136,24 @@ public function testConvertBulk() ]; // Call the convertBulk method - $convertedDomains = IDNATranslator::convert($domains); - - // Check if the returned array has the correct keys - $this->assertArrayHasKey('münchen.de', $convertedDomains); - $this->assertArrayHasKey('xn--mnchen-3ya.de', $convertedDomains); - $this->assertArrayHasKey('🌐.ws', $convertedDomains); - $this->assertArrayHasKey('xn--wg8h.ws', $convertedDomains); - $this->assertArrayHasKey('😊.com', $convertedDomains); - $this->assertArrayHasKey('xn--o28h.com', $convertedDomains); - $this->assertArrayHasKey('🎉.net', $convertedDomains); - $this->assertArrayHasKey('xn--dk8h.net', $convertedDomains); + $convertedDomains = ConverterFactory::convert($domains); // Check if the converted domains have the correct values - $this->assertEquals(['IDN' => 'münchen.de', 'PUNYCODE' => 'xn--mnchen-3ya.de'], $convertedDomains['münchen.de']); - $this->assertEquals(['IDN' => 'münchen.de', 'PUNYCODE' => 'xn--mnchen-3ya.de'], $convertedDomains['xn--mnchen-3ya.de']); - $this->assertEquals(['IDN' => '🌐.ws', 'PUNYCODE' => 'xn--wg8h.ws'], $convertedDomains['🌐.ws']); - $this->assertEquals(['IDN' => '🌐.ws', 'PUNYCODE' => 'xn--wg8h.ws'], $convertedDomains['xn--wg8h.ws']); - $this->assertEquals(['IDN' => '😊.com', 'PUNYCODE' => 'xn--o28h.com'], $convertedDomains['😊.com']); - $this->assertEquals(['IDN' => '😊.com', 'PUNYCODE' => 'xn--o28h.com'], $convertedDomains['xn--o28h.com']); - $this->assertEquals(['IDN' => '🎉.net', 'PUNYCODE' => 'xn--dk8h.net'], $convertedDomains['🎉.net']); - $this->assertEquals(['IDN' => '🎉.net', 'PUNYCODE' => 'xn--dk8h.net'], $convertedDomains['xn--dk8h.net']); + $this->assertEquals(['IDN' => 'münchen.de', 'PUNYCODE' => 'xn--mnchen-3ya.de'], $convertedDomains[0]); + $this->assertEquals(['IDN' => 'münchen.de', 'PUNYCODE' => 'xn--mnchen-3ya.de'], $convertedDomains[1]); + $this->assertEquals(['IDN' => '🌐.ws', 'PUNYCODE' => 'xn--wg8h.ws'], $convertedDomains[2]); + $this->assertEquals(['IDN' => '🌐.ws', 'PUNYCODE' => 'xn--wg8h.ws'], $convertedDomains[3]); + $this->assertEquals(['IDN' => '😊.com', 'PUNYCODE' => 'xn--o28h.com'], $convertedDomains[4]); + $this->assertEquals(['IDN' => '😊.com', 'PUNYCODE' => 'xn--o28h.com'], $convertedDomains[5]); + $this->assertEquals(['IDN' => '🎉.net', 'PUNYCODE' => 'xn--dk8h.net'], $convertedDomains[6]); + $this->assertEquals(['IDN' => '🎉.net', 'PUNYCODE' => 'xn--dk8h.net'], $convertedDomains[7]); } // Test cases for conversion from IDN to Punycode public function testIdnToPunycodeConversion() { foreach (self::$data['convert'] as $idn => $punycode) { - $this->assertEquals($punycode, IDNATranslator::convert($idn)['PUNYCODE']); + $this->assertEquals($punycode, ConverterFactory::convert($idn)['PUNYCODE']); } } @@ -158,7 +161,7 @@ public function testIdnToPunycodeConversion() public function testToASCII() { foreach (self::$data['toAscii'] as $input => $output) { - $this->assertEquals($output, IDNATranslator::toASCII( + $this->assertEquals($output, ConverterFactory::toASCII( $input, ["transitionalProcessing" => true] )); @@ -166,14 +169,14 @@ public function testToASCII() } // Test cases for converting Transitional domain names to Punycode - public function testToASCIIAlwaysWithTransitional() + public function testToASCIIWithTransitional() { foreach (self::$data['toAsciiWithTransitional'] as $input => $output) { - $withTransition = IDNATranslator::toASCII( + $withTransition = ConverterFactory::toASCII( $input, ["transitionalProcessing" => true] ); - $withoutTransition = IDNATranslator::toASCII( + $withoutTransition = ConverterFactory::toASCII( $input, ["transitionalProcessing" => false] ); @@ -186,21 +189,23 @@ public function testToASCIIAlwaysWithTransitional() } // Test cases for converting Transitional domain names to Punycode - public function testToASCIIAlwaysWithoutTransitional() + public function testToASCIIWithoutTransitional() { foreach (self::$data['toAsciiWithoutTransitional'] as $input => $output) { - $withTransition = IDNATranslator::toASCII( + $withTransition = ConverterFactory::toASCII( $input, ["transitionalProcessing" => true] ); - $withoutTransition = IDNATranslator::toASCII( + $withoutTransition = ConverterFactory::toASCII( $input, ["transitionalProcessing" => false] ); $this->assertEquals( $output, $withoutTransition, - "\nInput: {$input}\nWith transition: " . $withTransition . "\nWithout transition: " . $withoutTransition + "\nInput: {$input} + \nWith transition: " . $withTransition . " + \nWithout transition: " . $withoutTransition ); } } @@ -209,7 +214,11 @@ public function testToASCIIAlwaysWithoutTransitional() public function testToUnicode() { foreach (self::$data['toUnicode'] as $input => $output) { - $this->assertEquals($output, IDNATranslator::toUnicode($input, ["transitionalProcessing" => true]), "{$input} : {$output}"); + $this->assertEquals( + $output, + ConverterFactory::toUnicode($input, ["transitionalProcessing" => true]), + "{$input} : {$output}" + ); } } }