diff --git a/.gitattributes b/.gitattributes index 9f444a4..ded5770 100755 --- a/.gitattributes +++ b/.gitattributes @@ -1 +1,4 @@ -tests/ export-ignore \ No newline at end of file +tests/ export-ignore +.gitattributes export-ignore +.gitignore export-ignore +.php-cs-fixer.dist.php export-ignore \ No newline at end of file diff --git a/.php-cs-fixer.dist.php b/.php-cs-fixer.dist.php new file mode 100644 index 0000000..efecb57 --- /dev/null +++ b/.php-cs-fixer.dist.php @@ -0,0 +1,10 @@ +getFinder()->in(__DIR__); + +return $config; diff --git a/composer.json b/composer.json index 86690c3..199f2bd 100755 --- a/composer.json +++ b/composer.json @@ -20,6 +20,13 @@ } }, "require-dev": { + "friendsofphp/php-cs-fixer": "^3.59", + "fyre/php-cs-fixer-config": "^1.0", "phpunit/phpunit": "^10" + }, + "scripts": { + "cs": "php-cs-fixer fix --ansi --verbose --dry-run --diff", + "cs-fix": "php-cs-fixer fix --ansi --verbose --diff", + "test": "phpunit tests" } } \ No newline at end of file diff --git a/composer.lock b/composer.lock index bcf1193..e42334b 100644 --- a/composer.lock +++ b/composer.lock @@ -4,410 +4,879 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "4c5308dcb0efadeef9db7c7e025e741a", + "content-hash": "7bcce460a11daaaeec485a24a7643be6", "packages": [], "packages-dev": [ { - "name": "myclabs/deep-copy", - "version": "1.11.1", + "name": "clue/ndjson-react", + "version": "v1.3.0", "source": { "type": "git", - "url": "https://github.com/myclabs/DeepCopy.git", - "reference": "7284c22080590fb39f2ffa3e9057f10a4ddd0e0c" + "url": "https://github.com/clue/reactphp-ndjson.git", + "reference": "392dc165fce93b5bb5c637b67e59619223c931b0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/7284c22080590fb39f2ffa3e9057f10a4ddd0e0c", - "reference": "7284c22080590fb39f2ffa3e9057f10a4ddd0e0c", + "url": "https://api.github.com/repos/clue/reactphp-ndjson/zipball/392dc165fce93b5bb5c637b67e59619223c931b0", + "reference": "392dc165fce93b5bb5c637b67e59619223c931b0", "shasum": "" }, "require": { - "php": "^7.1 || ^8.0" - }, - "conflict": { - "doctrine/collections": "<1.6.8", - "doctrine/common": "<2.13.3 || >=3,<3.2.2" + "php": ">=5.3", + "react/stream": "^1.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" + "phpunit/phpunit": "^9.5 || ^5.7 || ^4.8.35", + "react/event-loop": "^1.2" }, "type": "library", "autoload": { - "files": [ - "src/DeepCopy/deep_copy.php" - ], "psr-4": { - "DeepCopy\\": "src/DeepCopy/" + "Clue\\React\\NDJson\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], - "description": "Create deep copies (clones) of your objects", + "authors": [ + { + "name": "Christian Lück", + "email": "christian@clue.engineering" + } + ], + "description": "Streaming newline-delimited JSON (NDJSON) parser and encoder for ReactPHP.", + "homepage": "https://github.com/clue/reactphp-ndjson", "keywords": [ - "clone", - "copy", - "duplicate", - "object", - "object graph" + "NDJSON", + "json", + "jsonlines", + "newline", + "reactphp", + "streaming" ], "support": { - "issues": "https://github.com/myclabs/DeepCopy/issues", - "source": "https://github.com/myclabs/DeepCopy/tree/1.11.1" + "issues": "https://github.com/clue/reactphp-ndjson/issues", + "source": "https://github.com/clue/reactphp-ndjson/tree/v1.3.0" }, "funding": [ { - "url": "https://tidelift.com/funding/github/packagist/myclabs/deep-copy", - "type": "tidelift" + "url": "https://clue.engineering/support", + "type": "custom" + }, + { + "url": "https://github.com/clue", + "type": "github" } ], - "time": "2023-03-08T13:26:56+00:00" + "time": "2022-12-23T10:58:28+00:00" }, { - "name": "nikic/php-parser", - "version": "v5.0.2", + "name": "composer/pcre", + "version": "3.1.4", "source": { "type": "git", - "url": "https://github.com/nikic/PHP-Parser.git", - "reference": "139676794dc1e9231bf7bcd123cfc0c99182cb13" + "url": "https://github.com/composer/pcre.git", + "reference": "04229f163664973f68f38f6f73d917799168ef24" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/139676794dc1e9231bf7bcd123cfc0c99182cb13", - "reference": "139676794dc1e9231bf7bcd123cfc0c99182cb13", + "url": "https://api.github.com/repos/composer/pcre/zipball/04229f163664973f68f38f6f73d917799168ef24", + "reference": "04229f163664973f68f38f6f73d917799168ef24", "shasum": "" }, "require": { - "ext-ctype": "*", - "ext-json": "*", - "ext-tokenizer": "*", - "php": ">=7.4" + "php": "^7.4 || ^8.0" }, "require-dev": { - "ircmaxell/php-yacc": "^0.0.7", - "phpunit/phpunit": "^7.0 || ^8.0 || ^9.0" + "phpstan/phpstan": "^1.3", + "phpstan/phpstan-strict-rules": "^1.1", + "symfony/phpunit-bridge": "^5" }, - "bin": [ - "bin/php-parse" - ], "type": "library", "extra": { "branch-alias": { - "dev-master": "5.0-dev" + "dev-main": "3.x-dev" } }, "autoload": { "psr-4": { - "PhpParser\\": "lib/PhpParser" + "Composer\\Pcre\\": "src" } }, "notification-url": "https://packagist.org/downloads/", "license": [ - "BSD-3-Clause" + "MIT" ], "authors": [ { - "name": "Nikita Popov" + "name": "Jordi Boggiano", + "email": "j.boggiano@seld.be", + "homepage": "http://seld.be" } ], - "description": "A PHP parser written in PHP", + "description": "PCRE wrapping library that offers type-safe preg_* replacements.", "keywords": [ - "parser", - "php" + "PCRE", + "preg", + "regex", + "regular expression" ], "support": { - "issues": "https://github.com/nikic/PHP-Parser/issues", - "source": "https://github.com/nikic/PHP-Parser/tree/v5.0.2" + "issues": "https://github.com/composer/pcre/issues", + "source": "https://github.com/composer/pcre/tree/3.1.4" }, - "time": "2024-03-05T20:51:40+00:00" + "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-05-27T13:40:54+00:00" }, { - "name": "phar-io/manifest", - "version": "2.0.4", + "name": "composer/semver", + "version": "3.4.0", "source": { "type": "git", - "url": "https://github.com/phar-io/manifest.git", - "reference": "54750ef60c58e43759730615a392c31c80e23176" + "url": "https://github.com/composer/semver.git", + "reference": "35e8d0af4486141bc745f23a29cc2091eb624a32" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phar-io/manifest/zipball/54750ef60c58e43759730615a392c31c80e23176", - "reference": "54750ef60c58e43759730615a392c31c80e23176", + "url": "https://api.github.com/repos/composer/semver/zipball/35e8d0af4486141bc745f23a29cc2091eb624a32", + "reference": "35e8d0af4486141bc745f23a29cc2091eb624a32", "shasum": "" }, "require": { - "ext-dom": "*", - "ext-libxml": "*", - "ext-phar": "*", - "ext-xmlwriter": "*", - "phar-io/version": "^3.0.1", - "php": "^7.2 || ^8.0" + "php": "^5.3.2 || ^7.0 || ^8.0" + }, + "require-dev": { + "phpstan/phpstan": "^1.4", + "symfony/phpunit-bridge": "^4.2 || ^5" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.0.x-dev" + "dev-main": "3.x-dev" } }, "autoload": { - "classmap": [ - "src/" - ] + "psr-4": { + "Composer\\Semver\\": "src" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ - "BSD-3-Clause" + "MIT" ], "authors": [ { - "name": "Arne Blankerts", - "email": "arne@blankerts.de", - "role": "Developer" + "name": "Nils Adermann", + "email": "naderman@naderman.de", + "homepage": "http://www.naderman.de" }, { - "name": "Sebastian Heuer", - "email": "sebastian@phpeople.de", - "role": "Developer" + "name": "Jordi Boggiano", + "email": "j.boggiano@seld.be", + "homepage": "http://seld.be" }, { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "Developer" + "name": "Rob Bast", + "email": "rob.bast@gmail.com", + "homepage": "http://robbast.nl" } ], - "description": "Component for reading phar.io manifest information from a PHP Archive (PHAR)", + "description": "Semver library that offers utilities, version constraint parsing and validation.", + "keywords": [ + "semantic", + "semver", + "validation", + "versioning" + ], "support": { - "issues": "https://github.com/phar-io/manifest/issues", - "source": "https://github.com/phar-io/manifest/tree/2.0.4" + "irc": "ircs://irc.libera.chat:6697/composer", + "issues": "https://github.com/composer/semver/issues", + "source": "https://github.com/composer/semver/tree/3.4.0" }, "funding": [ { - "url": "https://github.com/theseer", + "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-03T12:33:53+00:00" + "time": "2023-08-31T09:50:34+00:00" }, { - "name": "phar-io/version", - "version": "3.2.1", + "name": "composer/xdebug-handler", + "version": "3.0.5", "source": { "type": "git", - "url": "https://github.com/phar-io/version.git", - "reference": "4f7fd7836c6f332bb2933569e566a0d6c4cbed74" + "url": "https://github.com/composer/xdebug-handler.git", + "reference": "6c1925561632e83d60a44492e0b344cf48ab85ef" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phar-io/version/zipball/4f7fd7836c6f332bb2933569e566a0d6c4cbed74", - "reference": "4f7fd7836c6f332bb2933569e566a0d6c4cbed74", + "url": "https://api.github.com/repos/composer/xdebug-handler/zipball/6c1925561632e83d60a44492e0b344cf48ab85ef", + "reference": "6c1925561632e83d60a44492e0b344cf48ab85ef", "shasum": "" }, "require": { - "php": "^7.2 || ^8.0" + "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", + "phpunit/phpunit": "^8.5 || ^9.6 || ^10.5" }, "type": "library", "autoload": { - "classmap": [ - "src/" - ] + "psr-4": { + "Composer\\XdebugHandler\\": "src" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ - "BSD-3-Clause" + "MIT" ], "authors": [ { - "name": "Arne Blankerts", - "email": "arne@blankerts.de", - "role": "Developer" + "name": "John Stevenson", + "email": "john-stevenson@blueyonder.co.uk" + } + ], + "description": "Restarts a process without Xdebug.", + "keywords": [ + "Xdebug", + "performance" + ], + "support": { + "irc": "ircs://irc.libera.chat:6697/composer", + "issues": "https://github.com/composer/xdebug-handler/issues", + "source": "https://github.com/composer/xdebug-handler/tree/3.0.5" + }, + "funding": [ + { + "url": "https://packagist.com", + "type": "custom" }, { - "name": "Sebastian Heuer", - "email": "sebastian@phpeople.de", - "role": "Developer" + "url": "https://github.com/composer", + "type": "github" }, { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "Developer" + "url": "https://tidelift.com/funding/github/packagist/composer/composer", + "type": "tidelift" } ], - "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" + "time": "2024-05-06T16:37:16+00:00" }, { - "name": "phpunit/php-code-coverage", - "version": "10.1.14", + "name": "evenement/evenement", + "version": "v3.0.2", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "e3f51450ebffe8e0efdf7346ae966a656f7d5e5b" + "url": "https://github.com/igorw/evenement.git", + "reference": "0a16b0d71ab13284339abb99d9d2bd813640efbc" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/e3f51450ebffe8e0efdf7346ae966a656f7d5e5b", - "reference": "e3f51450ebffe8e0efdf7346ae966a656f7d5e5b", + "url": "https://api.github.com/repos/igorw/evenement/zipball/0a16b0d71ab13284339abb99d9d2bd813640efbc", + "reference": "0a16b0d71ab13284339abb99d9d2bd813640efbc", "shasum": "" }, "require": { - "ext-dom": "*", - "ext-libxml": "*", - "ext-xmlwriter": "*", - "nikic/php-parser": "^4.18 || ^5.0", - "php": ">=8.1", - "phpunit/php-file-iterator": "^4.0", - "phpunit/php-text-template": "^3.0", - "sebastian/code-unit-reverse-lookup": "^3.0", - "sebastian/complexity": "^3.0", - "sebastian/environment": "^6.0", - "sebastian/lines-of-code": "^2.0", - "sebastian/version": "^4.0", - "theseer/tokenizer": "^1.2.0" + "php": ">=7.0" }, "require-dev": { - "phpunit/phpunit": "^10.1" - }, - "suggest": { - "ext-pcov": "PHP extension that provides line coverage", - "ext-xdebug": "PHP extension that provides line coverage as well as branch and path coverage" + "phpunit/phpunit": "^9 || ^6" }, "type": "library", - "extra": { - "branch-alias": { - "dev-main": "10.1-dev" - } - }, "autoload": { - "classmap": [ - "src/" - ] + "psr-4": { + "Evenement\\": "src/" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ - "BSD-3-Clause" + "MIT" ], "authors": [ { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" + "name": "Igor Wiedler", + "email": "igor@wiedler.ch" } ], - "description": "Library that provides collection, processing, and rendering functionality for PHP code coverage information.", - "homepage": "https://github.com/sebastianbergmann/php-code-coverage", + "description": "Événement is a very simple event dispatching library for PHP", "keywords": [ - "coverage", - "testing", - "xunit" + "event-dispatcher", + "event-emitter" ], "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/10.1.14" + "issues": "https://github.com/igorw/evenement/issues", + "source": "https://github.com/igorw/evenement/tree/v3.0.2" }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2024-03-12T15:33:41+00:00" + "time": "2023-08-08T05:53:35+00:00" }, { - "name": "phpunit/php-file-iterator", - "version": "4.1.0", + "name": "fidry/cpu-core-counter", + "version": "1.1.0", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/php-file-iterator.git", - "reference": "a95037b6d9e608ba092da1b23931e537cadc3c3c" + "url": "https://github.com/theofidry/cpu-core-counter.git", + "reference": "f92996c4d5c1a696a6a970e20f7c4216200fcc42" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/a95037b6d9e608ba092da1b23931e537cadc3c3c", - "reference": "a95037b6d9e608ba092da1b23931e537cadc3c3c", + "url": "https://api.github.com/repos/theofidry/cpu-core-counter/zipball/f92996c4d5c1a696a6a970e20f7c4216200fcc42", + "reference": "f92996c4d5c1a696a6a970e20f7c4216200fcc42", "shasum": "" }, "require": { - "php": ">=8.1" + "php": "^7.2 || ^8.0" }, "require-dev": { - "phpunit/phpunit": "^10.0" + "fidry/makefile": "^0.2.0", + "fidry/php-cs-fixer-config": "^1.1.2", + "phpstan/extension-installer": "^1.2.0", + "phpstan/phpstan": "^1.9.2", + "phpstan/phpstan-deprecation-rules": "^1.0.0", + "phpstan/phpstan-phpunit": "^1.2.2", + "phpstan/phpstan-strict-rules": "^1.4.4", + "phpunit/phpunit": "^8.5.31 || ^9.5.26", + "webmozarts/strict-phpunit": "^7.5" }, "type": "library", - "extra": { - "branch-alias": { - "dev-main": "4.0-dev" - } - }, "autoload": { - "classmap": [ - "src/" - ] + "psr-4": { + "Fidry\\CpuCoreCounter\\": "src/" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ - "BSD-3-Clause" + "MIT" ], "authors": [ { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" + "name": "Théo FIDRY", + "email": "theo.fidry@gmail.com" } ], - "description": "FilterIterator implementation that filters files based on a list of suffixes.", - "homepage": "https://github.com/sebastianbergmann/php-file-iterator/", + "description": "Tiny utility to get the number of CPU cores.", "keywords": [ - "filesystem", - "iterator" + "CPU", + "core" ], "support": { - "issues": "https://github.com/sebastianbergmann/php-file-iterator/issues", - "security": "https://github.com/sebastianbergmann/php-file-iterator/security/policy", - "source": "https://github.com/sebastianbergmann/php-file-iterator/tree/4.1.0" + "issues": "https://github.com/theofidry/cpu-core-counter/issues", + "source": "https://github.com/theofidry/cpu-core-counter/tree/1.1.0" }, "funding": [ { - "url": "https://github.com/sebastianbergmann", + "url": "https://github.com/theofidry", "type": "github" } ], - "time": "2023-08-31T06:24:48+00:00" + "time": "2024-02-07T09:43:46+00:00" }, { - "name": "phpunit/php-invoker", - "version": "4.0.0", + "name": "friendsofphp/php-cs-fixer", + "version": "v3.59.3", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/php-invoker.git", - "reference": "f5e568ba02fa5ba0ddd0f618391d5a9ea50b06d7" + "url": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer.git", + "reference": "30ba9ecc2b0e5205e578fe29973c15653d9bfd29" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-invoker/zipball/f5e568ba02fa5ba0ddd0f618391d5a9ea50b06d7", - "reference": "f5e568ba02fa5ba0ddd0f618391d5a9ea50b06d7", + "url": "https://api.github.com/repos/PHP-CS-Fixer/PHP-CS-Fixer/zipball/30ba9ecc2b0e5205e578fe29973c15653d9bfd29", + "reference": "30ba9ecc2b0e5205e578fe29973c15653d9bfd29", "shasum": "" }, "require": { - "php": ">=8.1" + "clue/ndjson-react": "^1.0", + "composer/semver": "^3.4", + "composer/xdebug-handler": "^3.0.3", + "ext-filter": "*", + "ext-json": "*", + "ext-tokenizer": "*", + "fidry/cpu-core-counter": "^1.0", + "php": "^7.4 || ^8.0", + "react/child-process": "^0.6.5", + "react/event-loop": "^1.0", + "react/promise": "^2.0 || ^3.0", + "react/socket": "^1.0", + "react/stream": "^1.0", + "sebastian/diff": "^4.0 || ^5.0 || ^6.0", + "symfony/console": "^5.4 || ^6.0 || ^7.0", + "symfony/event-dispatcher": "^5.4 || ^6.0 || ^7.0", + "symfony/filesystem": "^5.4 || ^6.0 || ^7.0", + "symfony/finder": "^5.4 || ^6.0 || ^7.0", + "symfony/options-resolver": "^5.4 || ^6.0 || ^7.0", + "symfony/polyfill-mbstring": "^1.28", + "symfony/polyfill-php80": "^1.28", + "symfony/polyfill-php81": "^1.28", + "symfony/process": "^5.4 || ^6.0 || ^7.0", + "symfony/stopwatch": "^5.4 || ^6.0 || ^7.0" }, "require-dev": { - "ext-pcntl": "*", - "phpunit/phpunit": "^10.0" + "facile-it/paraunit": "^1.3 || ^2.3", + "infection/infection": "^0.29.5", + "justinrainbow/json-schema": "^5.2", + "keradus/cli-executor": "^2.1", + "mikey179/vfsstream": "^1.6.11", + "php-coveralls/php-coveralls": "^2.7", + "php-cs-fixer/accessible-object": "^1.1", + "php-cs-fixer/phpunit-constraint-isidenticalstring": "^1.5", + "php-cs-fixer/phpunit-constraint-xmlmatchesxsd": "^1.5", + "phpunit/phpunit": "^9.6.19 || ^10.5.21 || ^11.2", + "symfony/var-dumper": "^5.4 || ^6.0 || ^7.0", + "symfony/yaml": "^5.4 || ^6.0 || ^7.0" }, "suggest": { - "ext-pcntl": "*" + "ext-dom": "For handling output formats in XML", + "ext-mbstring": "For handling non-UTF8 characters." }, - "type": "library", - "extra": { - "branch-alias": { + "bin": [ + "php-cs-fixer" + ], + "type": "application", + "autoload": { + "psr-4": { + "PhpCsFixer\\": "src/" + }, + "exclude-from-classmap": [ + "src/Fixer/Internal/*" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Dariusz Rumiński", + "email": "dariusz.ruminski@gmail.com" + } + ], + "description": "A tool to automatically fix PHP code style", + "keywords": [ + "Static code analysis", + "fixer", + "standards", + "static analysis" + ], + "support": { + "issues": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues", + "source": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/tree/v3.59.3" + }, + "funding": [ + { + "url": "https://github.com/keradus", + "type": "github" + } + ], + "time": "2024-06-16T14:17:03+00:00" + }, + { + "name": "fyre/php-cs-fixer-config", + "version": "v1.0.1", + "source": { + "type": "git", + "url": "https://github.com/elusivecodes/PHP-CS-Fixer-Config.git", + "reference": "25ce6254af1772d3936c02af74e62098e1432b01" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/elusivecodes/PHP-CS-Fixer-Config/zipball/25ce6254af1772d3936c02af74e62098e1432b01", + "reference": "25ce6254af1772d3936c02af74e62098e1432b01", + "shasum": "" + }, + "require": { + "friendsofphp/php-cs-fixer": "^3.59" + }, + "type": "library", + "autoload": { + "psr-4": { + "Fyre\\PhpCsFixer\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "elusivecodes", + "email": "elusivecodes@gmail.com" + } + ], + "description": "PHP-CS-Fixer shareable config for the Fyre style.", + "support": { + "issues": "https://github.com/elusivecodes/PHP-CS-Fixer-Config/issues", + "source": "https://github.com/elusivecodes/PHP-CS-Fixer-Config/tree/v1.0.1" + }, + "time": "2024-06-24T03:54:51+00:00" + }, + { + "name": "myclabs/deep-copy", + "version": "1.12.0", + "source": { + "type": "git", + "url": "https://github.com/myclabs/DeepCopy.git", + "reference": "3a6b9a42cd8f8771bd4295d13e1423fa7f3d942c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/3a6b9a42cd8f8771bd4295d13e1423fa7f3d942c", + "reference": "3a6b9a42cd8f8771bd4295d13e1423fa7f3d942c", + "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", + "phpspec/prophecy": "^1.10", + "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.12.0" + }, + "funding": [ + { + "url": "https://tidelift.com/funding/github/packagist/myclabs/deep-copy", + "type": "tidelift" + } + ], + "time": "2024-06-12T14:39:25+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": "*", + "php": ">=7.4" + }, + "require-dev": { + "ircmaxell/php-yacc": "^0.0.7", + "phpunit/phpunit": "^7.0 || ^8.0 || ^9.0" + }, + "bin": [ + "bin/php-parse" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "5.0-dev" + } + }, + "autoload": { + "psr-4": { + "PhpParser\\": "lib/PhpParser" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "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/v5.0.2" + }, + "time": "2024-03-05T20:51:40+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": "10.1.14", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-code-coverage.git", + "reference": "e3f51450ebffe8e0efdf7346ae966a656f7d5e5b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/e3f51450ebffe8e0efdf7346ae966a656f7d5e5b", + "reference": "e3f51450ebffe8e0efdf7346ae966a656f7d5e5b", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-libxml": "*", + "ext-xmlwriter": "*", + "nikic/php-parser": "^4.18 || ^5.0", + "php": ">=8.1", + "phpunit/php-file-iterator": "^4.0", + "phpunit/php-text-template": "^3.0", + "sebastian/code-unit-reverse-lookup": "^3.0", + "sebastian/complexity": "^3.0", + "sebastian/environment": "^6.0", + "sebastian/lines-of-code": "^2.0", + "sebastian/version": "^4.0", + "theseer/tokenizer": "^1.2.0" + }, + "require-dev": { + "phpunit/phpunit": "^10.1" + }, + "suggest": { + "ext-pcov": "PHP extension that provides line coverage", + "ext-xdebug": "PHP extension that provides line coverage as well as branch and path coverage" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "10.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": "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/10.1.14" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2024-03-12T15:33:41+00:00" + }, + { + "name": "phpunit/php-file-iterator", + "version": "4.1.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-file-iterator.git", + "reference": "a95037b6d9e608ba092da1b23931e537cadc3c3c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/a95037b6d9e608ba092da1b23931e537cadc3c3c", + "reference": "a95037b6d9e608ba092da1b23931e537cadc3c3c", + "shasum": "" + }, + "require": { + "php": ">=8.1" + }, + "require-dev": { + "phpunit/phpunit": "^10.0" + }, + "type": "library", + "extra": { + "branch-alias": { "dev-main": "4.0-dev" } }, @@ -427,14 +896,1845 @@ "role": "lead" } ], - "description": "Invoke callables with a timeout", - "homepage": "https://github.com/sebastianbergmann/php-invoker/", - "keywords": [ - "process" + "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", + "security": "https://github.com/sebastianbergmann/php-file-iterator/security/policy", + "source": "https://github.com/sebastianbergmann/php-file-iterator/tree/4.1.0" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2023-08-31T06:24:48+00:00" + }, + { + "name": "phpunit/php-invoker", + "version": "4.0.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-invoker.git", + "reference": "f5e568ba02fa5ba0ddd0f618391d5a9ea50b06d7" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-invoker/zipball/f5e568ba02fa5ba0ddd0f618391d5a9ea50b06d7", + "reference": "f5e568ba02fa5ba0ddd0f618391d5a9ea50b06d7", + "shasum": "" + }, + "require": { + "php": ">=8.1" + }, + "require-dev": { + "ext-pcntl": "*", + "phpunit/phpunit": "^10.0" + }, + "suggest": { + "ext-pcntl": "*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "4.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "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/4.0.0" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2023-02-03T06:56:09+00:00" + }, + { + "name": "phpunit/php-text-template", + "version": "3.0.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-text-template.git", + "reference": "0c7b06ff49e3d5072f057eb1fa59258bf287a748" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/0c7b06ff49e3d5072f057eb1fa59258bf287a748", + "reference": "0c7b06ff49e3d5072f057eb1fa59258bf287a748", + "shasum": "" + }, + "require": { + "php": ">=8.1" + }, + "require-dev": { + "phpunit/phpunit": "^10.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "3.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Simple template engine.", + "homepage": "https://github.com/sebastianbergmann/php-text-template/", + "keywords": [ + "template" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/php-text-template/issues", + "security": "https://github.com/sebastianbergmann/php-text-template/security/policy", + "source": "https://github.com/sebastianbergmann/php-text-template/tree/3.0.1" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2023-08-31T14:07:24+00:00" + }, + { + "name": "phpunit/php-timer", + "version": "6.0.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-timer.git", + "reference": "e2a2d67966e740530f4a3343fe2e030ffdc1161d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/e2a2d67966e740530f4a3343fe2e030ffdc1161d", + "reference": "e2a2d67966e740530f4a3343fe2e030ffdc1161d", + "shasum": "" + }, + "require": { + "php": ">=8.1" + }, + "require-dev": { + "phpunit/phpunit": "^10.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "6.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/6.0.0" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2023-02-03T06:57:52+00:00" + }, + { + "name": "phpunit/phpunit", + "version": "10.5.24", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/phpunit.git", + "reference": "5f124e3e3e561006047b532fd0431bf5bb6b9015" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/5f124e3e3e561006047b532fd0431bf5bb6b9015", + "reference": "5f124e3e3e561006047b532fd0431bf5bb6b9015", + "shasum": "" + }, + "require": { + "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": ">=8.1", + "phpunit/php-code-coverage": "^10.1.5", + "phpunit/php-file-iterator": "^4.0", + "phpunit/php-invoker": "^4.0", + "phpunit/php-text-template": "^3.0", + "phpunit/php-timer": "^6.0", + "sebastian/cli-parser": "^2.0", + "sebastian/code-unit": "^2.0", + "sebastian/comparator": "^5.0", + "sebastian/diff": "^5.0", + "sebastian/environment": "^6.0", + "sebastian/exporter": "^5.1", + "sebastian/global-state": "^6.0.1", + "sebastian/object-enumerator": "^5.0", + "sebastian/recursion-context": "^5.0", + "sebastian/type": "^4.0", + "sebastian/version": "^4.0" + }, + "suggest": { + "ext-soap": "To be able to generate mocks based on WSDL files" + }, + "bin": [ + "phpunit" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "10.5-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/10.5.24" + }, + "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-06-20T13:09:54+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": "psr/event-dispatcher", + "version": "1.0.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/event-dispatcher.git", + "reference": "dbefd12671e8a14ec7f180cab83036ed26714bb0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/event-dispatcher/zipball/dbefd12671e8a14ec7f180cab83036ed26714bb0", + "reference": "dbefd12671e8a14ec7f180cab83036ed26714bb0", + "shasum": "" + }, + "require": { + "php": ">=7.2.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\EventDispatcher\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Standard interfaces for event handling.", + "keywords": [ + "events", + "psr", + "psr-14" + ], + "support": { + "issues": "https://github.com/php-fig/event-dispatcher/issues", + "source": "https://github.com/php-fig/event-dispatcher/tree/1.0.0" + }, + "time": "2019-01-08T18:20:26+00:00" + }, + { + "name": "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" + }, + { + "name": "react/cache", + "version": "v1.2.0", + "source": { + "type": "git", + "url": "https://github.com/reactphp/cache.git", + "reference": "d47c472b64aa5608225f47965a484b75c7817d5b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/reactphp/cache/zipball/d47c472b64aa5608225f47965a484b75c7817d5b", + "reference": "d47c472b64aa5608225f47965a484b75c7817d5b", + "shasum": "" + }, + "require": { + "php": ">=5.3.0", + "react/promise": "^3.0 || ^2.0 || ^1.1" + }, + "require-dev": { + "phpunit/phpunit": "^9.5 || ^5.7 || ^4.8.35" + }, + "type": "library", + "autoload": { + "psr-4": { + "React\\Cache\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Christian Lück", + "email": "christian@clue.engineering", + "homepage": "https://clue.engineering/" + }, + { + "name": "Cees-Jan Kiewiet", + "email": "reactphp@ceesjankiewiet.nl", + "homepage": "https://wyrihaximus.net/" + }, + { + "name": "Jan Sorgalla", + "email": "jsorgalla@gmail.com", + "homepage": "https://sorgalla.com/" + }, + { + "name": "Chris Boden", + "email": "cboden@gmail.com", + "homepage": "https://cboden.dev/" + } + ], + "description": "Async, Promise-based cache interface for ReactPHP", + "keywords": [ + "cache", + "caching", + "promise", + "reactphp" + ], + "support": { + "issues": "https://github.com/reactphp/cache/issues", + "source": "https://github.com/reactphp/cache/tree/v1.2.0" + }, + "funding": [ + { + "url": "https://opencollective.com/reactphp", + "type": "open_collective" + } + ], + "time": "2022-11-30T15:59:55+00:00" + }, + { + "name": "react/child-process", + "version": "v0.6.5", + "source": { + "type": "git", + "url": "https://github.com/reactphp/child-process.git", + "reference": "e71eb1aa55f057c7a4a0d08d06b0b0a484bead43" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/reactphp/child-process/zipball/e71eb1aa55f057c7a4a0d08d06b0b0a484bead43", + "reference": "e71eb1aa55f057c7a4a0d08d06b0b0a484bead43", + "shasum": "" + }, + "require": { + "evenement/evenement": "^3.0 || ^2.0 || ^1.0", + "php": ">=5.3.0", + "react/event-loop": "^1.2", + "react/stream": "^1.2" + }, + "require-dev": { + "phpunit/phpunit": "^9.3 || ^5.7 || ^4.8.35", + "react/socket": "^1.8", + "sebastian/environment": "^5.0 || ^3.0 || ^2.0 || ^1.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "React\\ChildProcess\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Christian Lück", + "email": "christian@clue.engineering", + "homepage": "https://clue.engineering/" + }, + { + "name": "Cees-Jan Kiewiet", + "email": "reactphp@ceesjankiewiet.nl", + "homepage": "https://wyrihaximus.net/" + }, + { + "name": "Jan Sorgalla", + "email": "jsorgalla@gmail.com", + "homepage": "https://sorgalla.com/" + }, + { + "name": "Chris Boden", + "email": "cboden@gmail.com", + "homepage": "https://cboden.dev/" + } + ], + "description": "Event-driven library for executing child processes with ReactPHP.", + "keywords": [ + "event-driven", + "process", + "reactphp" + ], + "support": { + "issues": "https://github.com/reactphp/child-process/issues", + "source": "https://github.com/reactphp/child-process/tree/v0.6.5" + }, + "funding": [ + { + "url": "https://github.com/WyriHaximus", + "type": "github" + }, + { + "url": "https://github.com/clue", + "type": "github" + } + ], + "time": "2022-09-16T13:41:56+00:00" + }, + { + "name": "react/dns", + "version": "v1.13.0", + "source": { + "type": "git", + "url": "https://github.com/reactphp/dns.git", + "reference": "eb8ae001b5a455665c89c1df97f6fb682f8fb0f5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/reactphp/dns/zipball/eb8ae001b5a455665c89c1df97f6fb682f8fb0f5", + "reference": "eb8ae001b5a455665c89c1df97f6fb682f8fb0f5", + "shasum": "" + }, + "require": { + "php": ">=5.3.0", + "react/cache": "^1.0 || ^0.6 || ^0.5", + "react/event-loop": "^1.2", + "react/promise": "^3.2 || ^2.7 || ^1.2.1" + }, + "require-dev": { + "phpunit/phpunit": "^9.6 || ^5.7 || ^4.8.36", + "react/async": "^4.3 || ^3 || ^2", + "react/promise-timer": "^1.11" + }, + "type": "library", + "autoload": { + "psr-4": { + "React\\Dns\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Christian Lück", + "email": "christian@clue.engineering", + "homepage": "https://clue.engineering/" + }, + { + "name": "Cees-Jan Kiewiet", + "email": "reactphp@ceesjankiewiet.nl", + "homepage": "https://wyrihaximus.net/" + }, + { + "name": "Jan Sorgalla", + "email": "jsorgalla@gmail.com", + "homepage": "https://sorgalla.com/" + }, + { + "name": "Chris Boden", + "email": "cboden@gmail.com", + "homepage": "https://cboden.dev/" + } + ], + "description": "Async DNS resolver for ReactPHP", + "keywords": [ + "async", + "dns", + "dns-resolver", + "reactphp" + ], + "support": { + "issues": "https://github.com/reactphp/dns/issues", + "source": "https://github.com/reactphp/dns/tree/v1.13.0" + }, + "funding": [ + { + "url": "https://opencollective.com/reactphp", + "type": "open_collective" + } + ], + "time": "2024-06-13T14:18:03+00:00" + }, + { + "name": "react/event-loop", + "version": "v1.5.0", + "source": { + "type": "git", + "url": "https://github.com/reactphp/event-loop.git", + "reference": "bbe0bd8c51ffc05ee43f1729087ed3bdf7d53354" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/reactphp/event-loop/zipball/bbe0bd8c51ffc05ee43f1729087ed3bdf7d53354", + "reference": "bbe0bd8c51ffc05ee43f1729087ed3bdf7d53354", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "require-dev": { + "phpunit/phpunit": "^9.6 || ^5.7 || ^4.8.36" + }, + "suggest": { + "ext-pcntl": "For signal handling support when using the StreamSelectLoop" + }, + "type": "library", + "autoload": { + "psr-4": { + "React\\EventLoop\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Christian Lück", + "email": "christian@clue.engineering", + "homepage": "https://clue.engineering/" + }, + { + "name": "Cees-Jan Kiewiet", + "email": "reactphp@ceesjankiewiet.nl", + "homepage": "https://wyrihaximus.net/" + }, + { + "name": "Jan Sorgalla", + "email": "jsorgalla@gmail.com", + "homepage": "https://sorgalla.com/" + }, + { + "name": "Chris Boden", + "email": "cboden@gmail.com", + "homepage": "https://cboden.dev/" + } + ], + "description": "ReactPHP's core reactor event loop that libraries can use for evented I/O.", + "keywords": [ + "asynchronous", + "event-loop" + ], + "support": { + "issues": "https://github.com/reactphp/event-loop/issues", + "source": "https://github.com/reactphp/event-loop/tree/v1.5.0" + }, + "funding": [ + { + "url": "https://opencollective.com/reactphp", + "type": "open_collective" + } + ], + "time": "2023-11-13T13:48:05+00:00" + }, + { + "name": "react/promise", + "version": "v3.2.0", + "source": { + "type": "git", + "url": "https://github.com/reactphp/promise.git", + "reference": "8a164643313c71354582dc850b42b33fa12a4b63" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/reactphp/promise/zipball/8a164643313c71354582dc850b42b33fa12a4b63", + "reference": "8a164643313c71354582dc850b42b33fa12a4b63", + "shasum": "" + }, + "require": { + "php": ">=7.1.0" + }, + "require-dev": { + "phpstan/phpstan": "1.10.39 || 1.4.10", + "phpunit/phpunit": "^9.6 || ^7.5" + }, + "type": "library", + "autoload": { + "files": [ + "src/functions_include.php" + ], + "psr-4": { + "React\\Promise\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jan Sorgalla", + "email": "jsorgalla@gmail.com", + "homepage": "https://sorgalla.com/" + }, + { + "name": "Christian Lück", + "email": "christian@clue.engineering", + "homepage": "https://clue.engineering/" + }, + { + "name": "Cees-Jan Kiewiet", + "email": "reactphp@ceesjankiewiet.nl", + "homepage": "https://wyrihaximus.net/" + }, + { + "name": "Chris Boden", + "email": "cboden@gmail.com", + "homepage": "https://cboden.dev/" + } + ], + "description": "A lightweight implementation of CommonJS Promises/A for PHP", + "keywords": [ + "promise", + "promises" + ], + "support": { + "issues": "https://github.com/reactphp/promise/issues", + "source": "https://github.com/reactphp/promise/tree/v3.2.0" + }, + "funding": [ + { + "url": "https://opencollective.com/reactphp", + "type": "open_collective" + } + ], + "time": "2024-05-24T10:39:05+00:00" + }, + { + "name": "react/socket", + "version": "v1.15.0", + "source": { + "type": "git", + "url": "https://github.com/reactphp/socket.git", + "reference": "216d3aec0b87f04a40ca04f481e6af01bdd1d038" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/reactphp/socket/zipball/216d3aec0b87f04a40ca04f481e6af01bdd1d038", + "reference": "216d3aec0b87f04a40ca04f481e6af01bdd1d038", + "shasum": "" + }, + "require": { + "evenement/evenement": "^3.0 || ^2.0 || ^1.0", + "php": ">=5.3.0", + "react/dns": "^1.11", + "react/event-loop": "^1.2", + "react/promise": "^3 || ^2.6 || ^1.2.1", + "react/stream": "^1.2" + }, + "require-dev": { + "phpunit/phpunit": "^9.6 || ^5.7 || ^4.8.36", + "react/async": "^4 || ^3 || ^2", + "react/promise-stream": "^1.4", + "react/promise-timer": "^1.10" + }, + "type": "library", + "autoload": { + "psr-4": { + "React\\Socket\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Christian Lück", + "email": "christian@clue.engineering", + "homepage": "https://clue.engineering/" + }, + { + "name": "Cees-Jan Kiewiet", + "email": "reactphp@ceesjankiewiet.nl", + "homepage": "https://wyrihaximus.net/" + }, + { + "name": "Jan Sorgalla", + "email": "jsorgalla@gmail.com", + "homepage": "https://sorgalla.com/" + }, + { + "name": "Chris Boden", + "email": "cboden@gmail.com", + "homepage": "https://cboden.dev/" + } + ], + "description": "Async, streaming plaintext TCP/IP and secure TLS socket server and client connections for ReactPHP", + "keywords": [ + "Connection", + "Socket", + "async", + "reactphp", + "stream" + ], + "support": { + "issues": "https://github.com/reactphp/socket/issues", + "source": "https://github.com/reactphp/socket/tree/v1.15.0" + }, + "funding": [ + { + "url": "https://opencollective.com/reactphp", + "type": "open_collective" + } + ], + "time": "2023-12-15T11:02:10+00:00" + }, + { + "name": "react/stream", + "version": "v1.4.0", + "source": { + "type": "git", + "url": "https://github.com/reactphp/stream.git", + "reference": "1e5b0acb8fe55143b5b426817155190eb6f5b18d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/reactphp/stream/zipball/1e5b0acb8fe55143b5b426817155190eb6f5b18d", + "reference": "1e5b0acb8fe55143b5b426817155190eb6f5b18d", + "shasum": "" + }, + "require": { + "evenement/evenement": "^3.0 || ^2.0 || ^1.0", + "php": ">=5.3.8", + "react/event-loop": "^1.2" + }, + "require-dev": { + "clue/stream-filter": "~1.2", + "phpunit/phpunit": "^9.6 || ^5.7 || ^4.8.36" + }, + "type": "library", + "autoload": { + "psr-4": { + "React\\Stream\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Christian Lück", + "email": "christian@clue.engineering", + "homepage": "https://clue.engineering/" + }, + { + "name": "Cees-Jan Kiewiet", + "email": "reactphp@ceesjankiewiet.nl", + "homepage": "https://wyrihaximus.net/" + }, + { + "name": "Jan Sorgalla", + "email": "jsorgalla@gmail.com", + "homepage": "https://sorgalla.com/" + }, + { + "name": "Chris Boden", + "email": "cboden@gmail.com", + "homepage": "https://cboden.dev/" + } + ], + "description": "Event-driven readable and writable streams for non-blocking I/O in ReactPHP", + "keywords": [ + "event-driven", + "io", + "non-blocking", + "pipe", + "reactphp", + "readable", + "stream", + "writable" + ], + "support": { + "issues": "https://github.com/reactphp/stream/issues", + "source": "https://github.com/reactphp/stream/tree/v1.4.0" + }, + "funding": [ + { + "url": "https://opencollective.com/reactphp", + "type": "open_collective" + } + ], + "time": "2024-06-11T12:45:25+00:00" + }, + { + "name": "sebastian/cli-parser", + "version": "2.0.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/cli-parser.git", + "reference": "c34583b87e7b7a8055bf6c450c2c77ce32a24084" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/cli-parser/zipball/c34583b87e7b7a8055bf6c450c2c77ce32a24084", + "reference": "c34583b87e7b7a8055bf6c450c2c77ce32a24084", + "shasum": "" + }, + "require": { + "php": ">=8.1" + }, + "require-dev": { + "phpunit/phpunit": "^10.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "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 parsing CLI options", + "homepage": "https://github.com/sebastianbergmann/cli-parser", + "support": { + "issues": "https://github.com/sebastianbergmann/cli-parser/issues", + "security": "https://github.com/sebastianbergmann/cli-parser/security/policy", + "source": "https://github.com/sebastianbergmann/cli-parser/tree/2.0.1" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2024-03-02T07:12:49+00:00" + }, + { + "name": "sebastian/code-unit", + "version": "2.0.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/code-unit.git", + "reference": "a81fee9eef0b7a76af11d121767abc44c104e503" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/code-unit/zipball/a81fee9eef0b7a76af11d121767abc44c104e503", + "reference": "a81fee9eef0b7a76af11d121767abc44c104e503", + "shasum": "" + }, + "require": { + "php": ">=8.1" + }, + "require-dev": { + "phpunit/phpunit": "^10.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "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": "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/2.0.0" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2023-02-03T06:58:43+00:00" + }, + { + "name": "sebastian/code-unit-reverse-lookup", + "version": "3.0.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/code-unit-reverse-lookup.git", + "reference": "5e3a687f7d8ae33fb362c5c0743794bbb2420a1d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/5e3a687f7d8ae33fb362c5c0743794bbb2420a1d", + "reference": "5e3a687f7d8ae33fb362c5c0743794bbb2420a1d", + "shasum": "" + }, + "require": { + "php": ">=8.1" + }, + "require-dev": { + "phpunit/phpunit": "^10.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": "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/3.0.0" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2023-02-03T06:59:15+00:00" + }, + { + "name": "sebastian/comparator", + "version": "5.0.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/comparator.git", + "reference": "2db5010a484d53ebf536087a70b4a5423c102372" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/2db5010a484d53ebf536087a70b4a5423c102372", + "reference": "2db5010a484d53ebf536087a70b4a5423c102372", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-mbstring": "*", + "php": ">=8.1", + "sebastian/diff": "^5.0", + "sebastian/exporter": "^5.0" + }, + "require-dev": { + "phpunit/phpunit": "^10.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "5.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", + "security": "https://github.com/sebastianbergmann/comparator/security/policy", + "source": "https://github.com/sebastianbergmann/comparator/tree/5.0.1" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2023-08-14T13:18:12+00:00" + }, + { + "name": "sebastian/complexity", + "version": "3.2.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/complexity.git", + "reference": "68ff824baeae169ec9f2137158ee529584553799" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/complexity/zipball/68ff824baeae169ec9f2137158ee529584553799", + "reference": "68ff824baeae169ec9f2137158ee529584553799", + "shasum": "" + }, + "require": { + "nikic/php-parser": "^4.18 || ^5.0", + "php": ">=8.1" + }, + "require-dev": { + "phpunit/phpunit": "^10.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "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": "Library for calculating the complexity of PHP code units", + "homepage": "https://github.com/sebastianbergmann/complexity", + "support": { + "issues": "https://github.com/sebastianbergmann/complexity/issues", + "security": "https://github.com/sebastianbergmann/complexity/security/policy", + "source": "https://github.com/sebastianbergmann/complexity/tree/3.2.0" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2023-12-21T08:37:17+00:00" + }, + { + "name": "sebastian/diff", + "version": "5.1.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/diff.git", + "reference": "c41e007b4b62af48218231d6c2275e4c9b975b2e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/c41e007b4b62af48218231d6c2275e4c9b975b2e", + "reference": "c41e007b4b62af48218231d6c2275e4c9b975b2e", + "shasum": "" + }, + "require": { + "php": ">=8.1" + }, + "require-dev": { + "phpunit/phpunit": "^10.0", + "symfony/process": "^6.4" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "5.1-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", + "security": "https://github.com/sebastianbergmann/diff/security/policy", + "source": "https://github.com/sebastianbergmann/diff/tree/5.1.1" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2024-03-02T07:15:17+00:00" + }, + { + "name": "sebastian/environment", + "version": "6.1.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/environment.git", + "reference": "8074dbcd93529b357029f5cc5058fd3e43666984" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/8074dbcd93529b357029f5cc5058fd3e43666984", + "reference": "8074dbcd93529b357029f5cc5058fd3e43666984", + "shasum": "" + }, + "require": { + "php": ">=8.1" + }, + "require-dev": { + "phpunit/phpunit": "^10.0" + }, + "suggest": { + "ext-posix": "*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "6.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": "https://github.com/sebastianbergmann/environment", + "keywords": [ + "Xdebug", + "environment", + "hhvm" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/environment/issues", + "security": "https://github.com/sebastianbergmann/environment/security/policy", + "source": "https://github.com/sebastianbergmann/environment/tree/6.1.0" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2024-03-23T08:47:14+00:00" + }, + { + "name": "sebastian/exporter", + "version": "5.1.2", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/exporter.git", + "reference": "955288482d97c19a372d3f31006ab3f37da47adf" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/955288482d97c19a372d3f31006ab3f37da47adf", + "reference": "955288482d97c19a372d3f31006ab3f37da47adf", + "shasum": "" + }, + "require": { + "ext-mbstring": "*", + "php": ">=8.1", + "sebastian/recursion-context": "^5.0" + }, + "require-dev": { + "phpunit/phpunit": "^10.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "5.1-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", + "security": "https://github.com/sebastianbergmann/exporter/security/policy", + "source": "https://github.com/sebastianbergmann/exporter/tree/5.1.2" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2024-03-02T07:17:12+00:00" + }, + { + "name": "sebastian/global-state", + "version": "6.0.2", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/global-state.git", + "reference": "987bafff24ecc4c9ac418cab1145b96dd6e9cbd9" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/987bafff24ecc4c9ac418cab1145b96dd6e9cbd9", + "reference": "987bafff24ecc4c9ac418cab1145b96dd6e9cbd9", + "shasum": "" + }, + "require": { + "php": ">=8.1", + "sebastian/object-reflector": "^3.0", + "sebastian/recursion-context": "^5.0" + }, + "require-dev": { + "ext-dom": "*", + "phpunit/phpunit": "^10.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "6.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": "https://www.github.com/sebastianbergmann/global-state", + "keywords": [ + "global state" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/global-state/issues", + "security": "https://github.com/sebastianbergmann/global-state/security/policy", + "source": "https://github.com/sebastianbergmann/global-state/tree/6.0.2" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2024-03-02T07:19:19+00:00" + }, + { + "name": "sebastian/lines-of-code", + "version": "2.0.2", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/lines-of-code.git", + "reference": "856e7f6a75a84e339195d48c556f23be2ebf75d0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/lines-of-code/zipball/856e7f6a75a84e339195d48c556f23be2ebf75d0", + "reference": "856e7f6a75a84e339195d48c556f23be2ebf75d0", + "shasum": "" + }, + "require": { + "nikic/php-parser": "^4.18 || ^5.0", + "php": ">=8.1" + }, + "require-dev": { + "phpunit/phpunit": "^10.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "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 counting the lines of code in PHP source code", + "homepage": "https://github.com/sebastianbergmann/lines-of-code", + "support": { + "issues": "https://github.com/sebastianbergmann/lines-of-code/issues", + "security": "https://github.com/sebastianbergmann/lines-of-code/security/policy", + "source": "https://github.com/sebastianbergmann/lines-of-code/tree/2.0.2" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2023-12-21T08:38:20+00:00" + }, + { + "name": "sebastian/object-enumerator", + "version": "5.0.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/object-enumerator.git", + "reference": "202d0e344a580d7f7d04b3fafce6933e59dae906" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/202d0e344a580d7f7d04b3fafce6933e59dae906", + "reference": "202d0e344a580d7f7d04b3fafce6933e59dae906", + "shasum": "" + }, + "require": { + "php": ">=8.1", + "sebastian/object-reflector": "^3.0", + "sebastian/recursion-context": "^5.0" + }, + "require-dev": { + "phpunit/phpunit": "^10.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "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": "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/5.0.0" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2023-02-03T07:08:32+00:00" + }, + { + "name": "sebastian/object-reflector", + "version": "3.0.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/object-reflector.git", + "reference": "24ed13d98130f0e7122df55d06c5c4942a577957" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/object-reflector/zipball/24ed13d98130f0e7122df55d06c5c4942a577957", + "reference": "24ed13d98130f0e7122df55d06c5c4942a577957", + "shasum": "" + }, + "require": { + "php": ">=8.1" + }, + "require-dev": { + "phpunit/phpunit": "^10.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": "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/3.0.0" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2023-02-03T07:06:18+00:00" + }, + { + "name": "sebastian/recursion-context", + "version": "5.0.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/recursion-context.git", + "reference": "05909fb5bc7df4c52992396d0116aed689f93712" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/05909fb5bc7df4c52992396d0116aed689f93712", + "reference": "05909fb5bc7df4c52992396d0116aed689f93712", + "shasum": "" + }, + "require": { + "php": ">=8.1" + }, + "require-dev": { + "phpunit/phpunit": "^10.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "5.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/5.0.0" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2023-02-03T07:05:40+00:00" + }, + { + "name": "sebastian/type", + "version": "4.0.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/type.git", + "reference": "462699a16464c3944eefc02ebdd77882bd3925bf" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/462699a16464c3944eefc02ebdd77882bd3925bf", + "reference": "462699a16464c3944eefc02ebdd77882bd3925bf", + "shasum": "" + }, + "require": { + "php": ">=8.1" + }, + "require-dev": { + "phpunit/phpunit": "^10.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "4.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "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/php-invoker/issues", - "source": "https://github.com/sebastianbergmann/php-invoker/tree/4.0.0" + "issues": "https://github.com/sebastianbergmann/type/issues", + "source": "https://github.com/sebastianbergmann/type/tree/4.0.0" }, "funding": [ { @@ -442,32 +2742,29 @@ "type": "github" } ], - "time": "2023-02-03T06:56:09+00:00" + "time": "2023-02-03T07:10:45+00:00" }, { - "name": "phpunit/php-text-template", - "version": "3.0.1", + "name": "sebastian/version", + "version": "4.0.1", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/php-text-template.git", - "reference": "0c7b06ff49e3d5072f057eb1fa59258bf287a748" + "url": "https://github.com/sebastianbergmann/version.git", + "reference": "c51fa83a5d8f43f1402e3f32a005e6262244ef17" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/0c7b06ff49e3d5072f057eb1fa59258bf287a748", - "reference": "0c7b06ff49e3d5072f057eb1fa59258bf287a748", + "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/c51fa83a5d8f43f1402e3f32a005e6262244ef17", + "reference": "c51fa83a5d8f43f1402e3f32a005e6262244ef17", "shasum": "" }, "require": { "php": ">=8.1" }, - "require-dev": { - "phpunit/phpunit": "^10.0" - }, "type": "library", "extra": { "branch-alias": { - "dev-main": "3.0-dev" + "dev-main": "4.0-dev" } }, "autoload": { @@ -486,15 +2783,11 @@ "role": "lead" } ], - "description": "Simple template engine.", - "homepage": "https://github.com/sebastianbergmann/php-text-template/", - "keywords": [ - "template" - ], + "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/php-text-template/issues", - "security": "https://github.com/sebastianbergmann/php-text-template/security/policy", - "source": "https://github.com/sebastianbergmann/php-text-template/tree/3.0.1" + "issues": "https://github.com/sebastianbergmann/version/issues", + "source": "https://github.com/sebastianbergmann/version/tree/4.0.1" }, "funding": [ { @@ -502,1083 +2795,1287 @@ "type": "github" } ], - "time": "2023-08-31T14:07:24+00:00" + "time": "2023-02-07T11:34:05+00:00" }, { - "name": "phpunit/php-timer", - "version": "6.0.0", + "name": "symfony/console", + "version": "v7.1.1", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/php-timer.git", - "reference": "e2a2d67966e740530f4a3343fe2e030ffdc1161d" + "url": "https://github.com/symfony/console.git", + "reference": "9b008f2d7b21c74ef4d0c3de6077a642bc55ece3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/e2a2d67966e740530f4a3343fe2e030ffdc1161d", - "reference": "e2a2d67966e740530f4a3343fe2e030ffdc1161d", + "url": "https://api.github.com/repos/symfony/console/zipball/9b008f2d7b21c74ef4d0c3de6077a642bc55ece3", + "reference": "9b008f2d7b21c74ef4d0c3de6077a642bc55ece3", "shasum": "" }, "require": { - "php": ">=8.1" + "php": ">=8.2", + "symfony/polyfill-mbstring": "~1.0", + "symfony/service-contracts": "^2.5|^3", + "symfony/string": "^6.4|^7.0" + }, + "conflict": { + "symfony/dependency-injection": "<6.4", + "symfony/dotenv": "<6.4", + "symfony/event-dispatcher": "<6.4", + "symfony/lock": "<6.4", + "symfony/process": "<6.4" + }, + "provide": { + "psr/log-implementation": "1.0|2.0|3.0" }, "require-dev": { - "phpunit/phpunit": "^10.0" + "psr/log": "^1|^2|^3", + "symfony/config": "^6.4|^7.0", + "symfony/dependency-injection": "^6.4|^7.0", + "symfony/event-dispatcher": "^6.4|^7.0", + "symfony/http-foundation": "^6.4|^7.0", + "symfony/http-kernel": "^6.4|^7.0", + "symfony/lock": "^6.4|^7.0", + "symfony/messenger": "^6.4|^7.0", + "symfony/process": "^6.4|^7.0", + "symfony/stopwatch": "^6.4|^7.0", + "symfony/var-dumper": "^6.4|^7.0" }, "type": "library", - "extra": { - "branch-alias": { - "dev-main": "6.0-dev" - } - }, "autoload": { - "classmap": [ - "src/" + "psr-4": { + "Symfony\\Component\\Console\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" ] }, "notification-url": "https://packagist.org/downloads/", "license": [ - "BSD-3-Clause" + "MIT" ], "authors": [ { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" } ], - "description": "Utility class for timing", - "homepage": "https://github.com/sebastianbergmann/php-timer/", + "description": "Eases the creation of beautiful and testable command line interfaces", + "homepage": "https://symfony.com", "keywords": [ - "timer" + "cli", + "command-line", + "console", + "terminal" ], "support": { - "issues": "https://github.com/sebastianbergmann/php-timer/issues", - "source": "https://github.com/sebastianbergmann/php-timer/tree/6.0.0" + "source": "https://github.com/symfony/console/tree/v7.1.1" }, "funding": [ { - "url": "https://github.com/sebastianbergmann", + "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-02-03T06:57:52+00:00" + "time": "2024-05-31T14:57:53+00:00" }, { - "name": "phpunit/phpunit", - "version": "10.5.20", + "name": "symfony/deprecation-contracts", + "version": "v3.5.0", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "547d314dc24ec1e177720d45c6263fb226cc2ae3" + "url": "https://github.com/symfony/deprecation-contracts.git", + "reference": "0e0d29ce1f20deffb4ab1b016a7257c4f1e789a1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/547d314dc24ec1e177720d45c6263fb226cc2ae3", - "reference": "547d314dc24ec1e177720d45c6263fb226cc2ae3", + "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/0e0d29ce1f20deffb4ab1b016a7257c4f1e789a1", + "reference": "0e0d29ce1f20deffb4ab1b016a7257c4f1e789a1", "shasum": "" }, "require": { - "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": ">=8.1", - "phpunit/php-code-coverage": "^10.1.5", - "phpunit/php-file-iterator": "^4.0", - "phpunit/php-invoker": "^4.0", - "phpunit/php-text-template": "^3.0", - "phpunit/php-timer": "^6.0", - "sebastian/cli-parser": "^2.0", - "sebastian/code-unit": "^2.0", - "sebastian/comparator": "^5.0", - "sebastian/diff": "^5.0", - "sebastian/environment": "^6.0", - "sebastian/exporter": "^5.1", - "sebastian/global-state": "^6.0.1", - "sebastian/object-enumerator": "^5.0", - "sebastian/recursion-context": "^5.0", - "sebastian/type": "^4.0", - "sebastian/version": "^4.0" - }, - "suggest": { - "ext-soap": "To be able to generate mocks based on WSDL files" + "php": ">=8.1" }, - "bin": [ - "phpunit" - ], "type": "library", "extra": { "branch-alias": { - "dev-main": "10.5-dev" + "dev-main": "3.5-dev" + }, + "thanks": { + "name": "symfony/contracts", + "url": "https://github.com/symfony/contracts" } }, "autoload": { "files": [ - "src/Framework/Assert/Functions.php" - ], - "classmap": [ - "src/" + "function.php" ] }, "notification-url": "https://packagist.org/downloads/", "license": [ - "BSD-3-Clause" + "MIT" ], "authors": [ { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" } ], - "description": "The PHP Unit Testing framework.", - "homepage": "https://phpunit.de/", - "keywords": [ - "phpunit", - "testing", - "xunit" - ], + "description": "A generic function and convention to trigger deprecation notices", + "homepage": "https://symfony.com", "support": { - "issues": "https://github.com/sebastianbergmann/phpunit/issues", - "security": "https://github.com/sebastianbergmann/phpunit/security/policy", - "source": "https://github.com/sebastianbergmann/phpunit/tree/10.5.20" + "source": "https://github.com/symfony/deprecation-contracts/tree/v3.5.0" }, "funding": [ { - "url": "https://phpunit.de/sponsors.html", + "url": "https://symfony.com/sponsor", "type": "custom" }, { - "url": "https://github.com/sebastianbergmann", + "url": "https://github.com/fabpot", "type": "github" }, { - "url": "https://tidelift.com/funding/github/packagist/phpunit/phpunit", + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", "type": "tidelift" } ], - "time": "2024-04-24T06:32:35+00:00" + "time": "2024-04-18T09:32:20+00:00" }, { - "name": "sebastian/cli-parser", - "version": "2.0.1", + "name": "symfony/event-dispatcher", + "version": "v7.1.1", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/cli-parser.git", - "reference": "c34583b87e7b7a8055bf6c450c2c77ce32a24084" + "url": "https://github.com/symfony/event-dispatcher.git", + "reference": "9fa7f7a21beb22a39a8f3f28618b29e50d7a55a7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/cli-parser/zipball/c34583b87e7b7a8055bf6c450c2c77ce32a24084", - "reference": "c34583b87e7b7a8055bf6c450c2c77ce32a24084", + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/9fa7f7a21beb22a39a8f3f28618b29e50d7a55a7", + "reference": "9fa7f7a21beb22a39a8f3f28618b29e50d7a55a7", "shasum": "" }, "require": { - "php": ">=8.1" + "php": ">=8.2", + "symfony/event-dispatcher-contracts": "^2.5|^3" + }, + "conflict": { + "symfony/dependency-injection": "<6.4", + "symfony/service-contracts": "<2.5" + }, + "provide": { + "psr/event-dispatcher-implementation": "1.0", + "symfony/event-dispatcher-implementation": "2.0|3.0" }, "require-dev": { - "phpunit/phpunit": "^10.0" + "psr/log": "^1|^2|^3", + "symfony/config": "^6.4|^7.0", + "symfony/dependency-injection": "^6.4|^7.0", + "symfony/error-handler": "^6.4|^7.0", + "symfony/expression-language": "^6.4|^7.0", + "symfony/http-foundation": "^6.4|^7.0", + "symfony/service-contracts": "^2.5|^3", + "symfony/stopwatch": "^6.4|^7.0" }, "type": "library", - "extra": { - "branch-alias": { - "dev-main": "2.0-dev" - } - }, "autoload": { - "classmap": [ - "src/" + "psr-4": { + "Symfony\\Component\\EventDispatcher\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" ] }, "notification-url": "https://packagist.org/downloads/", "license": [ - "BSD-3-Clause" + "MIT" ], "authors": [ { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" } ], - "description": "Library for parsing CLI options", - "homepage": "https://github.com/sebastianbergmann/cli-parser", + "description": "Provides tools that allow your application components to communicate with each other by dispatching events and listening to them", + "homepage": "https://symfony.com", "support": { - "issues": "https://github.com/sebastianbergmann/cli-parser/issues", - "security": "https://github.com/sebastianbergmann/cli-parser/security/policy", - "source": "https://github.com/sebastianbergmann/cli-parser/tree/2.0.1" + "source": "https://github.com/symfony/event-dispatcher/tree/v7.1.1" }, "funding": [ { - "url": "https://github.com/sebastianbergmann", + "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-03-02T07:12:49+00:00" + "time": "2024-05-31T14:57:53+00:00" }, { - "name": "sebastian/code-unit", - "version": "2.0.0", + "name": "symfony/event-dispatcher-contracts", + "version": "v3.5.0", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/code-unit.git", - "reference": "a81fee9eef0b7a76af11d121767abc44c104e503" + "url": "https://github.com/symfony/event-dispatcher-contracts.git", + "reference": "8f93aec25d41b72493c6ddff14e916177c9efc50" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/code-unit/zipball/a81fee9eef0b7a76af11d121767abc44c104e503", - "reference": "a81fee9eef0b7a76af11d121767abc44c104e503", + "url": "https://api.github.com/repos/symfony/event-dispatcher-contracts/zipball/8f93aec25d41b72493c6ddff14e916177c9efc50", + "reference": "8f93aec25d41b72493c6ddff14e916177c9efc50", "shasum": "" }, "require": { - "php": ">=8.1" - }, - "require-dev": { - "phpunit/phpunit": "^10.0" + "php": ">=8.1", + "psr/event-dispatcher": "^1" }, "type": "library", "extra": { "branch-alias": { - "dev-main": "2.0-dev" + "dev-main": "3.5-dev" + }, + "thanks": { + "name": "symfony/contracts", + "url": "https://github.com/symfony/contracts" } }, "autoload": { - "classmap": [ - "src/" - ] + "psr-4": { + "Symfony\\Contracts\\EventDispatcher\\": "" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ - "BSD-3-Clause" + "MIT" ], "authors": [ { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" } ], - "description": "Collection of value objects that represent the PHP code units", - "homepage": "https://github.com/sebastianbergmann/code-unit", + "description": "Generic abstractions related to dispatching event", + "homepage": "https://symfony.com", + "keywords": [ + "abstractions", + "contracts", + "decoupling", + "interfaces", + "interoperability", + "standards" + ], "support": { - "issues": "https://github.com/sebastianbergmann/code-unit/issues", - "source": "https://github.com/sebastianbergmann/code-unit/tree/2.0.0" + "source": "https://github.com/symfony/event-dispatcher-contracts/tree/v3.5.0" }, "funding": [ { - "url": "https://github.com/sebastianbergmann", + "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-02-03T06:58:43+00:00" + "time": "2024-04-18T09:32:20+00:00" }, { - "name": "sebastian/code-unit-reverse-lookup", - "version": "3.0.0", + "name": "symfony/filesystem", + "version": "v7.1.1", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/code-unit-reverse-lookup.git", - "reference": "5e3a687f7d8ae33fb362c5c0743794bbb2420a1d" + "url": "https://github.com/symfony/filesystem.git", + "reference": "802e87002f919296c9f606457d9fa327a0b3d6b2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/5e3a687f7d8ae33fb362c5c0743794bbb2420a1d", - "reference": "5e3a687f7d8ae33fb362c5c0743794bbb2420a1d", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/802e87002f919296c9f606457d9fa327a0b3d6b2", + "reference": "802e87002f919296c9f606457d9fa327a0b3d6b2", "shasum": "" }, "require": { - "php": ">=8.1" + "php": ">=8.2", + "symfony/polyfill-ctype": "~1.8", + "symfony/polyfill-mbstring": "~1.8" }, "require-dev": { - "phpunit/phpunit": "^10.0" + "symfony/process": "^6.4|^7.0" }, "type": "library", - "extra": { - "branch-alias": { - "dev-main": "3.0-dev" - } - }, "autoload": { - "classmap": [ - "src/" + "psr-4": { + "Symfony\\Component\\Filesystem\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" ] }, "notification-url": "https://packagist.org/downloads/", "license": [ - "BSD-3-Clause" + "MIT" ], "authors": [ { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" } ], - "description": "Looks up which function or method a line of code belongs to", - "homepage": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/", + "description": "Provides basic utilities for the filesystem", + "homepage": "https://symfony.com", "support": { - "issues": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/issues", - "source": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/tree/3.0.0" + "source": "https://github.com/symfony/filesystem/tree/v7.1.1" }, "funding": [ { - "url": "https://github.com/sebastianbergmann", + "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-02-03T06:59:15+00:00" + "time": "2024-05-31T14:57:53+00:00" }, { - "name": "sebastian/comparator", - "version": "5.0.1", + "name": "symfony/finder", + "version": "v7.1.1", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/comparator.git", - "reference": "2db5010a484d53ebf536087a70b4a5423c102372" + "url": "https://github.com/symfony/finder.git", + "reference": "fbb0ba67688b780efbc886c1a0a0948dcf7205d6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/2db5010a484d53ebf536087a70b4a5423c102372", - "reference": "2db5010a484d53ebf536087a70b4a5423c102372", + "url": "https://api.github.com/repos/symfony/finder/zipball/fbb0ba67688b780efbc886c1a0a0948dcf7205d6", + "reference": "fbb0ba67688b780efbc886c1a0a0948dcf7205d6", "shasum": "" }, "require": { - "ext-dom": "*", - "ext-mbstring": "*", - "php": ">=8.1", - "sebastian/diff": "^5.0", - "sebastian/exporter": "^5.0" + "php": ">=8.2" }, "require-dev": { - "phpunit/phpunit": "^10.3" + "symfony/filesystem": "^6.4|^7.0" }, "type": "library", - "extra": { - "branch-alias": { - "dev-main": "5.0-dev" - } - }, "autoload": { - "classmap": [ - "src/" + "psr-4": { + "Symfony\\Component\\Finder\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" ] }, "notification-url": "https://packagist.org/downloads/", "license": [ - "BSD-3-Clause" + "MIT" ], "authors": [ { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - }, - { - "name": "Jeff Welch", - "email": "whatthejeff@gmail.com" - }, - { - "name": "Volker Dusch", - "email": "github@wallbash.com" + "name": "Fabien Potencier", + "email": "fabien@symfony.com" }, { - "name": "Bernhard Schussek", - "email": "bschussek@2bepublished.at" + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" } ], - "description": "Provides the functionality to compare PHP values for equality", - "homepage": "https://github.com/sebastianbergmann/comparator", - "keywords": [ - "comparator", - "compare", - "equality" - ], + "description": "Finds files and directories via an intuitive fluent interface", + "homepage": "https://symfony.com", "support": { - "issues": "https://github.com/sebastianbergmann/comparator/issues", - "security": "https://github.com/sebastianbergmann/comparator/security/policy", - "source": "https://github.com/sebastianbergmann/comparator/tree/5.0.1" + "source": "https://github.com/symfony/finder/tree/v7.1.1" }, "funding": [ { - "url": "https://github.com/sebastianbergmann", + "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-08-14T13:18:12+00:00" + "time": "2024-05-31T14:57:53+00:00" }, { - "name": "sebastian/complexity", - "version": "3.2.0", + "name": "symfony/options-resolver", + "version": "v7.1.1", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/complexity.git", - "reference": "68ff824baeae169ec9f2137158ee529584553799" + "url": "https://github.com/symfony/options-resolver.git", + "reference": "47aa818121ed3950acd2b58d1d37d08a94f9bf55" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/complexity/zipball/68ff824baeae169ec9f2137158ee529584553799", - "reference": "68ff824baeae169ec9f2137158ee529584553799", + "url": "https://api.github.com/repos/symfony/options-resolver/zipball/47aa818121ed3950acd2b58d1d37d08a94f9bf55", + "reference": "47aa818121ed3950acd2b58d1d37d08a94f9bf55", "shasum": "" }, "require": { - "nikic/php-parser": "^4.18 || ^5.0", - "php": ">=8.1" - }, - "require-dev": { - "phpunit/phpunit": "^10.0" + "php": ">=8.2", + "symfony/deprecation-contracts": "^2.5|^3" }, "type": "library", - "extra": { - "branch-alias": { - "dev-main": "3.2-dev" - } - }, "autoload": { - "classmap": [ - "src/" + "psr-4": { + "Symfony\\Component\\OptionsResolver\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" ] }, "notification-url": "https://packagist.org/downloads/", "license": [ - "BSD-3-Clause" + "MIT" ], "authors": [ { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" } ], - "description": "Library for calculating the complexity of PHP code units", - "homepage": "https://github.com/sebastianbergmann/complexity", + "description": "Provides an improved replacement for the array_replace PHP function", + "homepage": "https://symfony.com", + "keywords": [ + "config", + "configuration", + "options" + ], "support": { - "issues": "https://github.com/sebastianbergmann/complexity/issues", - "security": "https://github.com/sebastianbergmann/complexity/security/policy", - "source": "https://github.com/sebastianbergmann/complexity/tree/3.2.0" + "source": "https://github.com/symfony/options-resolver/tree/v7.1.1" }, "funding": [ { - "url": "https://github.com/sebastianbergmann", + "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-21T08:37:17+00:00" + "time": "2024-05-31T14:57:53+00:00" }, { - "name": "sebastian/diff", - "version": "5.1.1", + "name": "symfony/polyfill-ctype", + "version": "v1.30.0", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/diff.git", - "reference": "c41e007b4b62af48218231d6c2275e4c9b975b2e" + "url": "https://github.com/symfony/polyfill-ctype.git", + "reference": "0424dff1c58f028c451efff2045f5d92410bd540" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/c41e007b4b62af48218231d6c2275e4c9b975b2e", - "reference": "c41e007b4b62af48218231d6c2275e4c9b975b2e", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/0424dff1c58f028c451efff2045f5d92410bd540", + "reference": "0424dff1c58f028c451efff2045f5d92410bd540", "shasum": "" }, "require": { - "php": ">=8.1" + "php": ">=7.1" }, - "require-dev": { - "phpunit/phpunit": "^10.0", - "symfony/process": "^6.4" + "provide": { + "ext-ctype": "*" + }, + "suggest": { + "ext-ctype": "For best performance" }, "type": "library", "extra": { - "branch-alias": { - "dev-main": "5.1-dev" + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" } }, "autoload": { - "classmap": [ - "src/" - ] + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Ctype\\": "" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ - "BSD-3-Clause" + "MIT" ], "authors": [ { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" + "name": "Gert de Pagter", + "email": "BackEndTea@gmail.com" }, { - "name": "Kore Nordmann", - "email": "mail@kore-nordmann.de" + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" } ], - "description": "Diff implementation", - "homepage": "https://github.com/sebastianbergmann/diff", + "description": "Symfony polyfill for ctype functions", + "homepage": "https://symfony.com", "keywords": [ - "diff", - "udiff", - "unidiff", - "unified diff" + "compatibility", + "ctype", + "polyfill", + "portable" ], "support": { - "issues": "https://github.com/sebastianbergmann/diff/issues", - "security": "https://github.com/sebastianbergmann/diff/security/policy", - "source": "https://github.com/sebastianbergmann/diff/tree/5.1.1" + "source": "https://github.com/symfony/polyfill-ctype/tree/v1.30.0" }, "funding": [ { - "url": "https://github.com/sebastianbergmann", + "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-03-02T07:15:17+00:00" + "time": "2024-05-31T15:07:36+00:00" }, { - "name": "sebastian/environment", - "version": "6.1.0", + "name": "symfony/polyfill-intl-grapheme", + "version": "v1.30.0", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/environment.git", - "reference": "8074dbcd93529b357029f5cc5058fd3e43666984" + "url": "https://github.com/symfony/polyfill-intl-grapheme.git", + "reference": "64647a7c30b2283f5d49b874d84a18fc22054b7a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/8074dbcd93529b357029f5cc5058fd3e43666984", - "reference": "8074dbcd93529b357029f5cc5058fd3e43666984", + "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/64647a7c30b2283f5d49b874d84a18fc22054b7a", + "reference": "64647a7c30b2283f5d49b874d84a18fc22054b7a", "shasum": "" }, "require": { - "php": ">=8.1" - }, - "require-dev": { - "phpunit/phpunit": "^10.0" + "php": ">=7.1" }, "suggest": { - "ext-posix": "*" + "ext-intl": "For best performance" }, "type": "library", "extra": { - "branch-alias": { - "dev-main": "6.1-dev" + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" } }, "autoload": { - "classmap": [ - "src/" - ] + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Intl\\Grapheme\\": "" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ - "BSD-3-Clause" + "MIT" ], "authors": [ { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" } ], - "description": "Provides functionality to handle HHVM/PHP environments", - "homepage": "https://github.com/sebastianbergmann/environment", + "description": "Symfony polyfill for intl's grapheme_* functions", + "homepage": "https://symfony.com", "keywords": [ - "Xdebug", - "environment", - "hhvm" + "compatibility", + "grapheme", + "intl", + "polyfill", + "portable", + "shim" ], "support": { - "issues": "https://github.com/sebastianbergmann/environment/issues", - "security": "https://github.com/sebastianbergmann/environment/security/policy", - "source": "https://github.com/sebastianbergmann/environment/tree/6.1.0" + "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.30.0" }, "funding": [ { - "url": "https://github.com/sebastianbergmann", + "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-03-23T08:47:14+00:00" + "time": "2024-05-31T15:07:36+00:00" }, { - "name": "sebastian/exporter", - "version": "5.1.2", + "name": "symfony/polyfill-intl-normalizer", + "version": "v1.30.0", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/exporter.git", - "reference": "955288482d97c19a372d3f31006ab3f37da47adf" + "url": "https://github.com/symfony/polyfill-intl-normalizer.git", + "reference": "a95281b0be0d9ab48050ebd988b967875cdb9fdb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/955288482d97c19a372d3f31006ab3f37da47adf", - "reference": "955288482d97c19a372d3f31006ab3f37da47adf", + "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/a95281b0be0d9ab48050ebd988b967875cdb9fdb", + "reference": "a95281b0be0d9ab48050ebd988b967875cdb9fdb", "shasum": "" }, "require": { - "ext-mbstring": "*", - "php": ">=8.1", - "sebastian/recursion-context": "^5.0" + "php": ">=7.1" }, - "require-dev": { - "phpunit/phpunit": "^10.0" + "suggest": { + "ext-intl": "For best performance" }, "type": "library", "extra": { - "branch-alias": { - "dev-main": "5.1-dev" + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" } }, "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Intl\\Normalizer\\": "" + }, "classmap": [ - "src/" + "Resources/stubs" ] }, "notification-url": "https://packagist.org/downloads/", "license": [ - "BSD-3-Clause" + "MIT" ], "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": "Nicolas Grekas", + "email": "p@tchwork.com" }, { - "name": "Bernhard Schussek", - "email": "bschussek@gmail.com" + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" } ], - "description": "Provides the functionality to export PHP variables for visualization", - "homepage": "https://www.github.com/sebastianbergmann/exporter", + "description": "Symfony polyfill for intl's Normalizer class and related functions", + "homepage": "https://symfony.com", "keywords": [ - "export", - "exporter" + "compatibility", + "intl", + "normalizer", + "polyfill", + "portable", + "shim" ], "support": { - "issues": "https://github.com/sebastianbergmann/exporter/issues", - "security": "https://github.com/sebastianbergmann/exporter/security/policy", - "source": "https://github.com/sebastianbergmann/exporter/tree/5.1.2" + "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.30.0" }, "funding": [ { - "url": "https://github.com/sebastianbergmann", + "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-03-02T07:17:12+00:00" + "time": "2024-05-31T15:07:36+00:00" }, { - "name": "sebastian/global-state", - "version": "6.0.2", + "name": "symfony/polyfill-mbstring", + "version": "v1.30.0", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/global-state.git", - "reference": "987bafff24ecc4c9ac418cab1145b96dd6e9cbd9" + "url": "https://github.com/symfony/polyfill-mbstring.git", + "reference": "fd22ab50000ef01661e2a31d850ebaa297f8e03c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/987bafff24ecc4c9ac418cab1145b96dd6e9cbd9", - "reference": "987bafff24ecc4c9ac418cab1145b96dd6e9cbd9", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/fd22ab50000ef01661e2a31d850ebaa297f8e03c", + "reference": "fd22ab50000ef01661e2a31d850ebaa297f8e03c", "shasum": "" }, "require": { - "php": ">=8.1", - "sebastian/object-reflector": "^3.0", - "sebastian/recursion-context": "^5.0" + "php": ">=7.1" }, - "require-dev": { - "ext-dom": "*", - "phpunit/phpunit": "^10.0" + "provide": { + "ext-mbstring": "*" + }, + "suggest": { + "ext-mbstring": "For best performance" }, "type": "library", "extra": { - "branch-alias": { - "dev-main": "6.0-dev" + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" } }, "autoload": { - "classmap": [ - "src/" - ] + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Mbstring\\": "" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ - "BSD-3-Clause" + "MIT" ], "authors": [ { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" } ], - "description": "Snapshotting of global state", - "homepage": "https://www.github.com/sebastianbergmann/global-state", + "description": "Symfony polyfill for the Mbstring extension", + "homepage": "https://symfony.com", "keywords": [ - "global state" + "compatibility", + "mbstring", + "polyfill", + "portable", + "shim" ], "support": { - "issues": "https://github.com/sebastianbergmann/global-state/issues", - "security": "https://github.com/sebastianbergmann/global-state/security/policy", - "source": "https://github.com/sebastianbergmann/global-state/tree/6.0.2" + "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.30.0" }, "funding": [ { - "url": "https://github.com/sebastianbergmann", + "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-03-02T07:19:19+00:00" + "time": "2024-06-19T12:30:46+00:00" }, { - "name": "sebastian/lines-of-code", - "version": "2.0.2", + "name": "symfony/polyfill-php80", + "version": "v1.30.0", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/lines-of-code.git", - "reference": "856e7f6a75a84e339195d48c556f23be2ebf75d0" + "url": "https://github.com/symfony/polyfill-php80.git", + "reference": "77fa7995ac1b21ab60769b7323d600a991a90433" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/lines-of-code/zipball/856e7f6a75a84e339195d48c556f23be2ebf75d0", - "reference": "856e7f6a75a84e339195d48c556f23be2ebf75d0", + "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/77fa7995ac1b21ab60769b7323d600a991a90433", + "reference": "77fa7995ac1b21ab60769b7323d600a991a90433", "shasum": "" }, "require": { - "nikic/php-parser": "^4.18 || ^5.0", - "php": ">=8.1" - }, - "require-dev": { - "phpunit/phpunit": "^10.0" + "php": ">=7.1" }, "type": "library", "extra": { - "branch-alias": { - "dev-main": "2.0-dev" + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" } }, "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Php80\\": "" + }, "classmap": [ - "src/" + "Resources/stubs" ] }, "notification-url": "https://packagist.org/downloads/", "license": [ - "BSD-3-Clause" + "MIT" ], "authors": [ { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" + "name": "Ion Bazan", + "email": "ion.bazan@gmail.com" + }, + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" } ], - "description": "Library for counting the lines of code in PHP source code", - "homepage": "https://github.com/sebastianbergmann/lines-of-code", + "description": "Symfony polyfill backporting some PHP 8.0+ features to lower PHP versions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "polyfill", + "portable", + "shim" + ], "support": { - "issues": "https://github.com/sebastianbergmann/lines-of-code/issues", - "security": "https://github.com/sebastianbergmann/lines-of-code/security/policy", - "source": "https://github.com/sebastianbergmann/lines-of-code/tree/2.0.2" + "source": "https://github.com/symfony/polyfill-php80/tree/v1.30.0" }, "funding": [ { - "url": "https://github.com/sebastianbergmann", + "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-21T08:38:20+00:00" + "time": "2024-05-31T15:07:36+00:00" }, { - "name": "sebastian/object-enumerator", - "version": "5.0.0", + "name": "symfony/polyfill-php81", + "version": "v1.30.0", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/object-enumerator.git", - "reference": "202d0e344a580d7f7d04b3fafce6933e59dae906" + "url": "https://github.com/symfony/polyfill-php81.git", + "reference": "3fb075789fb91f9ad9af537c4012d523085bd5af" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/202d0e344a580d7f7d04b3fafce6933e59dae906", - "reference": "202d0e344a580d7f7d04b3fafce6933e59dae906", + "url": "https://api.github.com/repos/symfony/polyfill-php81/zipball/3fb075789fb91f9ad9af537c4012d523085bd5af", + "reference": "3fb075789fb91f9ad9af537c4012d523085bd5af", "shasum": "" }, "require": { - "php": ">=8.1", - "sebastian/object-reflector": "^3.0", - "sebastian/recursion-context": "^5.0" - }, - "require-dev": { - "phpunit/phpunit": "^10.0" + "php": ">=7.1" }, "type": "library", "extra": { - "branch-alias": { - "dev-main": "5.0-dev" + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" } }, "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Php81\\": "" + }, "classmap": [ - "src/" + "Resources/stubs" ] }, "notification-url": "https://packagist.org/downloads/", "license": [ - "BSD-3-Clause" + "MIT" ], "authors": [ { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" } ], - "description": "Traverses array structures and object graphs to enumerate all referenced objects", - "homepage": "https://github.com/sebastianbergmann/object-enumerator/", + "description": "Symfony polyfill backporting some PHP 8.1+ features to lower PHP versions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "polyfill", + "portable", + "shim" + ], "support": { - "issues": "https://github.com/sebastianbergmann/object-enumerator/issues", - "source": "https://github.com/sebastianbergmann/object-enumerator/tree/5.0.0" + "source": "https://github.com/symfony/polyfill-php81/tree/v1.30.0" }, "funding": [ { - "url": "https://github.com/sebastianbergmann", + "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-02-03T07:08:32+00:00" + "time": "2024-06-19T12:30:46+00:00" }, { - "name": "sebastian/object-reflector", - "version": "3.0.0", + "name": "symfony/process", + "version": "v7.1.1", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/object-reflector.git", - "reference": "24ed13d98130f0e7122df55d06c5c4942a577957" + "url": "https://github.com/symfony/process.git", + "reference": "febf90124323a093c7ee06fdb30e765ca3c20028" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/object-reflector/zipball/24ed13d98130f0e7122df55d06c5c4942a577957", - "reference": "24ed13d98130f0e7122df55d06c5c4942a577957", + "url": "https://api.github.com/repos/symfony/process/zipball/febf90124323a093c7ee06fdb30e765ca3c20028", + "reference": "febf90124323a093c7ee06fdb30e765ca3c20028", "shasum": "" }, "require": { - "php": ">=8.1" - }, - "require-dev": { - "phpunit/phpunit": "^10.0" + "php": ">=8.2" }, "type": "library", - "extra": { - "branch-alias": { - "dev-main": "3.0-dev" - } - }, "autoload": { - "classmap": [ - "src/" + "psr-4": { + "Symfony\\Component\\Process\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" ] }, "notification-url": "https://packagist.org/downloads/", "license": [ - "BSD-3-Clause" + "MIT" ], "authors": [ { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" } ], - "description": "Allows reflection of object attributes, including inherited and non-public ones", - "homepage": "https://github.com/sebastianbergmann/object-reflector/", + "description": "Executes commands in sub-processes", + "homepage": "https://symfony.com", "support": { - "issues": "https://github.com/sebastianbergmann/object-reflector/issues", - "source": "https://github.com/sebastianbergmann/object-reflector/tree/3.0.0" + "source": "https://github.com/symfony/process/tree/v7.1.1" }, "funding": [ { - "url": "https://github.com/sebastianbergmann", + "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-02-03T07:06:18+00:00" + "time": "2024-05-31T14:57:53+00:00" }, { - "name": "sebastian/recursion-context", - "version": "5.0.0", + "name": "symfony/service-contracts", + "version": "v3.5.0", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/recursion-context.git", - "reference": "05909fb5bc7df4c52992396d0116aed689f93712" + "url": "https://github.com/symfony/service-contracts.git", + "reference": "bd1d9e59a81d8fa4acdcea3f617c581f7475a80f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/05909fb5bc7df4c52992396d0116aed689f93712", - "reference": "05909fb5bc7df4c52992396d0116aed689f93712", + "url": "https://api.github.com/repos/symfony/service-contracts/zipball/bd1d9e59a81d8fa4acdcea3f617c581f7475a80f", + "reference": "bd1d9e59a81d8fa4acdcea3f617c581f7475a80f", "shasum": "" }, "require": { - "php": ">=8.1" + "php": ">=8.1", + "psr/container": "^1.1|^2.0", + "symfony/deprecation-contracts": "^2.5|^3" }, - "require-dev": { - "phpunit/phpunit": "^10.0" + "conflict": { + "ext-psr": "<1.1|>=2" }, "type": "library", "extra": { "branch-alias": { - "dev-main": "5.0-dev" + "dev-main": "3.5-dev" + }, + "thanks": { + "name": "symfony/contracts", + "url": "https://github.com/symfony/contracts" } }, "autoload": { - "classmap": [ - "src/" + "psr-4": { + "Symfony\\Contracts\\Service\\": "" + }, + "exclude-from-classmap": [ + "/Test/" ] }, "notification-url": "https://packagist.org/downloads/", "license": [ - "BSD-3-Clause" + "MIT" ], "authors": [ { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - }, - { - "name": "Jeff Welch", - "email": "whatthejeff@gmail.com" + "name": "Nicolas Grekas", + "email": "p@tchwork.com" }, { - "name": "Adam Harvey", - "email": "aharvey@php.net" + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" } ], - "description": "Provides functionality to recursively process PHP variables", - "homepage": "https://github.com/sebastianbergmann/recursion-context", + "description": "Generic abstractions related to writing services", + "homepage": "https://symfony.com", + "keywords": [ + "abstractions", + "contracts", + "decoupling", + "interfaces", + "interoperability", + "standards" + ], "support": { - "issues": "https://github.com/sebastianbergmann/recursion-context/issues", - "source": "https://github.com/sebastianbergmann/recursion-context/tree/5.0.0" + "source": "https://github.com/symfony/service-contracts/tree/v3.5.0" }, "funding": [ { - "url": "https://github.com/sebastianbergmann", + "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-02-03T07:05:40+00:00" + "time": "2024-04-18T09:32:20+00:00" }, { - "name": "sebastian/type", - "version": "4.0.0", + "name": "symfony/stopwatch", + "version": "v7.1.1", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/type.git", - "reference": "462699a16464c3944eefc02ebdd77882bd3925bf" + "url": "https://github.com/symfony/stopwatch.git", + "reference": "5b75bb1ac2ba1b9d05c47fc4b3046a625377d23d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/462699a16464c3944eefc02ebdd77882bd3925bf", - "reference": "462699a16464c3944eefc02ebdd77882bd3925bf", + "url": "https://api.github.com/repos/symfony/stopwatch/zipball/5b75bb1ac2ba1b9d05c47fc4b3046a625377d23d", + "reference": "5b75bb1ac2ba1b9d05c47fc4b3046a625377d23d", "shasum": "" }, "require": { - "php": ">=8.1" - }, - "require-dev": { - "phpunit/phpunit": "^10.0" + "php": ">=8.2", + "symfony/service-contracts": "^2.5|^3" }, "type": "library", - "extra": { - "branch-alias": { - "dev-main": "4.0-dev" - } - }, "autoload": { - "classmap": [ - "src/" + "psr-4": { + "Symfony\\Component\\Stopwatch\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" ] }, "notification-url": "https://packagist.org/downloads/", "license": [ - "BSD-3-Clause" + "MIT" ], "authors": [ { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" } ], - "description": "Collection of value objects that represent the types of the PHP type system", - "homepage": "https://github.com/sebastianbergmann/type", + "description": "Provides a way to profile code", + "homepage": "https://symfony.com", "support": { - "issues": "https://github.com/sebastianbergmann/type/issues", - "source": "https://github.com/sebastianbergmann/type/tree/4.0.0" + "source": "https://github.com/symfony/stopwatch/tree/v7.1.1" }, "funding": [ { - "url": "https://github.com/sebastianbergmann", + "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-02-03T07:10:45+00:00" + "time": "2024-05-31T14:57:53+00:00" }, { - "name": "sebastian/version", - "version": "4.0.1", + "name": "symfony/string", + "version": "v7.1.1", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/version.git", - "reference": "c51fa83a5d8f43f1402e3f32a005e6262244ef17" + "url": "https://github.com/symfony/string.git", + "reference": "60bc311c74e0af215101235aa6f471bcbc032df2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/c51fa83a5d8f43f1402e3f32a005e6262244ef17", - "reference": "c51fa83a5d8f43f1402e3f32a005e6262244ef17", + "url": "https://api.github.com/repos/symfony/string/zipball/60bc311c74e0af215101235aa6f471bcbc032df2", + "reference": "60bc311c74e0af215101235aa6f471bcbc032df2", "shasum": "" }, "require": { - "php": ">=8.1" + "php": ">=8.2", + "symfony/polyfill-ctype": "~1.8", + "symfony/polyfill-intl-grapheme": "~1.0", + "symfony/polyfill-intl-normalizer": "~1.0", + "symfony/polyfill-mbstring": "~1.0" }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "4.0-dev" - } + "conflict": { + "symfony/translation-contracts": "<2.5" + }, + "require-dev": { + "symfony/emoji": "^7.1", + "symfony/error-handler": "^6.4|^7.0", + "symfony/http-client": "^6.4|^7.0", + "symfony/intl": "^6.4|^7.0", + "symfony/translation-contracts": "^2.5|^3.0", + "symfony/var-exporter": "^6.4|^7.0" }, + "type": "library", "autoload": { - "classmap": [ - "src/" + "files": [ + "Resources/functions.php" + ], + "psr-4": { + "Symfony\\Component\\String\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" ] }, "notification-url": "https://packagist.org/downloads/", "license": [ - "BSD-3-Clause" + "MIT" ], "authors": [ { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" } ], - "description": "Library that helps with managing the version number of Git-hosted PHP projects", - "homepage": "https://github.com/sebastianbergmann/version", + "description": "Provides an object-oriented API to strings and deals with bytes, UTF-8 code points and grapheme clusters in a unified way", + "homepage": "https://symfony.com", + "keywords": [ + "grapheme", + "i18n", + "string", + "unicode", + "utf-8", + "utf8" + ], "support": { - "issues": "https://github.com/sebastianbergmann/version/issues", - "source": "https://github.com/sebastianbergmann/version/tree/4.0.1" + "source": "https://github.com/symfony/string/tree/v7.1.1" }, "funding": [ { - "url": "https://github.com/sebastianbergmann", + "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-02-07T11:34:05+00:00" + "time": "2024-06-04T06:40:14+00:00" }, { "name": "theseer/tokenizer", diff --git a/src/Color.php b/src/Color.php index 58b0b48..4ee5fd6 100755 --- a/src/Color.php +++ b/src/Color.php @@ -1,59 +1,57 @@ -r = static::clamp($r, 0, 255); - $this->g = static::clamp($g, 0, 255); - $this->b = static::clamp($b, 0, 255); - $this->a = static::clamp($a, 0, 1); - } - -} +r = static::clamp($r, 0, 255); + $this->g = static::clamp($g, 0, 255); + $this->b = static::clamp($b, 0, 255); + $this->a = static::clamp($a, 0, 1); + } +} diff --git a/src/Traits/AttributesTrait.php b/src/Traits/AttributesTrait.php index 11109f3..ec97361 100755 --- a/src/Traits/AttributesTrait.php +++ b/src/Traits/AttributesTrait.php @@ -1,106 +1,104 @@ -a; - } - - /** - * Get the brightness value of the color. - * @return int|float The brightness value. (0, 100) - */ - public function getBrightness(): int|float - { - return $this->getHSV()[2]; - } - - /** - * Get the hue value of the color. - * @return int|float The hue value. (0, 360) - */ - public function getHue(): int|float - { - return $this->getHSV()[0]; - } - - /** - * Get the saturation value of the color. - * @return int|float The saturation value. (0, 100) - */ - public function getSaturation(): int|float - { - return $this->getHSV()[1]; - } - - /** - * Get the relative luminance value of the color - * @return float The relative luminance value. (0, 1) - */ - public function luma(): float - { - return static::RGB2Luma($this->r, $this->g, $this->b); - } - - /** - * Set the alpha value of the color. - * @param int|float $a The alpha value. (0, 1) - * @return Color A new Color. - */ - public function setAlpha(int|float $a): static - { - return new static($this->r, $this->g, $this->b, $a); - } - - /** - * Set the brightness value of the color. - * @param int|float $v The brightness value. (0, 100) - * @return Color A new Color. - */ - public function setBrightness(int|float $v): static - { - [$h, $s, $_] = $this->getHSV(); - [$r, $g, $b] = static::HSV2RGB($h, $s, $v); - - return new static($r, $g, $b, $this->a); - } - - /** - * Set the hue value of the color. - * @param int|float $h The hue value. (0, 360) - * @return Color A new Color. - */ - public function setHue(int|float $h): static - { - [$_, $s, $v] = $this->getHSV(); - [$r, $g, $b] = static::HSV2RGB($h, $s, $v); - - return new static($r, $g, $b, $this->a); - } - - /** - * Set the saturation value of the color. - * @param int|float $s The saturation value. (0, 100) - * @return Color A new Color. - */ - public function setSaturation(int|float $s): static - { - [$h, $_, $v] = $this->getHSV(); - [$r, $g, $b] = static::HSV2RGB($h, $s, $v); - - return new static($r, $g, $b, $this->a); - } - -} +a; + } + + /** + * Get the brightness value of the color. + * @return int|float The brightness value. (0, 100) + */ + public function getBrightness(): float|int + { + return $this->getHSV()[2]; + } + + /** + * Get the hue value of the color. + * @return int|float The hue value. (0, 360) + */ + public function getHue(): float|int + { + return $this->getHSV()[0]; + } + + /** + * Get the saturation value of the color. + * @return int|float The saturation value. (0, 100) + */ + public function getSaturation(): float|int + { + return $this->getHSV()[1]; + } + + /** + * Get the relative luminance value of the color + * @return float The relative luminance value. (0, 1) + */ + public function luma(): float + { + return static::RGB2Luma($this->r, $this->g, $this->b); + } + + /** + * Set the alpha value of the color. + * @param int|float $a The alpha value. (0, 1) + * @return Color A new Color. + */ + public function setAlpha(float|int $a): static + { + return new static($this->r, $this->g, $this->b, $a); + } + + /** + * Set the brightness value of the color. + * @param int|float $v The brightness value. (0, 100) + * @return Color A new Color. + */ + public function setBrightness(float|int $v): static + { + [$h, $s, $_] = $this->getHSV(); + [$r, $g, $b] = static::HSV2RGB($h, $s, $v); + + return new static($r, $g, $b, $this->a); + } + + /** + * Set the hue value of the color. + * @param int|float $h The hue value. (0, 360) + * @return Color A new Color. + */ + public function setHue(float|int $h): static + { + [$_, $s, $v] = $this->getHSV(); + [$r, $g, $b] = static::HSV2RGB($h, $s, $v); + + return new static($r, $g, $b, $this->a); + } + + /** + * Set the saturation value of the color. + * @param int|float $s The saturation value. (0, 100) + * @return Color A new Color. + */ + public function setSaturation(float|int $s): static + { + [$h, $_, $v] = $this->getHSV(); + [$r, $g, $b] = static::HSV2RGB($h, $s, $v); + + return new static($r, $g, $b, $this->a); + } +} diff --git a/src/Traits/ConversionTrait.php b/src/Traits/ConversionTrait.php index cf92626..23647d6 100755 --- a/src/Traits/ConversionTrait.php +++ b/src/Traits/ConversionTrait.php @@ -1,356 +1,354 @@ - $deltaB - $deltaG, - $g => 1 / 3 + $deltaR - $deltaB, - $b => 2 / 3 + $deltaG - $deltaR - }; - - $h = fmod($h + 1, 1); - - return [ - round($h * 360, 2), - round($s * 100, 2), - round($l * 100, 2) - ]; - } - - /** - * Convert RGB color values to HSV. - * @param int|float $r The red value. (0, 255) - * @param int|float $g The green value. (0, 255) - * @param int|float $b The blue value. (0, 255) - * @return array An array containing the HSV values. - */ - protected static function RGB2HSV(int|float $r, int|float $g, int|float $b): array - { - $r /= 255; - $g /= 255; - $b /= 255; - - $min = min($r, $g, $b); - $max = max($r, $g, $b); - $diff = $max - $min; - $v = $max; - - if (!$diff) { - return [ - 0, - 0, - round($v * 100, 2) - ]; - } - - $s = $diff / $max; - $deltaR = ((($max - $r) / 6) + ($diff / 2)) / $diff; - $deltaG = ((($max - $g) / 6) + ($diff / 2)) / $diff; - $deltaB = ((($max - $b) / 6) + ($diff / 2)) / $diff; - - $h = 0; - - $h = match ($max) { - $r => $deltaB - $deltaG, - $g => 1 / 3 + $deltaR - $deltaB, - $b => 2 / 3 + $deltaG - $deltaR - }; - - $h = fmod($h + 1, 1); - - return [ - round($h * 360, 2), - round($s * 100, 2), - round($v * 100, 2) - ]; - } - - /** - * Calculate the R, G or B value of a hue. - * @param int|float $v1 The first value. - * @param int|float $v2 The second value. - * @param int|float $vH The hue value. - * @return int|float The R, G or B value. - */ - protected static function RGBHue(int|float $v1, int|float $v2, int|float $vH): int|float - { - $vH = fmod($vH + 1, 1); - - if (6 * $vH < 1) { - return $v1 + ($v2 - $v1) * 6 * $vH; - } - - if (2 * $vH < 1) { - return $v2; - } - - if (3 * $vH < 2) { - return $v1 + ($v2 - $v1) * ((2 / 3) - $vH) * 6; - } - - return $v1; - } - - /** - * Calculate the relative R, G or B value for luma calculation. - * @param int|float $v The value. - * @return int|float The R, G or B value. - */ - protected static function RGBLumaValue(int|float $v): int|float - { - $v /= 255; - - if ($v <= .03928) { - return $v / 12.92; - } - - return pow((($v + .055) / 1.055), 2.4); - } - -} + $deltaB - $deltaG, + $g => 1 / 3 + $deltaR - $deltaB, + $b => 2 / 3 + $deltaG - $deltaR + }; + + $h = fmod($h + 1, 1); + + return [ + round($h * 360, 2), + round($s * 100, 2), + round($l * 100, 2) + ]; + } + + /** + * Convert RGB color values to HSV. + * @param int|float $r The red value. (0, 255) + * @param int|float $g The green value. (0, 255) + * @param int|float $b The blue value. (0, 255) + * @return array An array containing the HSV values. + */ + protected static function RGB2HSV(float|int $r, float|int $g, float|int $b): array + { + $r /= 255; + $g /= 255; + $b /= 255; + + $min = min($r, $g, $b); + $max = max($r, $g, $b); + $diff = $max - $min; + $v = $max; + + if (!$diff) { + return [ + 0, + 0, + round($v * 100, 2) + ]; + } + + $s = $diff / $max; + $deltaR = ((($max - $r) / 6) + ($diff / 2)) / $diff; + $deltaG = ((($max - $g) / 6) + ($diff / 2)) / $diff; + $deltaB = ((($max - $b) / 6) + ($diff / 2)) / $diff; + + $h = 0; + + $h = match ($max) { + $r => $deltaB - $deltaG, + $g => 1 / 3 + $deltaR - $deltaB, + $b => 2 / 3 + $deltaG - $deltaR + }; + + $h = fmod($h + 1, 1); + + return [ + round($h * 360, 2), + round($s * 100, 2), + round($v * 100, 2) + ]; + } + + /** + * Calculate the relative luminance of an RGB color. + * @param int|float $r The red value. (0, 255) + * @param int|float $g The green value. (0, 255) + * @param int|float $b The blue value. (0, 255) + * @return float The relative luminance value. + */ + protected static function RGB2Luma(float|int $r, float|int $g, float|int $b): float + { + $r = static::RGBLumaValue($r); + $g = static::RGBLumaValue($g); + $b = static::RGBLumaValue($b); + + return (.2126 * $r) + (.7152 * $g) + (.0722 * $b); + } + + /** + * Calculate the R, G or B value of a hue. + * @param int|float $v1 The first value. + * @param int|float $v2 The second value. + * @param int|float $vH The hue value. + * @return int|float The R, G or B value. + */ + protected static function RGBHue(float|int $v1, float|int $v2, float|int $vH): float|int + { + $vH = fmod($vH + 1, 1); + + if (6 * $vH < 1) { + return $v1 + ($v2 - $v1) * 6 * $vH; + } + + if (2 * $vH < 1) { + return $v2; + } + + if (3 * $vH < 2) { + return $v1 + ($v2 - $v1) * ((2 / 3) - $vH) * 6; + } + + return $v1; + } + + /** + * Calculate the relative R, G or B value for luma calculation. + * @param int|float $v The value. + * @return int|float The R, G or B value. + */ + protected static function RGBLumaValue(float|int $v): float|int + { + $v /= 255; + + if ($v <= .03928) { + return $v / 12.92; + } + + return pow((($v + .055) / 1.055), 2.4); + } +} diff --git a/src/Traits/CreateTrait.php b/src/Traits/CreateTrait.php index 947660a..5b6ff5f 100755 --- a/src/Traits/CreateTrait.php +++ b/src/Traits/CreateTrait.php @@ -1,377 +1,376 @@ - '#f0f8ff', - 'antiquewhite' => '#faebd7', - 'aqua' => '#00ffff', - 'aquamarine' => '#7fffd4', - 'azure' => '#f0ffff', - 'beige' => '#f5f5dc', - 'bisque' => '#ffe4c4', - 'black' => '#000000', - 'blanchedalmond' => '#ffebcd', - 'blue' => '#0000ff', - 'blueviolet' => '#8a2be2', - 'brown' => '#a52a2a', - 'burlywood' => '#deb887', - 'cadetblue' => '#5f9ea0', - 'chartreuse' => '#7fff00', - 'chocolate' => '#d2691e', - 'coral' => '#ff7f50', - 'cornflowerblue' => '#6495ed', - 'cornsilk' => '#fff8dc', - 'crimson' => '#dc143c', - 'cyan' => '#00ffff', - 'darkblue' => '#00008b', - 'darkcyan' => '#008b8b', - 'darkgoldenrod' => '#b8860b', - 'darkgray' => '#a9a9a9', - 'darkgrey' => '#a9a9a9', - 'darkgreen' => '#006400', - 'darkkhaki' => '#bdb76b', - 'darkmagenta' => '#8b008b', - 'darkolivegreen' => '#556b2f', - 'darkorange' => '#ff8c00', - 'darkorchid' => '#9932cc', - 'darkred' => '#8b0000', - 'darksalmon' => '#e9967a', - 'darkseagreen' => '#8fbc8f', - 'darkslateblue' => '#483d8b', - 'darkslategray' => '#2f4f4f', - 'darkslategrey' => '#2f4f4f', - 'darkturquoise' => '#00ced1', - 'darkviolet' => '#9400d3', - 'deeppink' => '#ff1493', - 'deepskyblue' => '#00bfff', - 'dimgray' => '#696969', - 'dimgrey' => '#696969', - 'dodgerblue' => '#1e90ff', - 'firebrick' => '#b22222', - 'floralwhite' => '#fffaf0', - 'forestgreen' => '#228b22', - 'fuchsia' => '#ff00ff', - 'gainsboro' => '#dcdcdc', - 'ghostwhite' => '#f8f8ff', - 'gold' => '#ffd700', - 'goldenrod' => '#daa520', - 'gray' => '#808080', - 'grey' => '#808080', - 'green' => '#008000', - 'greenyellow' => '#adff2f', - 'honeydew' => '#f0fff0', - 'hotpink' => '#ff69b4', - 'indianred' => '#cd5c5c', - 'indigo' => '#4b0082', - 'ivory' => '#fffff0', - 'khaki' => '#f0e68c', - 'lavender' => '#e6e6fa', - 'lavenderblush' => '#fff0f5', - 'lawngreen' => '#7cfc00', - 'lemonchiffon' => '#fffacd', - 'lightblue' => '#add8e6', - 'lightcoral' => '#f08080', - 'lightcyan' => '#e0ffff', - 'lightgoldenrodyellow' => '#fafad2', - 'lightgray' => '#d3d3d3', - 'lightgrey' => '#d3d3d3', - 'lightgreen' => '#90ee90', - 'lightpink' => '#ffb6c1', - 'lightsalmon' => '#ffa07a', - 'lightseagreen' => '#20b2aa', - 'lightskyblue' => '#87cefa', - 'lightslategray' => '#778899', - 'lightslategrey' => '#778899', - 'lightsteelblue' => '#b0c4de', - 'lightyellow' => '#ffffe0', - 'lime' => '#00ff00', - 'limegreen' => '#32cd32', - 'linen' => '#faf0e6', - 'magenta' => '#ff00ff', - 'maroon' => '#800000', - 'mediumaquamarine' => '#66cdaa', - 'mediumblue' => '#0000cd', - 'mediumorchid' => '#ba55d3', - 'mediumpurple' => '#9370db', - 'mediumseagreen' => '#3cb371', - 'mediumslateblue' => '#7b68ee', - 'mediumspringgreen' => '#00fa9a', - 'mediumturquoise' => '#48d1cc', - 'mediumvioletred' => '#c71585', - 'midnightblue' => '#191970', - 'mintcream' => '#f5fffa', - 'mistyrose' => '#ffe4e1', - 'moccasin' => '#ffe4b5', - 'navajowhite' => '#ffdead', - 'navy' => '#000080', - 'oldlace' => '#fdf5e6', - 'olive' => '#808000', - 'olivedrab' => '#6b8e23', - 'orange' => '#ffa500', - 'orangered' => '#ff4500', - 'orchid' => '#da70d6', - 'palegoldenrod' => '#eee8aa', - 'palegreen' => '#98fb98', - 'paleturquoise' => '#afeeee', - 'palevioletred' => '#db7093', - 'papayawhip' => '#ffefd5', - 'peachpuff' => '#ffdab9', - 'peru' => '#cd853f', - 'pink' => '#ffc0cb', - 'plum' => '#dda0dd', - 'powderblue' => '#b0e0e6', - 'purple' => '#800080', - 'rebeccapurple' => '#663399', - 'red' => '#ff0000', - 'rosybrown' => '#bc8f8f', - 'royalblue' => '#4169e1', - 'saddlebrown' => '#8b4513', - 'salmon' => '#fa8072', - 'sandybrown' => '#f4a460', - 'seagreen' => '#2e8b57', - 'seashell' => '#fff5ee', - 'sienna' => '#a0522d', - 'silver' => '#c0c0c0', - 'skyblue' => '#87ceeb', - 'slateblue' => '#6a5acd', - 'slategray' => '#708090', - 'slategrey' => '#708090', - 'snow' => '#fffafa', - 'springgreen' => '#00ff7f', - 'steelblue' => '#4682b4', - 'tan' => '#d2b48c', - 'teal' => '#008080', - 'thistle' => '#d8bfd8', - 'tomato' => '#ff6347', - 'turquoise' => '#40e0d0', - 'violet' => '#ee82ee', - 'wheat' => '#f5deb3', - 'white' => '#ffffff', - 'whitesmoke' => '#f5f5f5', - 'yellow' => '#ffff00', - 'yellowgreen' => '#9acd32' - ]; - - /** - * Create a new Color from CMY values. - * @param int|float $c The cyan value. (0, 100) - * @param int|float $m The magenta value. (0, 100) - * @param int|float $y The yellow value. (0, 100) - * @param int|float $a The alpha value. (0, 1) - * @return \Fyre\Color\Color A new Color. - */ - public static function fromCMY(int|float $c, int|float $m, int|float $y, int|float $a = 1): static - { - [$r, $g, $b] = static::CMY2RGB($c, $m, $y); - - return new static($r, $g, $b, $a); - } - - /** - * Create a new Color from CMYK values. - * @param int|float $c The cyan value. (0, 100) - * @param int|float $m The magenta value. (0, 100) - * @param int|float $y The yellow value. (0, 100) - * @param int|float $k The key value. (0, 100) - * @param int|float $a The alpha value. (0, 1) - * @return \Fyre\Color\Color A new Color. - */ - public static function fromCMYK(int|float $c, int|float $m, int|float $y, int|float $k, int|float $a = 1): static - { - [$c, $m, $y] = static::CMYK2CMY($c, $m, $y, $k); - - return static::fromCMY($c, $m, $y, $a); - } - - /** - * Create a new Color from a hex color string. - * @param string $string The hex color string. - * @return \Fyre\Color\Color A new Color. - * @throws RuntimeException if the hex string is not valid. - */ - public static function fromHexString(string $string): static - { - $string = trim($string); - - if (strlen($string) > 6) { - $pattern = '/^#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})?$/i'; - } else { - $pattern = '/^#([0-9a-f])([0-9a-f])([0-9a-f])([0-9a-f]?)$/i'; - } - - if (!preg_match($pattern, $string, $match)) { - throw new RuntimeException('Invalid hex string: '.$string); - } - - $rgb = array_map( - function(string $value): int { - if (strlen($value) < 2) { - $value = $value.$value; - } - - return (int) hexdec($value); - }, - array_slice($match, 1, 5) - ); - - $rgb[3] ??= 255; - - return new static($rgb[0], $rgb[1], $rgb[2], ($rgb[3] ?: 255) / 255); - } - - /** - * Create a new Color from HSL values. - * @param int|float $h The hue value. (0, 360) - * @param int|float $s The saturation value. (0, 100) - * @param int|float $l The lightness value. (0, 100) - * @param int|float $a The alpha value. (0, 1) - * @return \Fyre\Color\Color A new Color. - */ - public static function fromHSL(int|float $h, int|float $s, int|float $l, int|float $a = 1): static - { - [$r, $g, $b] = static::HSL2RGB($h, $s, $l); - - return new static($r, $g, $b, $a); - } - - /** - * Create a new Color from a HSL color string. - * @param string $string The HSL color string. - * @return \Fyre\Color\Color A new Color. - * @throws RuntimeException if the HSL string is not valid. - */ - public static function fromHSLString(string $string): static - { - $string = trim($string); - - if (preg_match('/^hsl\(((?:\d*\.)?\d+)deg\s+((?:\d*\.)?\d+)\%\s+((?:\d*\.)?\d+)\%\)$/i', $string, $match)) { - return static::fromHSL((float) $match[1], (float) $match[2], (float) $match[3]); - } - - if (preg_match('/^hsl\(((?:\d*\.)?\d+)deg\s+((?:\d*\.)?\d+)\%\s+((?:\d*\.)?\d+)\%\s*\/\s*((?:\d*\.)?\d+)(\%?)\)$/i', $string, $match)) { - return static::fromHSL((float) $match[1], (float) $match[2], (float) $match[3], (float) $match[4] / 100); - } - - if (preg_match('/^hsl\(((?:\d*\.)?\d+),\s*((?:\d*\.)?\d+)\%,\s*((?:\d*\.)?\d+)\%\)$/i', $string, $match)) { - return static::fromHSL((float) $match[1], (float) $match[2], (float) $match[3]); - } - - if (preg_match('/^hsla\(((?:\d*\.)?\d+),\s*((?:\d*\.)?\d+)\%,\s*((?:\d*\.)?\d+)\%,\s*((?:\d*\.)?\d+)(\%?)\)$/i', $string, $match)) { - return static::fromHSL((float) $match[1], (float) $match[2], (float) $match[3], (float) $match[4]); - } - - throw new RuntimeException('Invalid HSL string: '.$string); - } - - /** - * Create a new Color from HSV values. - * @param int|float $h The hue value. (0, 360) - * @param int|float $s The saturation value. (0, 100) - * @param int|float $v The brightness value. (0, 100) - * @param int|float $a The alpha value. (0, 1) - * @return \Fyre\Color\Color A new Color. - */ - public static function fromHSV(int|float $h, int|float $s, int|float $v, int|float $a = 1): static - { - [$r, $g, $b] = static::HSV2RGB($h, $s, $v); - - return new static($r, $g, $b, $a); - } - - /** - * Create a new Color from RGB values. - * @param int|float $r The red value. (0, 255) - * @param int|float $g The green value. (0, 255) - * @param int|float $b The blue value. (0, 255) - * @param int|float $a The alpha value. (0, 1) - * @return \Fyre\Color\Color A new Color. - */ - public static function fromRGB(int|float $r, int|float $g, int|float $b, int|float $a = 1): static - { - return new static($r, $g, $b, $a); - } - - /** - * Create a new Color from a RGB color string. - * @param string $string The RGB color string. - * @return \Fyre\Color\Color A new Color. - * @throws RuntimeException if the RGB string is not valid. - */ - public static function fromRGBString(string $string): static - { - $string = trim($string); - - if (preg_match('/^rgb\(((?:\d*\.)?\d+)\s+((?:\d*\.)?\d+)\s+((?:\d*\.)?\d+)\)$/i', $string, $match)) { - return static::fromRGB((float) $match[1], (float) $match[2], (float) $match[3]); - } - - if (preg_match('/^rgb\(((?:\d*\.)?\d+)\s+((?:\d*\.)?\d+)\s+((?:\d*\.)?\d+)\s*\/\s*((?:\d*\.)?\d+)(\%?)\)$/i', $string, $match)) { - return static::fromRGB((float) $match[1], (float) $match[2], (float) $match[3], (float) $match[4] / 100); - } - - if (preg_match('/^rgb\(((?:\d*\.)?\d+),\s*((?:\d*\.)?\d+),\s*((?:\d*\.)?\d+)\)$/i', $string, $match)) { - return static::fromRGB((float) $match[1], (float) $match[2], (float) $match[3]); - } - - if (preg_match('/^rgba\(((?:\d*\.)?\d+),\s*((?:\d*\.)?\d+),\s*((?:\d*\.)?\d+),\s*((?:\d*\.)?\d+)(\%?)\)$/i', $string, $match)) { - return static::fromRGB((float) $match[1], (float) $match[2], (float) $match[3], (float) $match[4]); - } - - throw new RuntimeException('Invalid RGB string: '.$string); - } - - /** - * Create a new Color from a HTML color string. - * @param string $string The HTML color string. - * @return \Fyre\Color\Color A new Color. - * @throws RuntimeException if the color string is not valid. - */ - public static function fromString(string $string): static - { - $string = strtolower($string); - $string = trim($string); - - if ($string === 'transparent') { - return new static(0, 0, 0, 0); - } - - if (array_key_exists($string, static::COLORS)) { - $string = static::COLORS[$string]; - } - - if (substr($string, 0, 1) === '#') { - return static::fromHexString($string); - } - - if (preg_match('/^rgb/i', $string)) { - return static::fromRGBString($string); - } - - if (preg_match('/^hsl/i', $string)) { - return static::fromHSLString($string); - } - - throw new RuntimeException('Invalid color string: '.$string); - } - -} + '#f0f8ff', + 'antiquewhite' => '#faebd7', + 'aqua' => '#00ffff', + 'aquamarine' => '#7fffd4', + 'azure' => '#f0ffff', + 'beige' => '#f5f5dc', + 'bisque' => '#ffe4c4', + 'black' => '#000000', + 'blanchedalmond' => '#ffebcd', + 'blue' => '#0000ff', + 'blueviolet' => '#8a2be2', + 'brown' => '#a52a2a', + 'burlywood' => '#deb887', + 'cadetblue' => '#5f9ea0', + 'chartreuse' => '#7fff00', + 'chocolate' => '#d2691e', + 'coral' => '#ff7f50', + 'cornflowerblue' => '#6495ed', + 'cornsilk' => '#fff8dc', + 'crimson' => '#dc143c', + 'cyan' => '#00ffff', + 'darkblue' => '#00008b', + 'darkcyan' => '#008b8b', + 'darkgoldenrod' => '#b8860b', + 'darkgray' => '#a9a9a9', + 'darkgrey' => '#a9a9a9', + 'darkgreen' => '#006400', + 'darkkhaki' => '#bdb76b', + 'darkmagenta' => '#8b008b', + 'darkolivegreen' => '#556b2f', + 'darkorange' => '#ff8c00', + 'darkorchid' => '#9932cc', + 'darkred' => '#8b0000', + 'darksalmon' => '#e9967a', + 'darkseagreen' => '#8fbc8f', + 'darkslateblue' => '#483d8b', + 'darkslategray' => '#2f4f4f', + 'darkslategrey' => '#2f4f4f', + 'darkturquoise' => '#00ced1', + 'darkviolet' => '#9400d3', + 'deeppink' => '#ff1493', + 'deepskyblue' => '#00bfff', + 'dimgray' => '#696969', + 'dimgrey' => '#696969', + 'dodgerblue' => '#1e90ff', + 'firebrick' => '#b22222', + 'floralwhite' => '#fffaf0', + 'forestgreen' => '#228b22', + 'fuchsia' => '#ff00ff', + 'gainsboro' => '#dcdcdc', + 'ghostwhite' => '#f8f8ff', + 'gold' => '#ffd700', + 'goldenrod' => '#daa520', + 'gray' => '#808080', + 'grey' => '#808080', + 'green' => '#008000', + 'greenyellow' => '#adff2f', + 'honeydew' => '#f0fff0', + 'hotpink' => '#ff69b4', + 'indianred' => '#cd5c5c', + 'indigo' => '#4b0082', + 'ivory' => '#fffff0', + 'khaki' => '#f0e68c', + 'lavender' => '#e6e6fa', + 'lavenderblush' => '#fff0f5', + 'lawngreen' => '#7cfc00', + 'lemonchiffon' => '#fffacd', + 'lightblue' => '#add8e6', + 'lightcoral' => '#f08080', + 'lightcyan' => '#e0ffff', + 'lightgoldenrodyellow' => '#fafad2', + 'lightgray' => '#d3d3d3', + 'lightgrey' => '#d3d3d3', + 'lightgreen' => '#90ee90', + 'lightpink' => '#ffb6c1', + 'lightsalmon' => '#ffa07a', + 'lightseagreen' => '#20b2aa', + 'lightskyblue' => '#87cefa', + 'lightslategray' => '#778899', + 'lightslategrey' => '#778899', + 'lightsteelblue' => '#b0c4de', + 'lightyellow' => '#ffffe0', + 'lime' => '#00ff00', + 'limegreen' => '#32cd32', + 'linen' => '#faf0e6', + 'magenta' => '#ff00ff', + 'maroon' => '#800000', + 'mediumaquamarine' => '#66cdaa', + 'mediumblue' => '#0000cd', + 'mediumorchid' => '#ba55d3', + 'mediumpurple' => '#9370db', + 'mediumseagreen' => '#3cb371', + 'mediumslateblue' => '#7b68ee', + 'mediumspringgreen' => '#00fa9a', + 'mediumturquoise' => '#48d1cc', + 'mediumvioletred' => '#c71585', + 'midnightblue' => '#191970', + 'mintcream' => '#f5fffa', + 'mistyrose' => '#ffe4e1', + 'moccasin' => '#ffe4b5', + 'navajowhite' => '#ffdead', + 'navy' => '#000080', + 'oldlace' => '#fdf5e6', + 'olive' => '#808000', + 'olivedrab' => '#6b8e23', + 'orange' => '#ffa500', + 'orangered' => '#ff4500', + 'orchid' => '#da70d6', + 'palegoldenrod' => '#eee8aa', + 'palegreen' => '#98fb98', + 'paleturquoise' => '#afeeee', + 'palevioletred' => '#db7093', + 'papayawhip' => '#ffefd5', + 'peachpuff' => '#ffdab9', + 'peru' => '#cd853f', + 'pink' => '#ffc0cb', + 'plum' => '#dda0dd', + 'powderblue' => '#b0e0e6', + 'purple' => '#800080', + 'rebeccapurple' => '#663399', + 'red' => '#ff0000', + 'rosybrown' => '#bc8f8f', + 'royalblue' => '#4169e1', + 'saddlebrown' => '#8b4513', + 'salmon' => '#fa8072', + 'sandybrown' => '#f4a460', + 'seagreen' => '#2e8b57', + 'seashell' => '#fff5ee', + 'sienna' => '#a0522d', + 'silver' => '#c0c0c0', + 'skyblue' => '#87ceeb', + 'slateblue' => '#6a5acd', + 'slategray' => '#708090', + 'slategrey' => '#708090', + 'snow' => '#fffafa', + 'springgreen' => '#00ff7f', + 'steelblue' => '#4682b4', + 'tan' => '#d2b48c', + 'teal' => '#008080', + 'thistle' => '#d8bfd8', + 'tomato' => '#ff6347', + 'turquoise' => '#40e0d0', + 'violet' => '#ee82ee', + 'wheat' => '#f5deb3', + 'white' => '#ffffff', + 'whitesmoke' => '#f5f5f5', + 'yellow' => '#ffff00', + 'yellowgreen' => '#9acd32' + ]; + + /** + * Create a new Color from CMY values. + * @param int|float $c The cyan value. (0, 100) + * @param int|float $m The magenta value. (0, 100) + * @param int|float $y The yellow value. (0, 100) + * @param int|float $a The alpha value. (0, 1) + * @return Color A new Color. + */ + public static function fromCMY(float|int $c, float|int $m, float|int $y, float|int $a = 1): static + { + [$r, $g, $b] = static::CMY2RGB($c, $m, $y); + + return new static($r, $g, $b, $a); + } + + /** + * Create a new Color from CMYK values. + * @param int|float $c The cyan value. (0, 100) + * @param int|float $m The magenta value. (0, 100) + * @param int|float $y The yellow value. (0, 100) + * @param int|float $k The key value. (0, 100) + * @param int|float $a The alpha value. (0, 1) + * @return Color A new Color. + */ + public static function fromCMYK(float|int $c, float|int $m, float|int $y, float|int $k, float|int $a = 1): static + { + [$c, $m, $y] = static::CMYK2CMY($c, $m, $y, $k); + + return static::fromCMY($c, $m, $y, $a); + } + + /** + * Create a new Color from a hex color string. + * @param string $string The hex color string. + * @return Color A new Color. + * @throws RuntimeException if the hex string is not valid. + */ + public static function fromHexString(string $string): static + { + $string = trim($string); + + if (strlen($string) > 6) { + $pattern = '/^#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})?$/i'; + } else { + $pattern = '/^#([0-9a-f])([0-9a-f])([0-9a-f])([0-9a-f]?)$/i'; + } + + if (!preg_match($pattern, $string, $match)) { + throw new RuntimeException('Invalid hex string: '.$string); + } + + $rgb = array_map( + function(string $value): int { + if (strlen($value) < 2) { + $value = $value.$value; + } + + return (int) hexdec($value); + }, + array_slice($match, 1, 5) + ); + + $rgb[3] ??= 255; + + return new static($rgb[0], $rgb[1], $rgb[2], ($rgb[3] ?: 255) / 255); + } + + /** + * Create a new Color from HSL values. + * @param int|float $h The hue value. (0, 360) + * @param int|float $s The saturation value. (0, 100) + * @param int|float $l The lightness value. (0, 100) + * @param int|float $a The alpha value. (0, 1) + * @return Color A new Color. + */ + public static function fromHSL(float|int $h, float|int $s, float|int $l, float|int $a = 1): static + { + [$r, $g, $b] = static::HSL2RGB($h, $s, $l); + + return new static($r, $g, $b, $a); + } + + /** + * Create a new Color from a HSL color string. + * @param string $string The HSL color string. + * @return Color A new Color. + * @throws RuntimeException if the HSL string is not valid. + */ + public static function fromHSLString(string $string): static + { + $string = trim($string); + + if (preg_match('/^hsl\(((?:\d*\.)?\d+)deg\s+((?:\d*\.)?\d+)\%\s+((?:\d*\.)?\d+)\%\)$/i', $string, $match)) { + return static::fromHSL((float) $match[1], (float) $match[2], (float) $match[3]); + } + + if (preg_match('/^hsl\(((?:\d*\.)?\d+)deg\s+((?:\d*\.)?\d+)\%\s+((?:\d*\.)?\d+)\%\s*\/\s*((?:\d*\.)?\d+)(\%?)\)$/i', $string, $match)) { + return static::fromHSL((float) $match[1], (float) $match[2], (float) $match[3], (float) $match[4] / 100); + } + + if (preg_match('/^hsl\(((?:\d*\.)?\d+),\s*((?:\d*\.)?\d+)\%,\s*((?:\d*\.)?\d+)\%\)$/i', $string, $match)) { + return static::fromHSL((float) $match[1], (float) $match[2], (float) $match[3]); + } + + if (preg_match('/^hsla\(((?:\d*\.)?\d+),\s*((?:\d*\.)?\d+)\%,\s*((?:\d*\.)?\d+)\%,\s*((?:\d*\.)?\d+)(\%?)\)$/i', $string, $match)) { + return static::fromHSL((float) $match[1], (float) $match[2], (float) $match[3], (float) $match[4]); + } + + throw new RuntimeException('Invalid HSL string: '.$string); + } + + /** + * Create a new Color from HSV values. + * @param int|float $h The hue value. (0, 360) + * @param int|float $s The saturation value. (0, 100) + * @param int|float $v The brightness value. (0, 100) + * @param int|float $a The alpha value. (0, 1) + * @return Color A new Color. + */ + public static function fromHSV(float|int $h, float|int $s, float|int $v, float|int $a = 1): static + { + [$r, $g, $b] = static::HSV2RGB($h, $s, $v); + + return new static($r, $g, $b, $a); + } + + /** + * Create a new Color from RGB values. + * @param int|float $r The red value. (0, 255) + * @param int|float $g The green value. (0, 255) + * @param int|float $b The blue value. (0, 255) + * @param int|float $a The alpha value. (0, 1) + * @return Color A new Color. + */ + public static function fromRGB(float|int $r, float|int $g, float|int $b, float|int $a = 1): static + { + return new static($r, $g, $b, $a); + } + + /** + * Create a new Color from a RGB color string. + * @param string $string The RGB color string. + * @return Color A new Color. + * @throws RuntimeException if the RGB string is not valid. + */ + public static function fromRGBString(string $string): static + { + $string = trim($string); + + if (preg_match('/^rgb\(((?:\d*\.)?\d+)\s+((?:\d*\.)?\d+)\s+((?:\d*\.)?\d+)\)$/i', $string, $match)) { + return static::fromRGB((float) $match[1], (float) $match[2], (float) $match[3]); + } + + if (preg_match('/^rgb\(((?:\d*\.)?\d+)\s+((?:\d*\.)?\d+)\s+((?:\d*\.)?\d+)\s*\/\s*((?:\d*\.)?\d+)(\%?)\)$/i', $string, $match)) { + return static::fromRGB((float) $match[1], (float) $match[2], (float) $match[3], (float) $match[4] / 100); + } + + if (preg_match('/^rgb\(((?:\d*\.)?\d+),\s*((?:\d*\.)?\d+),\s*((?:\d*\.)?\d+)\)$/i', $string, $match)) { + return static::fromRGB((float) $match[1], (float) $match[2], (float) $match[3]); + } + + if (preg_match('/^rgba\(((?:\d*\.)?\d+),\s*((?:\d*\.)?\d+),\s*((?:\d*\.)?\d+),\s*((?:\d*\.)?\d+)(\%?)\)$/i', $string, $match)) { + return static::fromRGB((float) $match[1], (float) $match[2], (float) $match[3], (float) $match[4]); + } + + throw new RuntimeException('Invalid RGB string: '.$string); + } + + /** + * Create a new Color from a HTML color string. + * @param string $string The HTML color string. + * @return Color A new Color. + * @throws RuntimeException if the color string is not valid. + */ + public static function fromString(string $string): static + { + $string = strtolower($string); + $string = trim($string); + + if ($string === 'transparent') { + return new static(0, 0, 0, 0); + } + + if (array_key_exists($string, static::COLORS)) { + $string = static::COLORS[$string]; + } + + if (substr($string, 0, 1) === '#') { + return static::fromHexString($string); + } + + if (preg_match('/^rgb/i', $string)) { + return static::fromRGBString($string); + } + + if (preg_match('/^hsl/i', $string)) { + return static::fromHSLString($string); + } + + throw new RuntimeException('Invalid color string: '.$string); + } +} diff --git a/src/Traits/ManipulateTrait.php b/src/Traits/ManipulateTrait.php index 60ba0ef..02d6d70 100755 --- a/src/Traits/ManipulateTrait.php +++ b/src/Traits/ManipulateTrait.php @@ -1,105 +1,103 @@ -getHSL(); - $l -= $l * $amount; - [$r, $g, $b] = static::HSL2RGB($h, $s, $l); - - return new static($r, $g, $b, $this->a); - } - - /** - * Invert the color. - * @return Color A new Color. - */ - public function invert(): static - { - return new static( - 255 - $this->r, - 255 - $this->g, - 255 - $this->b, - $this->a - ); - } - - /** - * Lighten the color by a specified amount. - * @param int|float $amount The amount to lighten the color by. (0, 1) - * @return Color A new Color. - */ - public function lighten(int|float $amount): static - { - [$h, $s, $l] = $this->getHSL(); - $l += (100 - $l) * $amount; - [$r, $g, $b] = static::HSL2RGB($h, $s, $l); - - return new static($r, $g, $b, $this->a); - } - - /** - * Shade the color by a specified amount. - * @param int|float $amount The amount to shade the color by. (0, 1) - * @return Color A new Color. - */ - public function shade(int|float $amount): static - { - $color = static::mix($this, new static(0), $amount); - - return new static( - $color->r, - $color->g, - $color->b, - $this->a - ); - } - - /** - * Tint the color by a specified amount. - * @param int|float $amount The amount to tint the color by. (0, 1) - * @return Color A new Color. - */ - public function tint(int|float $amount): static - { - $color = static::mix($this, new static(100), $amount); - - return new static( - $color->r, - $color->g, - $color->b, - $this->a - ); - } - - /** - * Tone the color by a specified amount. - * @param int|float $amount The amount to tone the color by. (0, 1) - * @return Color A new Color. - */ - public function tone(int|float $amount): static - { - $color = static::mix($this, new static(50), $amount); - - return new static( - $color->r, - $color->g, - $color->b, - $this->a - ); - } - -} +getHSL(); + $l -= $l * $amount; + [$r, $g, $b] = static::HSL2RGB($h, $s, $l); + + return new static($r, $g, $b, $this->a); + } + + /** + * Invert the color. + * @return Color A new Color. + */ + public function invert(): static + { + return new static( + 255 - $this->r, + 255 - $this->g, + 255 - $this->b, + $this->a + ); + } + + /** + * Lighten the color by a specified amount. + * @param int|float $amount The amount to lighten the color by. (0, 1) + * @return Color A new Color. + */ + public function lighten(float|int $amount): static + { + [$h, $s, $l] = $this->getHSL(); + $l += (100 - $l) * $amount; + [$r, $g, $b] = static::HSL2RGB($h, $s, $l); + + return new static($r, $g, $b, $this->a); + } + + /** + * Shade the color by a specified amount. + * @param int|float $amount The amount to shade the color by. (0, 1) + * @return Color A new Color. + */ + public function shade(float|int $amount): static + { + $color = static::mix($this, new static(0), $amount); + + return new static( + $color->r, + $color->g, + $color->b, + $this->a + ); + } + + /** + * Tint the color by a specified amount. + * @param int|float $amount The amount to tint the color by. (0, 1) + * @return Color A new Color. + */ + public function tint(float|int $amount): static + { + $color = static::mix($this, new static(100), $amount); + + return new static( + $color->r, + $color->g, + $color->b, + $this->a + ); + } + + /** + * Tone the color by a specified amount. + * @param int|float $amount The amount to tone the color by. (0, 1) + * @return Color A new Color. + */ + public function tone(float|int $amount): static + { + $color = static::mix($this, new static(50), $amount); + + return new static( + $color->r, + $color->g, + $color->b, + $this->a + ); + } +} diff --git a/src/Traits/OutputTrait.php b/src/Traits/OutputTrait.php index c0b7fbb..5762ea8 100755 --- a/src/Traits/OutputTrait.php +++ b/src/Traits/OutputTrait.php @@ -1,121 +1,120 @@ -toString(); - } - - /** - * Get the closest color name for the color. - * @return string The name. - */ - public function label(): string - { - $closestDist = PHP_INT_MAX; - - foreach (static::COLORS AS $label => $color) { - $color = static::fromHexString($color); - $dist = static::dist($this, $color); - - if ($dist < $closestDist) { - $closest = $label; - $closestDist = $dist; - } - } - - return $closest; - } - - /** - * Return a hexadecimal string representation of the color. - * @return $string The hexadecimal string. - */ - public function toHexString(): string - { - $hex = $this->getHex(); - - return static::toHex($hex); - } - - /** - * Return a HSL/HSLA string representation of the color. - * @return string The HSL/HSLA string. - */ - public function toHSLString(): string - { - [$h, $s, $l] = static::RGB2HSL($this->r, $this->g, $this->b); - - $h = round($h); - $s = round($s); - $l = round($l); - $a = round($this->a * 100); - - if ($a < 100) { - return 'hsl('.$h.'deg '.$s.'% '.$l.'% / '.$a.'%)'; - } - - return 'hsl('.$h.'deg '.$s.'% '.$l.'%)'; - } - - /** - * Return a RGB/RGBA string representation of the color. - * @return string The RGB/RGBA string. - */ - public function toRGBString(): string - { - $r = round($this->r); - $g = round($this->g); - $b = round($this->b); - $a = round($this->a * 100); - - if ($a < 100) { - return 'rgb('.$r.' '.$g.' '.$b.' / '.$a.'%)'; - } - - return 'rgb('.$r.' '.$g.' '.$b.')'; - } - - /** - * Return a HTML string representation of the color. - * @return string The HTML color string. - */ - public function toString(): string - { - if (!$this->a) { - return 'transparent'; - } - - if ($this->a < 1) { - return $this->toRGBString(); - } - - $hex = $this->getHex(); - - $name = array_search($hex, static::COLORS); - - if ($name) { - return $name; - } - - return static::toHex($hex); - } - -} +toString(); + } + + /** + * Get the closest color name for the color. + * @return string The name. + */ + public function label(): string + { + $closestDist = PHP_INT_MAX; + + foreach (static::COLORS as $label => $color) { + $color = static::fromHexString($color); + $dist = static::dist($this, $color); + + if ($dist < $closestDist) { + $closest = $label; + $closestDist = $dist; + } + } + + return $closest; + } + + /** + * Return a hexadecimal string representation of the color. + * @return $string The hexadecimal string. + */ + public function toHexString(): string + { + $hex = $this->getHex(); + + return static::toHex($hex); + } + + /** + * Return a HSL/HSLA string representation of the color. + * @return string The HSL/HSLA string. + */ + public function toHSLString(): string + { + [$h, $s, $l] = static::RGB2HSL($this->r, $this->g, $this->b); + + $h = round($h); + $s = round($s); + $l = round($l); + $a = round($this->a * 100); + + if ($a < 100) { + return 'hsl('.$h.'deg '.$s.'% '.$l.'% / '.$a.'%)'; + } + + return 'hsl('.$h.'deg '.$s.'% '.$l.'%)'; + } + + /** + * Return a RGB/RGBA string representation of the color. + * @return string The RGB/RGBA string. + */ + public function toRGBString(): string + { + $r = round($this->r); + $g = round($this->g); + $b = round($this->b); + $a = round($this->a * 100); + + if ($a < 100) { + return 'rgb('.$r.' '.$g.' '.$b.' / '.$a.'%)'; + } + + return 'rgb('.$r.' '.$g.' '.$b.')'; + } + + /** + * Return a HTML string representation of the color. + * @return string The HTML color string. + */ + public function toString(): string + { + if (!$this->a) { + return 'transparent'; + } + + if ($this->a < 1) { + return $this->toRGBString(); + } + + $hex = $this->getHex(); + + $name = array_search($hex, static::COLORS); + + if ($name) { + return $name; + } + + return static::toHex($hex); + } +} diff --git a/src/Traits/PaletteTrait.php b/src/Traits/PaletteTrait.php index 77561da..b35ef61 100755 --- a/src/Traits/PaletteTrait.php +++ b/src/Traits/PaletteTrait.php @@ -1,73 +1,71 @@ - $this->shades($shades), - 'tints' => $this->tints($tints), - 'tones' => $this->tones($tones) - ]; - } - - /** - * Create an array with a specified number of shade variations. - * @param int $shades The number of shades to generate. - * @return array An array containing shade variations. - */ - public function shades(int $shades = 10): array - { - return array_map( - fn(int $value): Color => $this->shade($value / ($shades + 1)), - array_keys(array_fill(0, $shades, 0)) - ); - } - - /** - * Create an array with a specified number of tint variations. - * @param int $tints The number of tints to generate. - * @return array An array containing tint variations. - */ - public function tints(int $tints = 10): array - { - return array_map( - fn(int $value): Color => $this->tint($value / ($tints + 1)), - array_keys(array_fill(0, $tints, 0)) - ); - } - - /** - * Create an array with a specified number of tone variations. - * @param int $tones The number of tones to generate. - * @return array An array containing tone variations. - */ - public function tones(int $tones = 10): array - { - return array_map( - fn(int $value): Color => $this->tone($value / ($tones + 1)), - array_keys(array_fill(0, $tones, 0)) - ); - } - -} + $this->shades($shades), + 'tints' => $this->tints($tints), + 'tones' => $this->tones($tones) + ]; + } + + /** + * Create an array with a specified number of shade variations. + * @param int $shades The number of shades to generate. + * @return array An array containing shade variations. + */ + public function shades(int $shades = 10): array + { + return array_map( + fn(int $value): Color => $this->shade($value / ($shades + 1)), + array_keys(array_fill(0, $shades, 0)) + ); + } + + /** + * Create an array with a specified number of tint variations. + * @param int $tints The number of tints to generate. + * @return array An array containing tint variations. + */ + public function tints(int $tints = 10): array + { + return array_map( + fn(int $value): Color => $this->tint($value / ($tints + 1)), + array_keys(array_fill(0, $tints, 0)) + ); + } + + /** + * Create an array with a specified number of tone variations. + * @param int $tones The number of tones to generate. + * @return array An array containing tone variations. + */ + public function tones(int $tones = 10): array + { + return array_map( + fn(int $value): Color => $this->tone($value / ($tones + 1)), + array_keys(array_fill(0, $tones, 0)) + ); + } +} diff --git a/src/Traits/SchemesTrait.php b/src/Traits/SchemesTrait.php index ae08a30..7063a95 100755 --- a/src/Traits/SchemesTrait.php +++ b/src/Traits/SchemesTrait.php @@ -1,90 +1,88 @@ -r, $this->g, $this->b); - [$r1, $g1, $b1] = static::HSV2RGB($h + 30, $s, $v); - [$r2, $g2, $b2] = static::HSV2RGB($h - 30, $s, $v); - - return [ - new static($r1, $g1, $b1, $this->a), - new static($r2, $g2, $b2, $this->a) - ]; - } - - /** - * Create a complementary color variation. - * @return Color A complementary color variation. - */ - public function complementary(): static - { - [$h, $s, $v] = static::RGB2HSV($this->r, $this->g, $this->b); - [$r, $g, $b] = static::HSV2RGB($h + 180, $s, $v); - - return new static($r, $g, $b, $this->a); - } - - /** - * Create an array with 2 split color variations. - * @return array An array containing 2 split color variations. - */ - public function split(): array - { - [$h, $s, $v] = static::RGB2HSV($this->r, $this->g, $this->b); - [$r1, $g1, $b1] = static::HSV2RGB($h + 150, $s, $v); - [$r2, $g2, $b2] = static::HSV2RGB($h - 150, $s, $v); - - return [ - new static($r1, $g1, $b1, $this->a), - new static($r2, $g2, $b2, $this->a) - ]; - } - - /** - * Create an array with 3 tetradic color variations. - * @return array An array containing 3 tetradic color variations. - */ - public function tetradic(): array - { - [$h, $s, $v] = static::RGB2HSV($this->r, $this->g, $this->b); - [$r1, $g1, $b1] = static::HSV2RGB($h + 60, $s, $v); - [$r2, $g2, $b2] = static::HSV2RGB($h + 180, $s, $v); - [$r3, $g3, $b3] = static::HSV2RGB($h - 120, $s, $v); - - return [ - new static($r1, $g1, $b1, $this->a), - new static($r2, $g2, $b2, $this->a), - new static($r3, $g3, $b3, $this->a) - ]; - } - - /** - * Create an array with 2 triadic color variations. - * @return array An array containing 2 triadic color variations. - */ - public function triadic(): array - { - [$h, $s, $v] = static::RGB2HSV($this->r, $this->g, $this->b); - [$r1, $g1, $b1] = static::HSV2RGB($h + 120, $s, $v); - [$r2, $g2, $b2] = static::HSV2RGB($h - 120, $s, $v); - - return [ - new static($r1, $g1, $b1, $this->a), - new static($r2, $g2, $b2, $this->a) - ]; - } - -} +r, $this->g, $this->b); + [$r1, $g1, $b1] = static::HSV2RGB($h + 30, $s, $v); + [$r2, $g2, $b2] = static::HSV2RGB($h - 30, $s, $v); + + return [ + new static($r1, $g1, $b1, $this->a), + new static($r2, $g2, $b2, $this->a) + ]; + } + + /** + * Create a complementary color variation. + * @return Color A complementary color variation. + */ + public function complementary(): static + { + [$h, $s, $v] = static::RGB2HSV($this->r, $this->g, $this->b); + [$r, $g, $b] = static::HSV2RGB($h + 180, $s, $v); + + return new static($r, $g, $b, $this->a); + } + + /** + * Create an array with 2 split color variations. + * @return array An array containing 2 split color variations. + */ + public function split(): array + { + [$h, $s, $v] = static::RGB2HSV($this->r, $this->g, $this->b); + [$r1, $g1, $b1] = static::HSV2RGB($h + 150, $s, $v); + [$r2, $g2, $b2] = static::HSV2RGB($h - 150, $s, $v); + + return [ + new static($r1, $g1, $b1, $this->a), + new static($r2, $g2, $b2, $this->a) + ]; + } + + /** + * Create an array with 3 tetradic color variations. + * @return array An array containing 3 tetradic color variations. + */ + public function tetradic(): array + { + [$h, $s, $v] = static::RGB2HSV($this->r, $this->g, $this->b); + [$r1, $g1, $b1] = static::HSV2RGB($h + 60, $s, $v); + [$r2, $g2, $b2] = static::HSV2RGB($h + 180, $s, $v); + [$r3, $g3, $b3] = static::HSV2RGB($h - 120, $s, $v); + + return [ + new static($r1, $g1, $b1, $this->a), + new static($r2, $g2, $b2, $this->a), + new static($r3, $g3, $b3, $this->a) + ]; + } + + /** + * Create an array with 2 triadic color variations. + * @return array An array containing 2 triadic color variations. + */ + public function triadic(): array + { + [$h, $s, $v] = static::RGB2HSV($this->r, $this->g, $this->b); + [$r1, $g1, $b1] = static::HSV2RGB($h + 120, $s, $v); + [$r2, $g2, $b2] = static::HSV2RGB($h - 120, $s, $v); + + return [ + new static($r1, $g1, $b1, $this->a), + new static($r2, $g2, $b2, $this->a) + ]; + } +} diff --git a/src/Traits/StaticTrait.php b/src/Traits/StaticTrait.php index 29418bc..1cd8d1a 100755 --- a/src/Traits/StaticTrait.php +++ b/src/Traits/StaticTrait.php @@ -1,183 +1,182 @@ -luma(); - $luma2 = $color2->luma(); - - return (max($luma1, $luma2) + .05) / (min($luma1, $luma2) + .05); - } - - /** - * Calculate the distance between two colors. - * @param Color $color1 The first Color. - * @param Color $color2 The second Color. - * @return float The distance between the colors. - */ - public static function dist(Color $color1, Color $color2): float - { - return array_reduce([ - $color1->r - $color2->r, - $color1->g - $color2->g, - $color1->b - $color2->b - ], fn(float $x, float $y) => hypot($x, $y), 0); - } - - /** - * Find an optimally contrasting color for another color. - * @param Color $color1 The first Color. - * @param Color|null $color2 The second Color. - * @param int|float $minContrast The minimum contrast. - * @param int|float $stepSize The step size. - * @return Color|null The new Color. - */ - public static function findContrast(Color $color1, Color|null $color2 = null, int|float $minContrast = 4.5, int|float $stepSize = .01): Color|null - { - $color2 ??= $color1; - - if (static::contrast($color1, $color2) >= $minContrast) { - return $color2; - } - - $methods = ['tint', 'shade']; - for ($i = $stepSize; $i <= 1; $i += $stepSize) { - foreach ($methods AS $method) { - $tempColor = $color2->$method($i); - if (static::contrast($color1, $tempColor) >= $minContrast) { - return $tempColor; - } - } - } - - return null; - } - - /** - * Create a new Color by mixing two colors together by a specified amount. - * @param Color $color1 The first Color. - * @param Color $color2 The second Color. - * @param int|float $amount The amount to mix them by. (0, 1) - * @return Color A new Color. - */ - public static function mix(Color $color1, Color $color2, int|float $amount): static - { - return new static( - static::lerp($color1->r, $color2->r, $amount), - static::lerp($color1->g, $color2->g, $amount), - static::lerp($color1->b, $color2->b, $amount), - static::lerp($color1->a, $color2->a, $amount) - ); - } - - /** - * Create a new Color by multiplying two colors together by a specified amount. - * @param Color $color1 The first Color. - * @param Color $color2 The second Color. - * @param int|float $amount The amount to multiply them by. (0, 1) - * @return Color A new Color. - */ - public static function multiply(Color $color1, Color $color2, int|float $amount): static - { - return new static( - static::lerp( - $color1->r, - $color1->r * $color2->r / 255, - $amount - ), - static::lerp( - $color1->g, - $color1->g * $color2->g / 255, - $amount - ), - static::lerp( - $color1->b, - $color1->b * $color2->b / 255, - $amount - ), - static::lerp( - $color1->a, - $color1->a * $color2->a, - $amount - ) - ); - } - - /** - * Clamp a value between a min and max. - * @param int|float $value The value to clamp. - * @param int|float $min The minimum value of the clamped range. - * @param int|float $max The maximum value of the clamped range. - * @return float The clamped value. - */ - protected static function clamp(int|float $val, int|float $min = 0, int|float $max = 100): float - { - return (float) max($min, min($max, $val)); - } - - /** - * Linear interpolation from one value to another. - * @param int|float $v1 The starting value. - * @param int|float $v2 The ending value. - * @param int|float $amount The amount to interpolate. - * @return float The interpolated value. - */ - protected static function lerp(int|float $a, int|float $b, int|float $amount): float - { - return round($a * (1 - $amount) + $b * $amount, 2); - } - - /** - * Shorten a hex string (if possible). - * @param string $hex The hex string. - * @return string The hex string. - */ - protected static function toHex(string $hex) { - $length = strlen($hex); - - if ( - $length === 9 && - $hex[1] === $hex[2] && - $hex[3] === $hex[4] && - $hex[5] === $hex[6] && - $hex[7] === $hex[8] - ) { - return '#'.$hex[1].$hex[3].$hex[5].$hex[7]; - } - - if ( - $length === 7 && - $hex[1] === $hex[2] && - $hex[3] === $hex[4] && - $hex[5] === $hex[6] - ) { - return '#'.$hex[1].$hex[3].$hex[5]; - } - - return $hex; - } - -} +luma(); + $luma2 = $color2->luma(); + + return (max($luma1, $luma2) + .05) / (min($luma1, $luma2) + .05); + } + + /** + * Calculate the distance between two colors. + * @param Color $color1 The first Color. + * @param Color $color2 The second Color. + * @return float The distance between the colors. + */ + public static function dist(Color $color1, Color $color2): float + { + return array_reduce([ + $color1->r - $color2->r, + $color1->g - $color2->g, + $color1->b - $color2->b + ], fn(float $x, float $y) => hypot($x, $y), 0); + } + + /** + * Find an optimally contrasting color for another color. + * @param Color $color1 The first Color. + * @param Color|null $color2 The second Color. + * @param int|float $minContrast The minimum contrast. + * @param int|float $stepSize The step size. + * @return Color|null The new Color. + */ + public static function findContrast(Color $color1, Color|null $color2 = null, float|int $minContrast = 4.5, float|int $stepSize = .01): Color|null + { + $color2 ??= $color1; + + if (static::contrast($color1, $color2) >= $minContrast) { + return $color2; + } + + $methods = ['tint', 'shade']; + for ($i = $stepSize; $i <= 1; $i += $stepSize) { + foreach ($methods as $method) { + $tempColor = $color2->$method($i); + if (static::contrast($color1, $tempColor) >= $minContrast) { + return $tempColor; + } + } + } + + return null; + } + + /** + * Create a new Color by mixing two colors together by a specified amount. + * @param Color $color1 The first Color. + * @param Color $color2 The second Color. + * @param int|float $amount The amount to mix them by. (0, 1) + * @return Color A new Color. + */ + public static function mix(Color $color1, Color $color2, float|int $amount): static + { + return new static( + static::lerp($color1->r, $color2->r, $amount), + static::lerp($color1->g, $color2->g, $amount), + static::lerp($color1->b, $color2->b, $amount), + static::lerp($color1->a, $color2->a, $amount) + ); + } + + /** + * Create a new Color by multiplying two colors together by a specified amount. + * @param Color $color1 The first Color. + * @param Color $color2 The second Color. + * @param int|float $amount The amount to multiply them by. (0, 1) + * @return Color A new Color. + */ + public static function multiply(Color $color1, Color $color2, float|int $amount): static + { + return new static( + static::lerp( + $color1->r, + $color1->r * $color2->r / 255, + $amount + ), + static::lerp( + $color1->g, + $color1->g * $color2->g / 255, + $amount + ), + static::lerp( + $color1->b, + $color1->b * $color2->b / 255, + $amount + ), + static::lerp( + $color1->a, + $color1->a * $color2->a, + $amount + ) + ); + } + + /** + * Clamp a value between a min and max. + * @param int|float $min The minimum value of the clamped range. + * @param int|float $max The maximum value of the clamped range. + * @param int|float $value The value to clamp. + * @return float The clamped value. + */ + protected static function clamp(float|int $val, float|int $min = 0, float|int $max = 100): float + { + return (float) max($min, min($max, $val)); + } + + /** + * Linear interpolation from one value to another. + * @param int|float $amount The amount to interpolate. + * @param int|float $v1 The starting value. + * @param int|float $v2 The ending value. + * @return float The interpolated value. + */ + protected static function lerp(float|int $a, float|int $b, float|int $amount): float + { + return round($a * (1 - $amount) + $b * $amount, 2); + } + + /** + * Shorten a hex string (if possible). + * @param string $hex The hex string. + * @return string The hex string. + */ + protected static function toHex(string $hex) + { + $length = strlen($hex); + + if ( + $length === 9 && + $hex[1] === $hex[2] && + $hex[3] === $hex[4] && + $hex[5] === $hex[6] && + $hex[7] === $hex[8] + ) { + return '#'.$hex[1].$hex[3].$hex[5].$hex[7]; + } + + if ( + $length === 7 && + $hex[1] === $hex[2] && + $hex[3] === $hex[4] && + $hex[5] === $hex[6] + ) { + return '#'.$hex[1].$hex[3].$hex[5]; + } + + return $hex; + } +} diff --git a/src/Traits/UtilityTrait.php b/src/Traits/UtilityTrait.php index 8f6be51..5fa7912 100755 --- a/src/Traits/UtilityTrait.php +++ b/src/Traits/UtilityTrait.php @@ -1,50 +1,48 @@ -r); - $g = round($this->g); - $b = round($this->b); - - if ($this->a < 1) { - return sprintf('#%02x%02x%02x%02x', $r, $g, $b, $this->a * 255); - } - - return sprintf('#%02x%02x%02x', $r, $g, $b); - } - - /** - * Get the HSL values of the Colour. - * @return array The HSL values. - */ - protected function getHSL(): array - { - return static::RGB2HSL($this->r, $this->g, $this->b); - } - - /** - * Get the HSV values of the Colour. - * @return array The HSV values. - */ - protected function getHSV(): array - { - return static::RGB2HSV($this->r, $this->g, $this->b); - } - -} +r); + $g = round($this->g); + $b = round($this->b); + + if ($this->a < 1) { + return sprintf('#%02x%02x%02x%02x', $r, $g, $b, $this->a * 255); + } + + return sprintf('#%02x%02x%02x', $r, $g, $b); + } + + /** + * Get the HSL values of the Colour. + * @return array The HSL values. + */ + protected function getHSL(): array + { + return static::RGB2HSL($this->r, $this->g, $this->b); + } + + /** + * Get the HSV values of the Colour. + * @return array The HSV values. + */ + protected function getHSV(): array + { + return static::RGB2HSV($this->r, $this->g, $this->b); + } +} diff --git a/tests/AttributesTestTrait.php b/tests/AttributesTestTrait.php index 8d27038..fdf362f 100644 --- a/tests/AttributesTestTrait.php +++ b/tests/AttributesTestTrait.php @@ -1,115 +1,113 @@ -assertSame( - .75, - Color::fromRGB(0, 0, 0, .75)->getAlpha() - ); - } - - public function testGetBrightness(): void - { - $this->assertSame( - 75.0, - Color::fromHSV(180, 50, 75)->getBrightness() - ); - } - - public function testGetHue(): void - { - $this->assertSame( - 270.0, - Color::fromHSV(270, 50, 50)->getHue() - ); - } - - public function testGetSaturation(): void - { - $this->assertSame( - 25.0, - Color::fromHSV(180, 25, 50)->getSaturation() - ); - } - - public function testLuma(): void - { - $this->assertSame( - .17935225036098287, - Color::fromHSV(180, 50, 50)->luma() - ); - } - - public function testSetAlpha(): void - { - $color1 = Color::fromHSV(120, 50, 50); - $color2 = $color1->setAlpha(.75); - - $this->assertSame( - 1.0, - $color1->getAlpha(), - ); - - $this->assertSame( - .75, - $color2->getAlpha(), - ); - } - - public function testSetBrightness(): void - { - $color1 = Color::fromHSV(120, 50, 50); - $color2 = $color1->setBrightness(75); - - $this->assertSame( - 50.0, - $color1->getBrightness(), - ); - - $this->assertSame( - 75.0, - $color2->getBrightness(), - ); - } - - public function testSetHue(): void - { - $color1 = Color::fromHSV(120, 50, 50); - $color2 = $color1->setHue(270); - - $this->assertSame( - 120.0, - $color1->getHue(), - ); - - $this->assertSame( - 270.0, - $color2->getHue(), - ); - } - - public function testSetSaturation(): void - { - $color1 = Color::fromHSV(120, 50, 50); - $color2 = $color1->setSaturation(25); - - $this->assertSame( - 50.0, - $color1->getSaturation(), - ); - - $this->assertSame( - 25.0, - $color2->getSaturation(), - ); - } - -} +assertSame( + .75, + Color::fromRGB(0, 0, 0, .75)->getAlpha() + ); + } + + public function testGetBrightness(): void + { + $this->assertSame( + 75.0, + Color::fromHSV(180, 50, 75)->getBrightness() + ); + } + + public function testGetHue(): void + { + $this->assertSame( + 270.0, + Color::fromHSV(270, 50, 50)->getHue() + ); + } + + public function testGetSaturation(): void + { + $this->assertSame( + 25.0, + Color::fromHSV(180, 25, 50)->getSaturation() + ); + } + + public function testLuma(): void + { + $this->assertSame( + .17935225036098287, + Color::fromHSV(180, 50, 50)->luma() + ); + } + + public function testSetAlpha(): void + { + $color1 = Color::fromHSV(120, 50, 50); + $color2 = $color1->setAlpha(.75); + + $this->assertSame( + 1.0, + $color1->getAlpha(), + ); + + $this->assertSame( + .75, + $color2->getAlpha(), + ); + } + + public function testSetBrightness(): void + { + $color1 = Color::fromHSV(120, 50, 50); + $color2 = $color1->setBrightness(75); + + $this->assertSame( + 50.0, + $color1->getBrightness(), + ); + + $this->assertSame( + 75.0, + $color2->getBrightness(), + ); + } + + public function testSetHue(): void + { + $color1 = Color::fromHSV(120, 50, 50); + $color2 = $color1->setHue(270); + + $this->assertSame( + 120.0, + $color1->getHue(), + ); + + $this->assertSame( + 270.0, + $color2->getHue(), + ); + } + + public function testSetSaturation(): void + { + $color1 = Color::fromHSV(120, 50, 50); + $color2 = $color1->setSaturation(25); + + $this->assertSame( + 50.0, + $color1->getSaturation(), + ); + + $this->assertSame( + 25.0, + $color2->getSaturation(), + ); + } +} diff --git a/tests/ColorTest.php b/tests/ColorTest.php index 16b4e93..03c1c3c 100644 --- a/tests/ColorTest.php +++ b/tests/ColorTest.php @@ -1,19 +1,18 @@ -assertSame( - 'red', - (new Color(255, 0, 0))->toString() - ); - } - - public function testConstructorGreen(): void - { - $this->assertSame( - 'lime', - (new Color(0, 255, 0))->toString() - ); - } - - public function testConstructorBlue(): void - { - $this->assertSame( - 'blue', - (new Color(0, 0, 255))->toString() - ); - } - - public function testConstructorAlpha(): void - { - $this->assertSame( - 'rgb(255 255 255 / 50%)', - (new Color(255, 255, 255, .5))->toString() - ); - } - - public function testConstructorBrightness(): void - { - $this->assertSame( - 'white', - (new Color(100))->toString() - ); - } - - public function testConstructorBrightnessAlpha(): void - { - $this->assertSame( - 'rgb(255 255 255 / 50%)', - (new Color(100, .5))->toString() - ); - } - - public function testFromStringColorName(): void - { - $this->assertSame( - 'red', - Color::fromString('red')->toString() - ); - } - - public function testFromStringHex(): void - { - $this->assertSame( - 'red', - Color::fromString('#ff0000')->toString() - ); - } - - public function testFromStringShortHex(): void - { - $this->assertSame( - 'red', - Color::fromString('#f00')->toString() - ); - } - - public function testFromStringRGB(): void - { - $this->assertSame( - 'red', - Color::fromString('rgb(255 0 0)')->toString() - ); - } - - public function testFromStringRGBAlt(): void - { - $this->assertSame( - 'red', - Color::fromString('rgb(255, 0, 0)')->toString() - ); - } - - public function testFromStringRGBA(): void - { - $this->assertSame( - 'red', - Color::fromString('rgb(255 0 0 / 100%)')->toString() - ); - } - - public function testFromStringRGBAAlt(): void - { - $this->assertSame( - 'red', - Color::fromString('rgba(255, 0, 0, 1)')->toString() - ); - } - - public function testFromStringHSL(): void - { - $this->assertSame( - '#9cc9b6', - Color::fromString('hsl(155deg 30% 70%)')->toString() - ); - } - - public function testFromStringHSLAlt(): void - { - $this->assertSame( - '#9cc9b6', - Color::fromString('hsl(155, 30%, 70%)')->toString() - ); - } - - public function testFromStringHSLA(): void - { - $this->assertSame( - 'rgb(0 153 153 / 50%)', - Color::fromString('hsl(180deg 100% 30% / 50%)')->toString() - ); - } - - public function testFromStringHSLAAlt(): void - { - $this->assertSame( - 'rgb(0 153 153 / 50%)', - Color::fromString('hsla(180, 100%, 30%, .5)')->toString() - ); - } - - public function testFromStringInvalidHex(): void - { - $this->expectException(RuntimeException::class); - - Color::fromString('#INVALID'); - } - - public function testFromStringInvalidRGB(): void - { - $this->expectException(RuntimeException::class); - - Color::fromString('rgb(INVALID)'); - } - - public function testFromStringInvalidRGBA(): void - { - $this->expectException(RuntimeException::class); - - Color::fromString('rgba(INVALID)'); - } - - public function testFromStringInvalidHSL(): void - { - $this->expectException(RuntimeException::class); - - Color::fromString('hsl(INVALID)'); - } - - public function testFromStringInvalidHSLA(): void - { - $this->expectException(RuntimeException::class); - - Color::fromString('hsl(INVALID)'); - } - - public function testFromStringInvalid(): void - { - $this->expectException(RuntimeException::class); - - Color::fromString('INVALID'); - } - - public function testFromRGB(): void - { - $this->assertSame( - '#9b1e46', - Color::fromRGB(155, 30, 70)->toString() - ); - } - - public function testFromRGBWithAlpha(): void - { - $this->assertSame( - 'rgb(180 100 30 / 50%)', - Color::fromRGB(180, 100, 30, .5)->toString() - ); - } - - public function testFromHSL(): void - { - $this->assertSame( - '#9cc9b6', - Color::fromHSL(155, 30, 70)->toString() - ); - } - - public function testFromHSLWithAlpha(): void - { - $this->assertSame( - 'rgb(0 153 153 / 50%)', - Color::fromHSL(180, 100, 30, .5)->toString() - ); - } - - public function testFromHSV(): void - { - $this->assertSame( - '#7db39c', - Color::fromHSV(155, 30, 70)->toString() - ); - } - - public function testFromHSVWithAlpha(): void - { - $this->assertSame( - 'rgb(0 77 77 / 50%)', - Color::fromHSV(180, 100, 30, .5)->toString() - ); - } - - public function testFromCMY(): void - { - $this->assertSame( - '#3bd9a6', - Color::fromCMY(77, 15, 35)->toString() - ); - } - - public function testFromCMYWithAlpha(): void - { - $this->assertSame( - 'rgb(26 128 217 / 50%)', - Color::fromCMY(90, 50, 15, .5)->toString() - ); - } - - public function testFromCMYK(): void - { - $this->assertSame( - '#20775b', - Color::fromCMYK(77, 15, 35, 45)->toString() - ); - } - - public function testFromCMYKWithAlpha(): void - { - $this->assertSame( - 'rgb(11 57 98 / 50%)', - Color::fromCMYK(90, 50, 15, 55, .5)->toString() - ); - } - -} +assertSame( + 'rgb(255 255 255 / 50%)', + (new Color(255, 255, 255, .5))->toString() + ); + } + + public function testConstructorBlue(): void + { + $this->assertSame( + 'blue', + (new Color(0, 0, 255))->toString() + ); + } + + public function testConstructorBrightness(): void + { + $this->assertSame( + 'white', + (new Color(100))->toString() + ); + } + + public function testConstructorBrightnessAlpha(): void + { + $this->assertSame( + 'rgb(255 255 255 / 50%)', + (new Color(100, .5))->toString() + ); + } + + public function testConstructorGreen(): void + { + $this->assertSame( + 'lime', + (new Color(0, 255, 0))->toString() + ); + } + + public function testConstructorRed(): void + { + $this->assertSame( + 'red', + (new Color(255, 0, 0))->toString() + ); + } + + public function testFromCMY(): void + { + $this->assertSame( + '#3bd9a6', + Color::fromCMY(77, 15, 35)->toString() + ); + } + + public function testFromCMYK(): void + { + $this->assertSame( + '#20775b', + Color::fromCMYK(77, 15, 35, 45)->toString() + ); + } + + public function testFromCMYKWithAlpha(): void + { + $this->assertSame( + 'rgb(11 57 98 / 50%)', + Color::fromCMYK(90, 50, 15, 55, .5)->toString() + ); + } + + public function testFromCMYWithAlpha(): void + { + $this->assertSame( + 'rgb(26 128 217 / 50%)', + Color::fromCMY(90, 50, 15, .5)->toString() + ); + } + + public function testFromHSL(): void + { + $this->assertSame( + '#9cc9b6', + Color::fromHSL(155, 30, 70)->toString() + ); + } + + public function testFromHSLWithAlpha(): void + { + $this->assertSame( + 'rgb(0 153 153 / 50%)', + Color::fromHSL(180, 100, 30, .5)->toString() + ); + } + + public function testFromHSV(): void + { + $this->assertSame( + '#7db39c', + Color::fromHSV(155, 30, 70)->toString() + ); + } + + public function testFromHSVWithAlpha(): void + { + $this->assertSame( + 'rgb(0 77 77 / 50%)', + Color::fromHSV(180, 100, 30, .5)->toString() + ); + } + + public function testFromRGB(): void + { + $this->assertSame( + '#9b1e46', + Color::fromRGB(155, 30, 70)->toString() + ); + } + + public function testFromRGBWithAlpha(): void + { + $this->assertSame( + 'rgb(180 100 30 / 50%)', + Color::fromRGB(180, 100, 30, .5)->toString() + ); + } + + public function testFromStringColorName(): void + { + $this->assertSame( + 'red', + Color::fromString('red')->toString() + ); + } + + public function testFromStringHex(): void + { + $this->assertSame( + 'red', + Color::fromString('#ff0000')->toString() + ); + } + + public function testFromStringHSL(): void + { + $this->assertSame( + '#9cc9b6', + Color::fromString('hsl(155deg 30% 70%)')->toString() + ); + } + + public function testFromStringHSLA(): void + { + $this->assertSame( + 'rgb(0 153 153 / 50%)', + Color::fromString('hsl(180deg 100% 30% / 50%)')->toString() + ); + } + + public function testFromStringHSLAAlt(): void + { + $this->assertSame( + 'rgb(0 153 153 / 50%)', + Color::fromString('hsla(180, 100%, 30%, .5)')->toString() + ); + } + + public function testFromStringHSLAlt(): void + { + $this->assertSame( + '#9cc9b6', + Color::fromString('hsl(155, 30%, 70%)')->toString() + ); + } + + public function testFromStringInvalid(): void + { + $this->expectException(RuntimeException::class); + + Color::fromString('INVALID'); + } + + public function testFromStringInvalidHex(): void + { + $this->expectException(RuntimeException::class); + + Color::fromString('#INVALID'); + } + + public function testFromStringInvalidHSL(): void + { + $this->expectException(RuntimeException::class); + + Color::fromString('hsl(INVALID)'); + } + + public function testFromStringInvalidHSLA(): void + { + $this->expectException(RuntimeException::class); + + Color::fromString('hsl(INVALID)'); + } + + public function testFromStringInvalidRGB(): void + { + $this->expectException(RuntimeException::class); + + Color::fromString('rgb(INVALID)'); + } + + public function testFromStringInvalidRGBA(): void + { + $this->expectException(RuntimeException::class); + + Color::fromString('rgba(INVALID)'); + } + + public function testFromStringRGB(): void + { + $this->assertSame( + 'red', + Color::fromString('rgb(255 0 0)')->toString() + ); + } + + public function testFromStringRGBA(): void + { + $this->assertSame( + 'red', + Color::fromString('rgb(255 0 0 / 100%)')->toString() + ); + } + + public function testFromStringRGBAAlt(): void + { + $this->assertSame( + 'red', + Color::fromString('rgba(255, 0, 0, 1)')->toString() + ); + } + + public function testFromStringRGBAlt(): void + { + $this->assertSame( + 'red', + Color::fromString('rgb(255, 0, 0)')->toString() + ); + } + + public function testFromStringShortHex(): void + { + $this->assertSame( + 'red', + Color::fromString('#f00')->toString() + ); + } +} diff --git a/tests/FormattingTestTrait.php b/tests/FormattingTestTrait.php index 7386b28..a2d81f3 100644 --- a/tests/FormattingTestTrait.php +++ b/tests/FormattingTestTrait.php @@ -1,83 +1,81 @@ -assertSame( - '#111', - Color::fromRGB(17, 17, 17)->toHexString() - ); - } - - public function testToHexShortWithAlpha(): void - { - $this->assertSame( - '#1116', - Color::fromRGB(17, 17, 17, .4)->toHexString() - ); - } - - public function testToHex(): void - { - $this->assertSame( - '#783232', - Color::fromRGB(120, 50, 50)->toHexString() - ); - } - - public function testToHexWithAlpha(): void - { - $this->assertSame( - '#78323266', - Color::fromRGB(120, 50, 50, .4)->toHexString() - ); - } - - public function testToRGB(): void - { - $this->assertSame( - 'rgb(120 50 50)', - Color::fromRGB(120, 50, 50)->toRGBString() - ); - } - - public function testToRGBA(): void - { - $this->assertSame( - 'rgb(120 50 50 / 50%)', - Color::fromRGB(120, 50, 50, .5)->toRGBString() - ); - } - - public function testToHSL(): void - { - $this->assertSame( - 'hsl(120deg 50% 50%)', - Color::fromHSL(120, 50, 50)->toHSLString() - ); - } - - public function testToHSLA(): void - { - $this->assertSame( - 'hsl(120deg 50% 50% / 50%)', - Color::fromHSL(120, 50, 50, .5)->toHSLString() - ); - } - - public function testLabel(): void - { - $this->assertSame( - 'saddlebrown', - Color::fromRGB(120, 50, 50)->label() - ); - } - -} +assertSame( + 'saddlebrown', + Color::fromRGB(120, 50, 50)->label() + ); + } + + public function testToHex(): void + { + $this->assertSame( + '#783232', + Color::fromRGB(120, 50, 50)->toHexString() + ); + } + + public function testToHexShort(): void + { + $this->assertSame( + '#111', + Color::fromRGB(17, 17, 17)->toHexString() + ); + } + + public function testToHexShortWithAlpha(): void + { + $this->assertSame( + '#1116', + Color::fromRGB(17, 17, 17, .4)->toHexString() + ); + } + + public function testToHexWithAlpha(): void + { + $this->assertSame( + '#78323266', + Color::fromRGB(120, 50, 50, .4)->toHexString() + ); + } + + public function testToHSL(): void + { + $this->assertSame( + 'hsl(120deg 50% 50%)', + Color::fromHSL(120, 50, 50)->toHSLString() + ); + } + + public function testToHSLA(): void + { + $this->assertSame( + 'hsl(120deg 50% 50% / 50%)', + Color::fromHSL(120, 50, 50, .5)->toHSLString() + ); + } + + public function testToRGB(): void + { + $this->assertSame( + 'rgb(120 50 50)', + Color::fromRGB(120, 50, 50)->toRGBString() + ); + } + + public function testToRGBA(): void + { + $this->assertSame( + 'rgb(120 50 50 / 50%)', + Color::fromRGB(120, 50, 50, .5)->toRGBString() + ); + } +} diff --git a/tests/ManipulationTestTrait.php b/tests/ManipulationTestTrait.php index f6e7c3f..a54d1dc 100644 --- a/tests/ManipulationTestTrait.php +++ b/tests/ManipulationTestTrait.php @@ -1,107 +1,105 @@ -darken(.5); - - $this->assertSame( - '#408040', - $color1->toString() - ); - - $this->assertSame( - '#204020', - $color2->toString(), - ); - } - - public function testInvert(): void - { - $color1 = Color::fromHSV(120, 50, 50); - $color2 = $color1->invert(); - - $this->assertSame( - '#408040', - $color1->toString() - ); - - $this->assertSame( - '#bf80bf', - $color2->toString(), - ); - } - - public function testLighten(): void - { - $color1 = Color::fromHSV(120, 50, 50); - $color2 = $color1->lighten(.5); - - $this->assertSame( - '#408040', - $color1->toString() - ); - - $this->assertSame( - '#95ca95', - $color2->toString(), - ); - } - - public function testShade(): void - { - $color1 = Color::fromHSV(120, 50, 50); - $color2 = $color1->shade(.3); - - $this->assertSame( - '#408040', - $color1->toString() - ); - - $this->assertSame( - '#2d592d', - $color2->toString(), - ); - } - - public function testTint(): void - { - $color1 = Color::fromHSV(120, 50, 50); - $color2 = $color1->tint(.3); - - $this->assertSame( - '#408040', - $color1->toString() - ); - - $this->assertSame( - '#79a679', - $color2->toString(), - ); - } - - public function testTone(): void - { - $color1 = Color::fromHSV(120, 50, 50); - $color2 = $color1->tone(.3); - - $this->assertSame( - '#408040', - $color1->toString() - ); - - $this->assertSame( - '#538053', - $color2->toString(), - ); - } - -} +darken(.5); + + $this->assertSame( + '#408040', + $color1->toString() + ); + + $this->assertSame( + '#204020', + $color2->toString(), + ); + } + + public function testInvert(): void + { + $color1 = Color::fromHSV(120, 50, 50); + $color2 = $color1->invert(); + + $this->assertSame( + '#408040', + $color1->toString() + ); + + $this->assertSame( + '#bf80bf', + $color2->toString(), + ); + } + + public function testLighten(): void + { + $color1 = Color::fromHSV(120, 50, 50); + $color2 = $color1->lighten(.5); + + $this->assertSame( + '#408040', + $color1->toString() + ); + + $this->assertSame( + '#95ca95', + $color2->toString(), + ); + } + + public function testShade(): void + { + $color1 = Color::fromHSV(120, 50, 50); + $color2 = $color1->shade(.3); + + $this->assertSame( + '#408040', + $color1->toString() + ); + + $this->assertSame( + '#2d592d', + $color2->toString(), + ); + } + + public function testTint(): void + { + $color1 = Color::fromHSV(120, 50, 50); + $color2 = $color1->tint(.3); + + $this->assertSame( + '#408040', + $color1->toString() + ); + + $this->assertSame( + '#79a679', + $color2->toString(), + ); + } + + public function testTone(): void + { + $color1 = Color::fromHSV(120, 50, 50); + $color2 = $color1->tone(.3); + + $this->assertSame( + '#408040', + $color1->toString() + ); + + $this->assertSame( + '#538053', + $color2->toString(), + ); + } +} diff --git a/tests/PaletteTestTrait.php b/tests/PaletteTestTrait.php index 835f511..ab625fe 100644 --- a/tests/PaletteTestTrait.php +++ b/tests/PaletteTestTrait.php @@ -1,253 +1,251 @@ -assertSame( - [ - '#408040', - '#3a743a', - '#346834', - '#2e5d2e', - '#295129', - '#234623', - '#1d3a1d', - '#172e17', - '#112311', - '#0c170c' - ], - array_map( - fn(Color $color): string => (string) $color, - Color::fromHSV(120, 50, 50)->shades() - ) - ); - } - - public function testShadesArg(): void - { - $this->assertSame( - [ - '#408040', - '#356a35', - '#2b552b', - '#204020', - '#152b15' - ], - array_map( - fn(Color $color): string => (string) $color, - Color::fromHSV(120, 50, 50)->shades(5) - ) - ); - } - - public function testTints(): void - { - $this->assertSame( - [ - '#408040', - '#518b51', - '#639763', - '#74a274', - '#85ae85', - '#97b997', - '#a8c5a8', - '#b9d1b9', - '#cbdccb', - '#dce8dc' - ], - array_map( - fn(Color $color): string => (string) $color, - Color::fromHSV(120, 50, 50)->tints() - ) - ); - } - - public function testTintsArg(): void - { - $this->assertSame( - [ - '#408040', - '#609560', - '#80aa80', - '#9fbf9f', - '#bfd5bf' - ], - array_map( - fn(Color $color): string => (string) $color, - Color::fromHSV(120, 50, 50)->tints(5) - ) - ); - } - - public function testTones(): void - { - $this->assertSame( - [ - '#408040', - '#468046', - '#4b804b', - '#518051', - '#578057', - '#5d805d', - '#638063', - '#688068', - '#6e806e', - '#748074' - ], - array_map( - fn(Color $color): string => (string) $color, - Color::fromHSV(120, 50, 50)->tones() - ) - ); - } - - public function testTonesArg(): void - { - $this->assertSame( - [ - '#408040', - '#4a804a', - '#558055', - '#608060', - '#6a806a' - ], - array_map( - fn(Color $color): string => (string) $color, - Color::fromHSV(120, 50, 50)->tones(5) - ) - ); - } - - public function testPalette(): void - { - $this->assertSame( - [ - 'shades' => [ - '#408040', - '#3a743a', - '#346834', - '#2e5d2e', - '#295129', - '#234623', - '#1d3a1d', - '#172e17', - '#112311', - '#0c170c' - ], - 'tints' => [ - '#408040', - '#518b51', - '#639763', - '#74a274', - '#85ae85', - '#97b997', - '#a8c5a8', - '#b9d1b9', - '#cbdccb', - '#dce8dc' - ], - 'tones' => [ - '#408040', - '#468046', - '#4b804b', - '#518051', - '#578057', - '#5d805d', - '#638063', - '#688068', - '#6e806e', - '#748074' - ] - ], - array_map( - fn(array $palette): array => array_map( - fn(Color $color): string => (string) $color, - $palette - ), - Color::fromHSV(120, 50, 50)->palette() - ) - ); - } - - public function testPaletteShades(): void - { - $this->assertSame( - [ - 'shades' => [ - '#408040', - '#356a35', - '#2b552b', - '#204020', - '#152b15' - ], - 'tints' => [], - 'tones' => [] - ], - array_map( - fn(array $palette): array => array_map( - fn(Color $color): string => (string) $color, - $palette - ), - Color::fromHSV(120, 50, 50)->palette(5, 0, 0) - ) - ); - } - - public function testPaletteTints(): void - { - $this->assertSame( - [ - 'shades' => [], - 'tints' => [ - '#408040', - '#609560', - '#80aa80', - '#9fbf9f', - '#bfd5bf' - ], - 'tones' => [] - ], - array_map( - fn(array $palette): array => array_map( - fn(Color $color): string => (string) $color, - $palette - ), - Color::fromHSV(120, 50, 50)->palette(0, 5, 0) - ) - ); - } - - public function testPaletteTones(): void - { - $this->assertSame( - [ - 'shades' => [], - 'tints' => [], - 'tones' => [ - '#408040', - '#4a804a', - '#558055', - '#608060', - '#6a806a' - ] - ], - array_map( - fn(array $palette): array => array_map( - fn(Color $color): string => (string) $color, - $palette - ), - Color::fromHSV(120, 50, 50)->palette(0, 0, 5) - ) - ); - } - -} +assertSame( + [ + 'shades' => [ + '#408040', + '#3a743a', + '#346834', + '#2e5d2e', + '#295129', + '#234623', + '#1d3a1d', + '#172e17', + '#112311', + '#0c170c' + ], + 'tints' => [ + '#408040', + '#518b51', + '#639763', + '#74a274', + '#85ae85', + '#97b997', + '#a8c5a8', + '#b9d1b9', + '#cbdccb', + '#dce8dc' + ], + 'tones' => [ + '#408040', + '#468046', + '#4b804b', + '#518051', + '#578057', + '#5d805d', + '#638063', + '#688068', + '#6e806e', + '#748074' + ] + ], + array_map( + fn(array $palette): array => array_map( + fn(Color $color): string => (string) $color, + $palette + ), + Color::fromHSV(120, 50, 50)->palette() + ) + ); + } + + public function testPaletteShades(): void + { + $this->assertSame( + [ + 'shades' => [ + '#408040', + '#356a35', + '#2b552b', + '#204020', + '#152b15' + ], + 'tints' => [], + 'tones' => [] + ], + array_map( + fn(array $palette): array => array_map( + fn(Color $color): string => (string) $color, + $palette + ), + Color::fromHSV(120, 50, 50)->palette(5, 0, 0) + ) + ); + } + + public function testPaletteTints(): void + { + $this->assertSame( + [ + 'shades' => [], + 'tints' => [ + '#408040', + '#609560', + '#80aa80', + '#9fbf9f', + '#bfd5bf' + ], + 'tones' => [] + ], + array_map( + fn(array $palette): array => array_map( + fn(Color $color): string => (string) $color, + $palette + ), + Color::fromHSV(120, 50, 50)->palette(0, 5, 0) + ) + ); + } + + public function testPaletteTones(): void + { + $this->assertSame( + [ + 'shades' => [], + 'tints' => [], + 'tones' => [ + '#408040', + '#4a804a', + '#558055', + '#608060', + '#6a806a' + ] + ], + array_map( + fn(array $palette): array => array_map( + fn(Color $color): string => (string) $color, + $palette + ), + Color::fromHSV(120, 50, 50)->palette(0, 0, 5) + ) + ); + } + + public function testShades(): void + { + $this->assertSame( + [ + '#408040', + '#3a743a', + '#346834', + '#2e5d2e', + '#295129', + '#234623', + '#1d3a1d', + '#172e17', + '#112311', + '#0c170c' + ], + array_map( + fn(Color $color): string => (string) $color, + Color::fromHSV(120, 50, 50)->shades() + ) + ); + } + + public function testShadesArg(): void + { + $this->assertSame( + [ + '#408040', + '#356a35', + '#2b552b', + '#204020', + '#152b15' + ], + array_map( + fn(Color $color): string => (string) $color, + Color::fromHSV(120, 50, 50)->shades(5) + ) + ); + } + + public function testTints(): void + { + $this->assertSame( + [ + '#408040', + '#518b51', + '#639763', + '#74a274', + '#85ae85', + '#97b997', + '#a8c5a8', + '#b9d1b9', + '#cbdccb', + '#dce8dc' + ], + array_map( + fn(Color $color): string => (string) $color, + Color::fromHSV(120, 50, 50)->tints() + ) + ); + } + + public function testTintsArg(): void + { + $this->assertSame( + [ + '#408040', + '#609560', + '#80aa80', + '#9fbf9f', + '#bfd5bf' + ], + array_map( + fn(Color $color): string => (string) $color, + Color::fromHSV(120, 50, 50)->tints(5) + ) + ); + } + + public function testTones(): void + { + $this->assertSame( + [ + '#408040', + '#468046', + '#4b804b', + '#518051', + '#578057', + '#5d805d', + '#638063', + '#688068', + '#6e806e', + '#748074' + ], + array_map( + fn(Color $color): string => (string) $color, + Color::fromHSV(120, 50, 50)->tones() + ) + ); + } + + public function testTonesArg(): void + { + $this->assertSame( + [ + '#408040', + '#4a804a', + '#558055', + '#608060', + '#6a806a' + ], + array_map( + fn(Color $color): string => (string) $color, + Color::fromHSV(120, 50, 50)->tones(5) + ) + ); + } +} diff --git a/tests/SchemesTestTrait.php b/tests/SchemesTestTrait.php index e6ae0d7..6bf1fb9 100644 --- a/tests/SchemesTestTrait.php +++ b/tests/SchemesTestTrait.php @@ -1,78 +1,76 @@ -assertSame( - [ - '#408060', - '#608040' - ], - array_map( - fn(Color $color): string => (string) $color, - Color::fromHSV(120, 50, 50)->analogous() - ) - ); - } - - public function testComplementary(): void - { - $this->assertSame( - '#804080', - (string) Color::fromHSV(120, 50, 50)->complementary() - ); - } - - public function testSplit(): void - { - $this->assertSame( - [ - '#604080', - '#804060' - ], - array_map( - fn(Color $color): string => (string) $color, - Color::fromHSV(120, 50, 50)->split() - ) - ); - } - - public function testTetradic(): void - { - $this->assertSame( - [ - '#408080', - '#804080', - '#804040' - ], - array_map( - fn(Color $color): string => (string) $color, - Color::fromHSV(120, 50, 50)->tetradic() - ) - ); - } - - public function testTriadic(): void - { - $this->assertSame( - [ - '#404080', - '#804040' - ], - array_map( - fn(Color $color): string => (string) $color, - Color::fromHSV(120, 50, 50)->triadic() - ) - ); - } - -} +assertSame( + [ + '#408060', + '#608040' + ], + array_map( + fn(Color $color): string => (string) $color, + Color::fromHSV(120, 50, 50)->analogous() + ) + ); + } + + public function testComplementary(): void + { + $this->assertSame( + '#804080', + (string) Color::fromHSV(120, 50, 50)->complementary() + ); + } + + public function testSplit(): void + { + $this->assertSame( + [ + '#604080', + '#804060' + ], + array_map( + fn(Color $color): string => (string) $color, + Color::fromHSV(120, 50, 50)->split() + ) + ); + } + + public function testTetradic(): void + { + $this->assertSame( + [ + '#408080', + '#804080', + '#804040' + ], + array_map( + fn(Color $color): string => (string) $color, + Color::fromHSV(120, 50, 50)->tetradic() + ) + ); + } + + public function testTriadic(): void + { + $this->assertSame( + [ + '#404080', + '#804040' + ], + array_map( + fn(Color $color): string => (string) $color, + Color::fromHSV(120, 50, 50)->triadic() + ) + ); + } +} diff --git a/tests/StaticTestTrait.php b/tests/StaticTestTrait.php index 3cbde1c..5783047 100644 --- a/tests/StaticTestTrait.php +++ b/tests/StaticTestTrait.php @@ -1,160 +1,158 @@ -assertSame( - 1.3022288504206543, - Color::contrast( - new Color(100, 0, 0), - new Color(0, 0, 100) - ) - ); - } - - public function testDist(): void - { - $this->assertSame( - 141.4213562373095, - Color::dist( - new Color(100, 0, 0), - new Color(0, 0, 100) - ) - ); - } - - public function testFindContrast(): void - { - $color = Color::findContrast( - new Color(203, 213, 255) - ); - - $this->assertInstanceOf( - Color::class, - $color - ); - - $this->assertSame( - '#575c6e', - (string) $color - ); - } - - public function testFindContrastTwoColors(): void - { - $color = Color::findContrast( - new Color(203, 213, 255), - new Color(122, 143, 255) - ); - - $this->assertInstanceOf( - Color::class, - $color - ); - - $this->assertSame( - '#4c599e', - (string) $color - ); - } - - public function testFindContrastMinContrast(): void - { - $color = Color::findContrast( - new Color(203, 213, 255), - new Color(122, 143, 255), - 3 - ); - - $this->assertInstanceOf( - Color::class, - $color - ); - - $this->assertSame( - '#6272cc', - (string) $color - ); - } - - public function testFindContrastStepSize(): void - { - $color = Color::findContrast( - new Color(203, 213, 255), - new Color(122, 143, 255), - stepSize: .1 - ); - - $this->assertInstanceOf( - Color::class, - $color - ); - - $this->assertSame( - '#495699', - (string) $color - ); - } - - public function testMix(): void - { - $color1 = new Color(255, 0, 0); - $color2 = new Color(0, 0, 255); - $color3 = Color::mix($color1, $color2, .5); - - $this->assertSame( - 'red', - (string) $color1 - ); - - $this->assertSame( - 'blue', - (string) $color2 - ); - - $this->assertInstanceOf( - Color::class, - $color3 - ); - - $this->assertSame( - 'purple', - (string) $color3 - ); - } - - public function testMultiply(): void - { - $color1 = new Color(255, 0, 0); - $color2 = new Color(0, 0, 255); - $color3 = Color::multiply($color1, $color2, .5); - - $this->assertSame( - 'red', - (string) $color1 - ); - - $this->assertSame( - 'blue', - (string) $color2 - ); - - $this->assertInstanceOf( - Color::class, - $color3 - ); - - $this->assertSame( - 'maroon', - (string) $color3 - ); - } - -} +assertSame( + 1.3022288504206543, + Color::contrast( + new Color(100, 0, 0), + new Color(0, 0, 100) + ) + ); + } + + public function testDist(): void + { + $this->assertSame( + 141.4213562373095, + Color::dist( + new Color(100, 0, 0), + new Color(0, 0, 100) + ) + ); + } + + public function testFindContrast(): void + { + $color = Color::findContrast( + new Color(203, 213, 255) + ); + + $this->assertInstanceOf( + Color::class, + $color + ); + + $this->assertSame( + '#575c6e', + (string) $color + ); + } + + public function testFindContrastMinContrast(): void + { + $color = Color::findContrast( + new Color(203, 213, 255), + new Color(122, 143, 255), + 3 + ); + + $this->assertInstanceOf( + Color::class, + $color + ); + + $this->assertSame( + '#6272cc', + (string) $color + ); + } + + public function testFindContrastStepSize(): void + { + $color = Color::findContrast( + new Color(203, 213, 255), + new Color(122, 143, 255), + stepSize: .1 + ); + + $this->assertInstanceOf( + Color::class, + $color + ); + + $this->assertSame( + '#495699', + (string) $color + ); + } + + public function testFindContrastTwoColors(): void + { + $color = Color::findContrast( + new Color(203, 213, 255), + new Color(122, 143, 255) + ); + + $this->assertInstanceOf( + Color::class, + $color + ); + + $this->assertSame( + '#4c599e', + (string) $color + ); + } + + public function testMix(): void + { + $color1 = new Color(255, 0, 0); + $color2 = new Color(0, 0, 255); + $color3 = Color::mix($color1, $color2, .5); + + $this->assertSame( + 'red', + (string) $color1 + ); + + $this->assertSame( + 'blue', + (string) $color2 + ); + + $this->assertInstanceOf( + Color::class, + $color3 + ); + + $this->assertSame( + 'purple', + (string) $color3 + ); + } + + public function testMultiply(): void + { + $color1 = new Color(255, 0, 0); + $color2 = new Color(0, 0, 255); + $color3 = Color::multiply($color1, $color2, .5); + + $this->assertSame( + 'red', + (string) $color1 + ); + + $this->assertSame( + 'blue', + (string) $color2 + ); + + $this->assertInstanceOf( + Color::class, + $color3 + ); + + $this->assertSame( + 'maroon', + (string) $color3 + ); + } +}