diff --git a/Makefile b/Makefile deleted file mode 100644 index 909fadc80..000000000 --- a/Makefile +++ /dev/null @@ -1,63 +0,0 @@ -BOX_BIN := ./build/box.phar -COMPOSER_BIN := composer -PHP_BIN := php -PHP_CS_FIXER_BIN := ./vendor/bin/php-cs-fixer -PHPSTAN_BIN := ./vendor/bin/phpstan -PSALM_BIN := ./vendor/bin/psalm -PHPUNIT_BIN := ./vendor/bin/phpunit -INFECTION_BIN := ./vendor/bin/roave-infection-static-analysis-plugin - -.PHONY: help -help: ## Displays list of available targets with their descriptions - @grep -E '^[a-zA-Z0-9_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[32m%-30s\033[0m %s\n", $$1, $$2}' - - -.PHONY: build -build: tests ## Runs tests and creates the phar-binary - $(BOX_BIN) compile - -.PHONY: composer-install -composer-install: ## Installs dependencies - $(COMPOSER_BIN) install --no-interaction --no-progress --optimize-autoloader --ansi - -.PHONY: deptrac -deptrac: ## Analyses own architecture using the default config confile - ./deptrac analyse -c deptrac.config.php --cache-file=./.cache/deptrac.cache --no-progress --ansi - -#generate-changelog: ## Generates a changelog file based on changes compared to remote origin -# gem install github_changelog_generator -# github_changelog_generator -u qossmic -p deptrac --no-issues --future-release - -.PHONY: gpg -gpg: ## Signs release with default GPG key "4AB1782E" - gpg --detach-sign --armor --default-key 41DDE07547459FAECFA17813B8F640134AB1782E --output deptrac.phar.asc deptrac.phar - gpg --verify deptrac.phar.asc deptrac.phar - -.PHONY: infection -infection: composer-install ## Runs mutation tests - $(INFECTION_BIN) --threads=$(shell nproc || sysctl -n hw.ncpu || 1) --test-framework-options='--testsuite=Tests' --only-covered --min-msi=85 --psalm-config=psalm.xml - -.PHONY: php-cs-check -php-cs-check: ## Checks for code style violation - $(PHP_CS_FIXER_BIN) fix --allow-risky=yes --diff --using-cache=no --verbose --dry-run - -.PHONY: php-cs-fix -php-cs-fix: ## Fixes any found code style violation - $(PHP_CS_FIXER_BIN) fix --allow-risky=yes - -.PHONY: phpstan -phpstan: ## Performs static code analysis using phpstan - $(PHPSTAN_BIN) analyse --memory-limit=256M - -.PHONY: psalm -psalm: ## Performs static code analysis using psalm - $(PSALM_BIN) - -.PHONY: tests-coverage -tests-coverage: composer-install ## Runs tests and generate an html coverage report - XDEBUG_MODE=coverage $(PHPUNIT_BIN) -c . --coverage-html coverage - -.PHONY: tests -tests: composer-install ## Runs tests followed by a very basic e2e-test - $(PHPUNIT_BIN) -c . - ./deptrac analyse --config-file=docs/examples/Fixture.depfile.yaml --no-cache diff --git a/README.md b/README.md index 94f2ed1a0..dc5c4b7af 100644 --- a/README.md +++ b/README.md @@ -22,8 +22,8 @@ https://qossmic.github.io/deptrac You can install Deptrac via Composer. We recommend using the [deptrac-shim](https://github.com/qossmic/deptrac-shim) package for this: -```console -$ composer require --dev qossmic/deptrac-shim +```Shell +composer require --dev qossmic/deptrac-shim ``` Alternatively, you can also use [PHIVE](docs/index.md#phive) or download the diff --git a/baseline.xml b/baseline.xml deleted file mode 100644 index 83e0f6182..000000000 --- a/baseline.xml +++ /dev/null @@ -1,51 +0,0 @@ - - - - - |mixed, - * must_not: array|mixed, - * private: bool, - * type: string}]]> - - - - - , - * private: bool, - * type: string}]]> - - - - - - - - - - array{private: bool, type: string, value: string} - - - - - rules) ? array_values($this->rules[$type]) : []]]> - - - ]]> - - - - - $lockedPackages - - - , 'psr-4'?: array}, - * autoload-dev?: array{'psr-0'?: array, 'psr-4'?: array}, - * }>]]> - - - diff --git a/bin/deptrac b/bin/deptrac new file mode 100755 index 000000000..190978713 --- /dev/null +++ b/bin/deptrac @@ -0,0 +1,24 @@ +#!/usr/bin/env php +check(); +unset($xdebug); +(new Application())->run(); diff --git a/build/target-repository/bootstrap.php b/bootstrap.php similarity index 88% rename from build/target-repository/bootstrap.php rename to bootstrap.php index db3143abf..0b35c247b 100644 --- a/build/target-repository/bootstrap.php +++ b/bootstrap.php @@ -14,7 +14,7 @@ } // load prefixed or native class, e.g. for running tests - if (str_starts_with($class, 'DeptracPrefix') || str_starts_with($class, 'Qossmic\\Deptrac\\')) { + if (str_starts_with($class, 'DEPTRAC_') || str_starts_with($class, 'Qossmic\\Deptrac\\')) { if ($composerAutoloader === null) { // prefixed version autoload $composerAutoloader = require __DIR__ . '/vendor/autoload.php'; diff --git a/box.json.dist b/box.json.dist deleted file mode 100644 index cd8d03a62..000000000 --- a/box.json.dist +++ /dev/null @@ -1,24 +0,0 @@ -{ - "files": [ - "config/cache.php", - "config/services.php", - "config/deptrac_template.yaml" - ], - "compression": "GZ", - "main": "deptrac.php", - "git-version": "git-version", - "compactors" : [ - "KevinGH\\Box\\Compactor\\PhpScoper" - ], - "finder": [ - { - "in": ["src", "vendor"], - "notPath": "#jetbrains/phpstorm-stubs/.*/.*\\.php#", - "exclude": [ - "examples", - "test", - "tests" - ] - } - ] -} diff --git a/build/box.phar b/build/box.phar deleted file mode 100755 index e41ad2afe..000000000 Binary files a/build/box.phar and /dev/null differ diff --git a/build/rector-downgrade-php-72.php b/build/rector-downgrade-php-72.php deleted file mode 100644 index bef2f318d..000000000 --- a/build/rector-downgrade-php-72.php +++ /dev/null @@ -1,24 +0,0 @@ -parallel(); - - $rectorConfig->sets([DowngradeLevelSetList::DOWN_TO_PHP_72]); - - $rectorConfig->skip([ - '*/tests/*', - # missing "optional" dependency and never used here - '*/symfony/framework-bundle/KernelBrowser.php', - - // skip for parent type override, see https://github.com/symplify/symplify/issues/4500 - DowngradeCovariantReturnTypeRector::class => [ - 'doctrine/annotations/lib/Doctrine/Common/Annotations/DocLexer.php', - ], - ]); -}; diff --git a/build/target-repository/.gitignore b/build/target-repository/.gitignore deleted file mode 100644 index 052bb01f1..000000000 --- a/build/target-repository/.gitignore +++ /dev/null @@ -1,9 +0,0 @@ -# we need the vendor -composer.lock - -.phpunit.result.cache - -# to keep local rector outside git repository -rector-local - -php-scoper.phar diff --git a/build/target-repository/composer.json b/build/target-repository/composer.json deleted file mode 100644 index e430cd595..000000000 --- a/build/target-repository/composer.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "name": "qossmic/deptrac", - "description": "Deptrac is a static code analysis tool that helps to enforce rules for dependencies between software layers.", - "license": "MIT", - "require": { - "php": "^7.2", - "ext-json": "*" - }, - "suggest": { - "ext-dom": "For using the JUnit output formatter" - }, - "autoload": { - "psr-4": { - "Qossmic\\Deptrac\\": "src/" - } - } -} diff --git a/composer.json b/composer.json index 759ff9eb0..c6c97abb7 100644 --- a/composer.json +++ b/composer.json @@ -2,71 +2,23 @@ "name": "qossmic/deptrac", "description": "Deptrac is a static code analysis tool that helps to enforce rules for dependencies between software layers.", "license": "MIT", - "authors": [ - { - "name": "Tim Glabisch" - }, - { - "name": "Simon Mönch", - "email": "simon.moench@qossmic.com" - }, - { - "name": "Denis Brumann", - "email": "denis.brumann@qossmic.com", - "role": "maintainer" - } - ], - "bin": [ - "deptrac" - ], "require": { "php": "^8.1", - "ext-json": "*", - "composer/xdebug-handler": "^3.0", - "jetbrains/phpstorm-stubs": "^2022.2", - "nikic/php-parser": "^4.18", - "phpdocumentor/graphviz": "^2.1", - "phpdocumentor/type-resolver": "^1.6", - "phpstan/phpdoc-parser": "^1.5", - "symfony/config": "^6.0", - "symfony/console": "^6.0", - "symfony/dependency-injection": "^6.0", - "symfony/event-dispatcher": "^6.0", - "symfony/filesystem": "^6.0", - "symfony/finder": "^6.0", - "symfony/yaml": "^6.0" + "ext-json": "*" }, + "bin": [ + "bin/deptrac", + "deptrac.phar" + ], "suggest": { "ext-dom": "For using the JUnit output formatter" }, "autoload": { "psr-4": { "Qossmic\\Deptrac\\": "src/" - } - }, - "autoload-dev": { - "psr-4": { - "Tests\\Qossmic\\Deptrac\\": "tests/", - "Internal\\Qossmic\\Deptrac\\": "internal/deptrac/" - } - }, - "config": { - "platform": { - "php": "8.1" }, - "sort-packages": true, - "allow-plugins": { - "infection/extension-installer": true - } - }, - "require-dev": { - "friendsofphp/php-cs-fixer": "^3.4", - "infection/infection": "^0.26.16", - "phpstan/phpstan": "^1.6.8", - "phpstan/phpstan-symfony": "^1.1", - "phpunit/phpunit": "^10.2", - "rector/rector": "^0.15.17", - "roave/infection-static-analysis-plugin": "^1.28", - "vimeo/psalm": "^5.13" + "files": [ + "bootstrap.php" + ] } } diff --git a/composer.lock b/composer.lock deleted file mode 100644 index 49c1e858b..000000000 --- a/composer.lock +++ /dev/null @@ -1,5830 +0,0 @@ -{ - "_readme": [ - "This file locks the dependencies of your project to a known state", - "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", - "This file is @generated automatically" - ], - "content-hash": "6c71dbb01532e776e76022ebedab3922", - "packages": [ - { - "name": "composer/pcre", - "version": "3.1.1", - "source": { - "type": "git", - "url": "https://github.com/composer/pcre.git", - "reference": "00104306927c7a0919b4ced2aaa6782c1e61a3c9" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/composer/pcre/zipball/00104306927c7a0919b4ced2aaa6782c1e61a3c9", - "reference": "00104306927c7a0919b4ced2aaa6782c1e61a3c9", - "shasum": "" - }, - "require": { - "php": "^7.4 || ^8.0" - }, - "require-dev": { - "phpstan/phpstan": "^1.3", - "phpstan/phpstan-strict-rules": "^1.1", - "symfony/phpunit-bridge": "^5" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "3.x-dev" - } - }, - "autoload": { - "psr-4": { - "Composer\\Pcre\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Jordi Boggiano", - "email": "j.boggiano@seld.be", - "homepage": "http://seld.be" - } - ], - "description": "PCRE wrapping library that offers type-safe preg_* replacements.", - "keywords": [ - "PCRE", - "preg", - "regex", - "regular expression" - ], - "support": { - "issues": "https://github.com/composer/pcre/issues", - "source": "https://github.com/composer/pcre/tree/3.1.1" - }, - "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": "2023-10-11T07:11:09+00:00" - }, - { - "name": "composer/xdebug-handler", - "version": "3.0.3", - "source": { - "type": "git", - "url": "https://github.com/composer/xdebug-handler.git", - "reference": "ced299686f41dce890debac69273b47ffe98a40c" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/composer/xdebug-handler/zipball/ced299686f41dce890debac69273b47ffe98a40c", - "reference": "ced299686f41dce890debac69273b47ffe98a40c", - "shasum": "" - }, - "require": { - "composer/pcre": "^1 || ^2 || ^3", - "php": "^7.2.5 || ^8.0", - "psr/log": "^1 || ^2 || ^3" - }, - "require-dev": { - "phpstan/phpstan": "^1.0", - "phpstan/phpstan-strict-rules": "^1.1", - "symfony/phpunit-bridge": "^6.0" - }, - "type": "library", - "autoload": { - "psr-4": { - "Composer\\XdebugHandler\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "John Stevenson", - "email": "john-stevenson@blueyonder.co.uk" - } - ], - "description": "Restarts a process without Xdebug.", - "keywords": [ - "Xdebug", - "performance" - ], - "support": { - "irc": "irc://irc.freenode.org/composer", - "issues": "https://github.com/composer/xdebug-handler/issues", - "source": "https://github.com/composer/xdebug-handler/tree/3.0.3" - }, - "funding": [ - { - "url": "https://packagist.com", - "type": "custom" - }, - { - "url": "https://github.com/composer", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/composer/composer", - "type": "tidelift" - } - ], - "time": "2022-02-25T21:32:43+00:00" - }, - { - "name": "doctrine/deprecations", - "version": "1.1.2", - "source": { - "type": "git", - "url": "https://github.com/doctrine/deprecations.git", - "reference": "4f2d4f2836e7ec4e7a8625e75c6aa916004db931" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/doctrine/deprecations/zipball/4f2d4f2836e7ec4e7a8625e75c6aa916004db931", - "reference": "4f2d4f2836e7ec4e7a8625e75c6aa916004db931", - "shasum": "" - }, - "require": { - "php": "^7.1 || ^8.0" - }, - "require-dev": { - "doctrine/coding-standard": "^9", - "phpstan/phpstan": "1.4.10 || 1.10.15", - "phpstan/phpstan-phpunit": "^1.0", - "phpunit/phpunit": "^7.5 || ^8.5 || ^9.5", - "psalm/plugin-phpunit": "0.18.4", - "psr/log": "^1 || ^2 || ^3", - "vimeo/psalm": "4.30.0 || 5.12.0" - }, - "suggest": { - "psr/log": "Allows logging deprecations via PSR-3 logger implementation" - }, - "type": "library", - "autoload": { - "psr-4": { - "Doctrine\\Deprecations\\": "lib/Doctrine/Deprecations" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "description": "A small layer on top of trigger_error(E_USER_DEPRECATED) or PSR-3 logging with options to disable all deprecations or selectively for packages.", - "homepage": "https://www.doctrine-project.org/", - "support": { - "issues": "https://github.com/doctrine/deprecations/issues", - "source": "https://github.com/doctrine/deprecations/tree/1.1.2" - }, - "time": "2023-09-27T20:04:15+00:00" - }, - { - "name": "jetbrains/phpstorm-stubs", - "version": "v2022.3", - "source": { - "type": "git", - "url": "https://github.com/JetBrains/phpstorm-stubs.git", - "reference": "6b568c153cea002dc6fad96285c3063d07cab18d" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/JetBrains/phpstorm-stubs/zipball/6b568c153cea002dc6fad96285c3063d07cab18d", - "reference": "6b568c153cea002dc6fad96285c3063d07cab18d", - "shasum": "" - }, - "require-dev": { - "friendsofphp/php-cs-fixer": "@stable", - "nikic/php-parser": "@stable", - "php": "^8.0", - "phpdocumentor/reflection-docblock": "@stable", - "phpunit/phpunit": "@stable" - }, - "type": "library", - "autoload": { - "files": [ - "PhpStormStubsMap.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "Apache-2.0" - ], - "description": "PHP runtime & extensions header files for PhpStorm", - "homepage": "https://www.jetbrains.com/phpstorm", - "keywords": [ - "autocomplete", - "code", - "inference", - "inspection", - "jetbrains", - "phpstorm", - "stubs", - "type" - ], - "support": { - "source": "https://github.com/JetBrains/phpstorm-stubs/tree/v2022.3" - }, - "time": "2022-10-17T09:21:37+00:00" - }, - { - "name": "nikic/php-parser", - "version": "v4.18.0", - "source": { - "type": "git", - "url": "https://github.com/nikic/PHP-Parser.git", - "reference": "1bcbb2179f97633e98bbbc87044ee2611c7d7999" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/1bcbb2179f97633e98bbbc87044ee2611c7d7999", - "reference": "1bcbb2179f97633e98bbbc87044ee2611c7d7999", - "shasum": "" - }, - "require": { - "ext-tokenizer": "*", - "php": ">=7.0" - }, - "require-dev": { - "ircmaxell/php-yacc": "^0.0.7", - "phpunit/phpunit": "^6.5 || ^7.0 || ^8.0 || ^9.0" - }, - "bin": [ - "bin/php-parse" - ], - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "4.9-dev" - } - }, - "autoload": { - "psr-4": { - "PhpParser\\": "lib/PhpParser" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Nikita Popov" - } - ], - "description": "A PHP parser written in PHP", - "keywords": [ - "parser", - "php" - ], - "support": { - "issues": "https://github.com/nikic/PHP-Parser/issues", - "source": "https://github.com/nikic/PHP-Parser/tree/v4.18.0" - }, - "time": "2023-12-10T21:03:43+00:00" - }, - { - "name": "phpdocumentor/graphviz", - "version": "2.1.0", - "source": { - "type": "git", - "url": "https://github.com/phpDocumentor/GraphViz.git", - "reference": "115999dc7f31f2392645aa825a94a6b165e1cedf" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/GraphViz/zipball/115999dc7f31f2392645aa825a94a6b165e1cedf", - "reference": "115999dc7f31f2392645aa825a94a6b165e1cedf", - "shasum": "" - }, - "require": { - "php": "^7.2 || ^8.0" - }, - "require-dev": { - "ext-simplexml": "*", - "mockery/mockery": "^1.2", - "phpstan/phpstan": "^0.12", - "phpunit/phpunit": "^8.2 || ^9.2", - "psalm/phar": "^4.15" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.x-dev" - } - }, - "autoload": { - "psr-4": { - "phpDocumentor\\GraphViz\\": "src/phpDocumentor/GraphViz", - "phpDocumentor\\GraphViz\\PHPStan\\": "./src/phpDocumentor/PHPStan" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Mike van Riel", - "email": "mike.vanriel@naenius.com" - } - ], - "description": "Wrapper for Graphviz", - "support": { - "issues": "https://github.com/phpDocumentor/GraphViz/issues", - "source": "https://github.com/phpDocumentor/GraphViz/tree/2.1.0" - }, - "time": "2021-12-13T19:03:21+00:00" - }, - { - "name": "phpdocumentor/reflection-common", - "version": "2.2.0", - "source": { - "type": "git", - "url": "https://github.com/phpDocumentor/ReflectionCommon.git", - "reference": "1d01c49d4ed62f25aa84a747ad35d5a16924662b" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/1d01c49d4ed62f25aa84a747ad35d5a16924662b", - "reference": "1d01c49d4ed62f25aa84a747ad35d5a16924662b", - "shasum": "" - }, - "require": { - "php": "^7.2 || ^8.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-2.x": "2.x-dev" - } - }, - "autoload": { - "psr-4": { - "phpDocumentor\\Reflection\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Jaap van Otterdijk", - "email": "opensource@ijaap.nl" - } - ], - "description": "Common reflection classes used by phpdocumentor to reflect the code structure", - "homepage": "http://www.phpdoc.org", - "keywords": [ - "FQSEN", - "phpDocumentor", - "phpdoc", - "reflection", - "static analysis" - ], - "support": { - "issues": "https://github.com/phpDocumentor/ReflectionCommon/issues", - "source": "https://github.com/phpDocumentor/ReflectionCommon/tree/2.x" - }, - "time": "2020-06-27T09:03:43+00:00" - }, - { - "name": "phpdocumentor/type-resolver", - "version": "1.8.0", - "source": { - "type": "git", - "url": "https://github.com/phpDocumentor/TypeResolver.git", - "reference": "fad452781b3d774e3337b0c0b245dd8e5a4455fc" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/fad452781b3d774e3337b0c0b245dd8e5a4455fc", - "reference": "fad452781b3d774e3337b0c0b245dd8e5a4455fc", - "shasum": "" - }, - "require": { - "doctrine/deprecations": "^1.0", - "php": "^7.4 || ^8.0", - "phpdocumentor/reflection-common": "^2.0", - "phpstan/phpdoc-parser": "^1.13" - }, - "require-dev": { - "ext-tokenizer": "*", - "phpbench/phpbench": "^1.2", - "phpstan/extension-installer": "^1.1", - "phpstan/phpstan": "^1.8", - "phpstan/phpstan-phpunit": "^1.1", - "phpunit/phpunit": "^9.5", - "rector/rector": "^0.13.9", - "vimeo/psalm": "^4.25" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-1.x": "1.x-dev" - } - }, - "autoload": { - "psr-4": { - "phpDocumentor\\Reflection\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Mike van Riel", - "email": "me@mikevanriel.com" - } - ], - "description": "A PSR-5 based resolver of Class names, Types and Structural Element Names", - "support": { - "issues": "https://github.com/phpDocumentor/TypeResolver/issues", - "source": "https://github.com/phpDocumentor/TypeResolver/tree/1.8.0" - }, - "time": "2024-01-11T11:49:22+00:00" - }, - { - "name": "phpstan/phpdoc-parser", - "version": "1.25.0", - "source": { - "type": "git", - "url": "https://github.com/phpstan/phpdoc-parser.git", - "reference": "bd84b629c8de41aa2ae82c067c955e06f1b00240" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/bd84b629c8de41aa2ae82c067c955e06f1b00240", - "reference": "bd84b629c8de41aa2ae82c067c955e06f1b00240", - "shasum": "" - }, - "require": { - "php": "^7.2 || ^8.0" - }, - "require-dev": { - "doctrine/annotations": "^2.0", - "nikic/php-parser": "^4.15", - "php-parallel-lint/php-parallel-lint": "^1.2", - "phpstan/extension-installer": "^1.0", - "phpstan/phpstan": "^1.5", - "phpstan/phpstan-phpunit": "^1.1", - "phpstan/phpstan-strict-rules": "^1.0", - "phpunit/phpunit": "^9.5", - "symfony/process": "^5.2" - }, - "type": "library", - "autoload": { - "psr-4": { - "PHPStan\\PhpDocParser\\": [ - "src/" - ] - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "description": "PHPDoc parser with support for nullable, intersection and generic types", - "support": { - "issues": "https://github.com/phpstan/phpdoc-parser/issues", - "source": "https://github.com/phpstan/phpdoc-parser/tree/1.25.0" - }, - "time": "2024-01-04T17:06:16+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": "symfony/config", - "version": "v6.4.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/config.git", - "reference": "5d33e0fb707d603330e0edfd4691803a1253572e" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/config/zipball/5d33e0fb707d603330e0edfd4691803a1253572e", - "reference": "5d33e0fb707d603330e0edfd4691803a1253572e", - "shasum": "" - }, - "require": { - "php": ">=8.1", - "symfony/deprecation-contracts": "^2.5|^3", - "symfony/filesystem": "^5.4|^6.0|^7.0", - "symfony/polyfill-ctype": "~1.8" - }, - "conflict": { - "symfony/finder": "<5.4", - "symfony/service-contracts": "<2.5" - }, - "require-dev": { - "symfony/event-dispatcher": "^5.4|^6.0|^7.0", - "symfony/finder": "^5.4|^6.0|^7.0", - "symfony/messenger": "^5.4|^6.0|^7.0", - "symfony/service-contracts": "^2.5|^3", - "symfony/yaml": "^5.4|^6.0|^7.0" - }, - "type": "library", - "autoload": { - "psr-4": { - "Symfony\\Component\\Config\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Helps you find, load, combine, autofill and validate configuration values of any kind", - "homepage": "https://symfony.com", - "support": { - "source": "https://github.com/symfony/config/tree/v6.4.0" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2023-11-09T08:28:32+00:00" - }, - { - "name": "symfony/console", - "version": "v6.4.2", - "source": { - "type": "git", - "url": "https://github.com/symfony/console.git", - "reference": "0254811a143e6bc6c8deea08b589a7e68a37f625" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/0254811a143e6bc6c8deea08b589a7e68a37f625", - "reference": "0254811a143e6bc6c8deea08b589a7e68a37f625", - "shasum": "" - }, - "require": { - "php": ">=8.1", - "symfony/deprecation-contracts": "^2.5|^3", - "symfony/polyfill-mbstring": "~1.0", - "symfony/service-contracts": "^2.5|^3", - "symfony/string": "^5.4|^6.0|^7.0" - }, - "conflict": { - "symfony/dependency-injection": "<5.4", - "symfony/dotenv": "<5.4", - "symfony/event-dispatcher": "<5.4", - "symfony/lock": "<5.4", - "symfony/process": "<5.4" - }, - "provide": { - "psr/log-implementation": "1.0|2.0|3.0" - }, - "require-dev": { - "psr/log": "^1|^2|^3", - "symfony/config": "^5.4|^6.0|^7.0", - "symfony/dependency-injection": "^5.4|^6.0|^7.0", - "symfony/event-dispatcher": "^5.4|^6.0|^7.0", - "symfony/http-foundation": "^6.4|^7.0", - "symfony/http-kernel": "^6.4|^7.0", - "symfony/lock": "^5.4|^6.0|^7.0", - "symfony/messenger": "^5.4|^6.0|^7.0", - "symfony/process": "^5.4|^6.0|^7.0", - "symfony/stopwatch": "^5.4|^6.0|^7.0", - "symfony/var-dumper": "^5.4|^6.0|^7.0" - }, - "type": "library", - "autoload": { - "psr-4": { - "Symfony\\Component\\Console\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Eases the creation of beautiful and testable command line interfaces", - "homepage": "https://symfony.com", - "keywords": [ - "cli", - "command-line", - "console", - "terminal" - ], - "support": { - "source": "https://github.com/symfony/console/tree/v6.4.2" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2023-12-10T16:15:48+00:00" - }, - { - "name": "symfony/dependency-injection", - "version": "v6.4.2", - "source": { - "type": "git", - "url": "https://github.com/symfony/dependency-injection.git", - "reference": "226ea431b1eda6f0d9f5a4b278757171960bb195" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/226ea431b1eda6f0d9f5a4b278757171960bb195", - "reference": "226ea431b1eda6f0d9f5a4b278757171960bb195", - "shasum": "" - }, - "require": { - "php": ">=8.1", - "psr/container": "^1.1|^2.0", - "symfony/deprecation-contracts": "^2.5|^3", - "symfony/service-contracts": "^2.5|^3.0", - "symfony/var-exporter": "^6.2.10|^7.0" - }, - "conflict": { - "ext-psr": "<1.1|>=2", - "symfony/config": "<6.1", - "symfony/finder": "<5.4", - "symfony/proxy-manager-bridge": "<6.3", - "symfony/yaml": "<5.4" - }, - "provide": { - "psr/container-implementation": "1.1|2.0", - "symfony/service-implementation": "1.1|2.0|3.0" - }, - "require-dev": { - "symfony/config": "^6.1|^7.0", - "symfony/expression-language": "^5.4|^6.0|^7.0", - "symfony/yaml": "^5.4|^6.0|^7.0" - }, - "type": "library", - "autoload": { - "psr-4": { - "Symfony\\Component\\DependencyInjection\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Allows you to standardize and centralize the way objects are constructed in your application", - "homepage": "https://symfony.com", - "support": { - "source": "https://github.com/symfony/dependency-injection/tree/v6.4.2" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2023-12-28T19:16:56+00:00" - }, - { - "name": "symfony/deprecation-contracts", - "version": "v3.4.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/deprecation-contracts.git", - "reference": "7c3aff79d10325257a001fcf92d991f24fc967cf" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/7c3aff79d10325257a001fcf92d991f24fc967cf", - "reference": "7c3aff79d10325257a001fcf92d991f24fc967cf", - "shasum": "" - }, - "require": { - "php": ">=8.1" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "3.4-dev" - }, - "thanks": { - "name": "symfony/contracts", - "url": "https://github.com/symfony/contracts" - } - }, - "autoload": { - "files": [ - "function.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "A generic function and convention to trigger deprecation notices", - "homepage": "https://symfony.com", - "support": { - "source": "https://github.com/symfony/deprecation-contracts/tree/v3.4.0" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2023-05-23T14:45:45+00:00" - }, - { - "name": "symfony/event-dispatcher", - "version": "v6.4.2", - "source": { - "type": "git", - "url": "https://github.com/symfony/event-dispatcher.git", - "reference": "e95216850555cd55e71b857eb9d6c2674124603a" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/e95216850555cd55e71b857eb9d6c2674124603a", - "reference": "e95216850555cd55e71b857eb9d6c2674124603a", - "shasum": "" - }, - "require": { - "php": ">=8.1", - "symfony/event-dispatcher-contracts": "^2.5|^3" - }, - "conflict": { - "symfony/dependency-injection": "<5.4", - "symfony/service-contracts": "<2.5" - }, - "provide": { - "psr/event-dispatcher-implementation": "1.0", - "symfony/event-dispatcher-implementation": "2.0|3.0" - }, - "require-dev": { - "psr/log": "^1|^2|^3", - "symfony/config": "^5.4|^6.0|^7.0", - "symfony/dependency-injection": "^5.4|^6.0|^7.0", - "symfony/error-handler": "^5.4|^6.0|^7.0", - "symfony/expression-language": "^5.4|^6.0|^7.0", - "symfony/http-foundation": "^5.4|^6.0|^7.0", - "symfony/service-contracts": "^2.5|^3", - "symfony/stopwatch": "^5.4|^6.0|^7.0" - }, - "type": "library", - "autoload": { - "psr-4": { - "Symfony\\Component\\EventDispatcher\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Provides tools that allow your application components to communicate with each other by dispatching events and listening to them", - "homepage": "https://symfony.com", - "support": { - "source": "https://github.com/symfony/event-dispatcher/tree/v6.4.2" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2023-12-27T22:16:42+00:00" - }, - { - "name": "symfony/event-dispatcher-contracts", - "version": "v3.4.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/event-dispatcher-contracts.git", - "reference": "a76aed96a42d2b521153fb382d418e30d18b59df" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher-contracts/zipball/a76aed96a42d2b521153fb382d418e30d18b59df", - "reference": "a76aed96a42d2b521153fb382d418e30d18b59df", - "shasum": "" - }, - "require": { - "php": ">=8.1", - "psr/event-dispatcher": "^1" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "3.4-dev" - }, - "thanks": { - "name": "symfony/contracts", - "url": "https://github.com/symfony/contracts" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Contracts\\EventDispatcher\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Generic abstractions related to dispatching event", - "homepage": "https://symfony.com", - "keywords": [ - "abstractions", - "contracts", - "decoupling", - "interfaces", - "interoperability", - "standards" - ], - "support": { - "source": "https://github.com/symfony/event-dispatcher-contracts/tree/v3.4.0" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2023-05-23T14:45:45+00:00" - }, - { - "name": "symfony/filesystem", - "version": "v6.4.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/filesystem.git", - "reference": "952a8cb588c3bc6ce76f6023000fb932f16a6e59" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/filesystem/zipball/952a8cb588c3bc6ce76f6023000fb932f16a6e59", - "reference": "952a8cb588c3bc6ce76f6023000fb932f16a6e59", - "shasum": "" - }, - "require": { - "php": ">=8.1", - "symfony/polyfill-ctype": "~1.8", - "symfony/polyfill-mbstring": "~1.8" - }, - "type": "library", - "autoload": { - "psr-4": { - "Symfony\\Component\\Filesystem\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Provides basic utilities for the filesystem", - "homepage": "https://symfony.com", - "support": { - "source": "https://github.com/symfony/filesystem/tree/v6.4.0" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2023-07-26T17:27:13+00:00" - }, - { - "name": "symfony/finder", - "version": "v6.4.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/finder.git", - "reference": "11d736e97f116ac375a81f96e662911a34cd50ce" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/11d736e97f116ac375a81f96e662911a34cd50ce", - "reference": "11d736e97f116ac375a81f96e662911a34cd50ce", - "shasum": "" - }, - "require": { - "php": ">=8.1" - }, - "require-dev": { - "symfony/filesystem": "^6.0|^7.0" - }, - "type": "library", - "autoload": { - "psr-4": { - "Symfony\\Component\\Finder\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Finds files and directories via an intuitive fluent interface", - "homepage": "https://symfony.com", - "support": { - "source": "https://github.com/symfony/finder/tree/v6.4.0" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2023-10-31T17:30:12+00:00" - }, - { - "name": "symfony/polyfill-ctype", - "version": "v1.28.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-ctype.git", - "reference": "ea208ce43cbb04af6867b4fdddb1bdbf84cc28cb" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/ea208ce43cbb04af6867b4fdddb1bdbf84cc28cb", - "reference": "ea208ce43cbb04af6867b4fdddb1bdbf84cc28cb", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "provide": { - "ext-ctype": "*" - }, - "suggest": { - "ext-ctype": "For best performance" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "1.28-dev" - }, - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } - }, - "autoload": { - "files": [ - "bootstrap.php" - ], - "psr-4": { - "Symfony\\Polyfill\\Ctype\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Gert de Pagter", - "email": "BackEndTea@gmail.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony polyfill for ctype functions", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "ctype", - "polyfill", - "portable" - ], - "support": { - "source": "https://github.com/symfony/polyfill-ctype/tree/v1.28.0" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2023-01-26T09:26:14+00:00" - }, - { - "name": "symfony/polyfill-intl-grapheme", - "version": "v1.28.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-intl-grapheme.git", - "reference": "875e90aeea2777b6f135677f618529449334a612" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/875e90aeea2777b6f135677f618529449334a612", - "reference": "875e90aeea2777b6f135677f618529449334a612", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "suggest": { - "ext-intl": "For best performance" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "1.28-dev" - }, - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } - }, - "autoload": { - "files": [ - "bootstrap.php" - ], - "psr-4": { - "Symfony\\Polyfill\\Intl\\Grapheme\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony polyfill for intl's grapheme_* functions", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "grapheme", - "intl", - "polyfill", - "portable", - "shim" - ], - "support": { - "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.28.0" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2023-01-26T09:26:14+00:00" - }, - { - "name": "symfony/polyfill-intl-normalizer", - "version": "v1.28.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-intl-normalizer.git", - "reference": "8c4ad05dd0120b6a53c1ca374dca2ad0a1c4ed92" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/8c4ad05dd0120b6a53c1ca374dca2ad0a1c4ed92", - "reference": "8c4ad05dd0120b6a53c1ca374dca2ad0a1c4ed92", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "suggest": { - "ext-intl": "For best performance" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "1.28-dev" - }, - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } - }, - "autoload": { - "files": [ - "bootstrap.php" - ], - "psr-4": { - "Symfony\\Polyfill\\Intl\\Normalizer\\": "" - }, - "classmap": [ - "Resources/stubs" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony polyfill for intl's Normalizer class and related functions", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "intl", - "normalizer", - "polyfill", - "portable", - "shim" - ], - "support": { - "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.28.0" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2023-01-26T09:26:14+00:00" - }, - { - "name": "symfony/polyfill-mbstring", - "version": "v1.28.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "42292d99c55abe617799667f454222c54c60e229" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/42292d99c55abe617799667f454222c54c60e229", - "reference": "42292d99c55abe617799667f454222c54c60e229", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "provide": { - "ext-mbstring": "*" - }, - "suggest": { - "ext-mbstring": "For best performance" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "1.28-dev" - }, - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } - }, - "autoload": { - "files": [ - "bootstrap.php" - ], - "psr-4": { - "Symfony\\Polyfill\\Mbstring\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony polyfill for the Mbstring extension", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "mbstring", - "polyfill", - "portable", - "shim" - ], - "support": { - "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.28.0" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2023-07-28T09:04:16+00:00" - }, - { - "name": "symfony/service-contracts", - "version": "v3.4.1", - "source": { - "type": "git", - "url": "https://github.com/symfony/service-contracts.git", - "reference": "fe07cbc8d837f60caf7018068e350cc5163681a0" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/service-contracts/zipball/fe07cbc8d837f60caf7018068e350cc5163681a0", - "reference": "fe07cbc8d837f60caf7018068e350cc5163681a0", - "shasum": "" - }, - "require": { - "php": ">=8.1", - "psr/container": "^1.1|^2.0" - }, - "conflict": { - "ext-psr": "<1.1|>=2" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "3.4-dev" - }, - "thanks": { - "name": "symfony/contracts", - "url": "https://github.com/symfony/contracts" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Contracts\\Service\\": "" - }, - "exclude-from-classmap": [ - "/Test/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Generic abstractions related to writing services", - "homepage": "https://symfony.com", - "keywords": [ - "abstractions", - "contracts", - "decoupling", - "interfaces", - "interoperability", - "standards" - ], - "support": { - "source": "https://github.com/symfony/service-contracts/tree/v3.4.1" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2023-12-26T14:02:43+00:00" - }, - { - "name": "symfony/string", - "version": "v6.4.2", - "source": { - "type": "git", - "url": "https://github.com/symfony/string.git", - "reference": "7cb80bc10bfcdf6b5492741c0b9357dac66940bc" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/string/zipball/7cb80bc10bfcdf6b5492741c0b9357dac66940bc", - "reference": "7cb80bc10bfcdf6b5492741c0b9357dac66940bc", - "shasum": "" - }, - "require": { - "php": ">=8.1", - "symfony/polyfill-ctype": "~1.8", - "symfony/polyfill-intl-grapheme": "~1.0", - "symfony/polyfill-intl-normalizer": "~1.0", - "symfony/polyfill-mbstring": "~1.0" - }, - "conflict": { - "symfony/translation-contracts": "<2.5" - }, - "require-dev": { - "symfony/error-handler": "^5.4|^6.0|^7.0", - "symfony/http-client": "^5.4|^6.0|^7.0", - "symfony/intl": "^6.2|^7.0", - "symfony/translation-contracts": "^2.5|^3.0", - "symfony/var-exporter": "^5.4|^6.0|^7.0" - }, - "type": "library", - "autoload": { - "files": [ - "Resources/functions.php" - ], - "psr-4": { - "Symfony\\Component\\String\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Provides an object-oriented API to strings and deals with bytes, UTF-8 code points and grapheme clusters in a unified way", - "homepage": "https://symfony.com", - "keywords": [ - "grapheme", - "i18n", - "string", - "unicode", - "utf-8", - "utf8" - ], - "support": { - "source": "https://github.com/symfony/string/tree/v6.4.2" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2023-12-10T16:15:48+00:00" - }, - { - "name": "symfony/var-exporter", - "version": "v6.4.2", - "source": { - "type": "git", - "url": "https://github.com/symfony/var-exporter.git", - "reference": "5fe9a0021b8d35e67d914716ec8de50716a68e7e" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/var-exporter/zipball/5fe9a0021b8d35e67d914716ec8de50716a68e7e", - "reference": "5fe9a0021b8d35e67d914716ec8de50716a68e7e", - "shasum": "" - }, - "require": { - "php": ">=8.1", - "symfony/deprecation-contracts": "^2.5|^3" - }, - "require-dev": { - "symfony/var-dumper": "^5.4|^6.0|^7.0" - }, - "type": "library", - "autoload": { - "psr-4": { - "Symfony\\Component\\VarExporter\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Allows exporting any serializable PHP data structure to plain PHP code", - "homepage": "https://symfony.com", - "keywords": [ - "clone", - "construct", - "export", - "hydrate", - "instantiate", - "lazy-loading", - "proxy", - "serialize" - ], - "support": { - "source": "https://github.com/symfony/var-exporter/tree/v6.4.2" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2023-12-27T08:18:35+00:00" - }, - { - "name": "symfony/yaml", - "version": "v6.4.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/yaml.git", - "reference": "4f9237a1bb42455d609e6687d2613dde5b41a587" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/yaml/zipball/4f9237a1bb42455d609e6687d2613dde5b41a587", - "reference": "4f9237a1bb42455d609e6687d2613dde5b41a587", - "shasum": "" - }, - "require": { - "php": ">=8.1", - "symfony/deprecation-contracts": "^2.5|^3", - "symfony/polyfill-ctype": "^1.8" - }, - "conflict": { - "symfony/console": "<5.4" - }, - "require-dev": { - "symfony/console": "^5.4|^6.0|^7.0" - }, - "bin": [ - "Resources/bin/yaml-lint" - ], - "type": "library", - "autoload": { - "psr-4": { - "Symfony\\Component\\Yaml\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Loads and dumps YAML files", - "homepage": "https://symfony.com", - "support": { - "source": "https://github.com/symfony/yaml/tree/v6.4.0" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2023-11-06T11:00:25+00:00" - } - ], - "packages-dev": [ - { - "name": "amphp/amp", - "version": "v2.6.2", - "source": { - "type": "git", - "url": "https://github.com/amphp/amp.git", - "reference": "9d5100cebffa729aaffecd3ad25dc5aeea4f13bb" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/amphp/amp/zipball/9d5100cebffa729aaffecd3ad25dc5aeea4f13bb", - "reference": "9d5100cebffa729aaffecd3ad25dc5aeea4f13bb", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "require-dev": { - "amphp/php-cs-fixer-config": "dev-master", - "amphp/phpunit-util": "^1", - "ext-json": "*", - "jetbrains/phpstorm-stubs": "^2019.3", - "phpunit/phpunit": "^7 | ^8 | ^9", - "psalm/phar": "^3.11@dev", - "react/promise": "^2" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.x-dev" - } - }, - "autoload": { - "files": [ - "lib/functions.php", - "lib/Internal/functions.php" - ], - "psr-4": { - "Amp\\": "lib" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Daniel Lowrey", - "email": "rdlowrey@php.net" - }, - { - "name": "Aaron Piotrowski", - "email": "aaron@trowski.com" - }, - { - "name": "Bob Weinand", - "email": "bobwei9@hotmail.com" - }, - { - "name": "Niklas Keller", - "email": "me@kelunik.com" - } - ], - "description": "A non-blocking concurrency framework for PHP applications.", - "homepage": "https://amphp.org/amp", - "keywords": [ - "async", - "asynchronous", - "awaitable", - "concurrency", - "event", - "event-loop", - "future", - "non-blocking", - "promise" - ], - "support": { - "irc": "irc://irc.freenode.org/amphp", - "issues": "https://github.com/amphp/amp/issues", - "source": "https://github.com/amphp/amp/tree/v2.6.2" - }, - "funding": [ - { - "url": "https://github.com/amphp", - "type": "github" - } - ], - "time": "2022-02-20T17:52:18+00:00" - }, - { - "name": "amphp/byte-stream", - "version": "v1.8.1", - "source": { - "type": "git", - "url": "https://github.com/amphp/byte-stream.git", - "reference": "acbd8002b3536485c997c4e019206b3f10ca15bd" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/amphp/byte-stream/zipball/acbd8002b3536485c997c4e019206b3f10ca15bd", - "reference": "acbd8002b3536485c997c4e019206b3f10ca15bd", - "shasum": "" - }, - "require": { - "amphp/amp": "^2", - "php": ">=7.1" - }, - "require-dev": { - "amphp/php-cs-fixer-config": "dev-master", - "amphp/phpunit-util": "^1.4", - "friendsofphp/php-cs-fixer": "^2.3", - "jetbrains/phpstorm-stubs": "^2019.3", - "phpunit/phpunit": "^6 || ^7 || ^8", - "psalm/phar": "^3.11.4" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.x-dev" - } - }, - "autoload": { - "files": [ - "lib/functions.php" - ], - "psr-4": { - "Amp\\ByteStream\\": "lib" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Aaron Piotrowski", - "email": "aaron@trowski.com" - }, - { - "name": "Niklas Keller", - "email": "me@kelunik.com" - } - ], - "description": "A stream abstraction to make working with non-blocking I/O simple.", - "homepage": "http://amphp.org/byte-stream", - "keywords": [ - "amp", - "amphp", - "async", - "io", - "non-blocking", - "stream" - ], - "support": { - "irc": "irc://irc.freenode.org/amphp", - "issues": "https://github.com/amphp/byte-stream/issues", - "source": "https://github.com/amphp/byte-stream/tree/v1.8.1" - }, - "funding": [ - { - "url": "https://github.com/amphp", - "type": "github" - } - ], - "time": "2021-03-30T17:13:30+00:00" - }, - { - "name": "colinodell/json5", - "version": "v2.3.0", - "source": { - "type": "git", - "url": "https://github.com/colinodell/json5.git", - "reference": "15b063f8cb5e6deb15f0cd39123264ec0d19c710" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/colinodell/json5/zipball/15b063f8cb5e6deb15f0cd39123264ec0d19c710", - "reference": "15b063f8cb5e6deb15f0cd39123264ec0d19c710", - "shasum": "" - }, - "require": { - "ext-json": "*", - "ext-mbstring": "*", - "php": "^7.1.3|^8.0" - }, - "conflict": { - "scrutinizer/ocular": "1.7.*" - }, - "require-dev": { - "mikehaertl/php-shellcommand": "^1.2.5", - "phpstan/phpstan": "^1.4", - "scrutinizer/ocular": "^1.6", - "squizlabs/php_codesniffer": "^2.3 || ^3.0", - "symfony/finder": "^4.4|^5.4|^6.0", - "symfony/phpunit-bridge": "^5.4|^6.0" - }, - "bin": [ - "bin/json5" - ], - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "3.0-dev" - } - }, - "autoload": { - "files": [ - "src/global.php" - ], - "psr-4": { - "ColinODell\\Json5\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Colin O'Dell", - "email": "colinodell@gmail.com", - "homepage": "https://www.colinodell.com", - "role": "Developer" - } - ], - "description": "UTF-8 compatible JSON5 parser for PHP", - "homepage": "https://github.com/colinodell/json5", - "keywords": [ - "JSON5", - "json", - "json5_decode", - "json_decode" - ], - "support": { - "issues": "https://github.com/colinodell/json5/issues", - "source": "https://github.com/colinodell/json5/tree/v2.3.0" - }, - "funding": [ - { - "url": "https://www.colinodell.com/sponsor", - "type": "custom" - }, - { - "url": "https://www.paypal.me/colinpodell/10.00", - "type": "custom" - }, - { - "url": "https://github.com/colinodell", - "type": "github" - }, - { - "url": "https://www.patreon.com/colinodell", - "type": "patreon" - } - ], - "time": "2022-12-27T16:44:40+00:00" - }, - { - "name": "composer/semver", - "version": "3.4.0", - "source": { - "type": "git", - "url": "https://github.com/composer/semver.git", - "reference": "35e8d0af4486141bc745f23a29cc2091eb624a32" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/composer/semver/zipball/35e8d0af4486141bc745f23a29cc2091eb624a32", - "reference": "35e8d0af4486141bc745f23a29cc2091eb624a32", - "shasum": "" - }, - "require": { - "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-main": "3.x-dev" - } - }, - "autoload": { - "psr-4": { - "Composer\\Semver\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nils Adermann", - "email": "naderman@naderman.de", - "homepage": "http://www.naderman.de" - }, - { - "name": "Jordi Boggiano", - "email": "j.boggiano@seld.be", - "homepage": "http://seld.be" - }, - { - "name": "Rob Bast", - "email": "rob.bast@gmail.com", - "homepage": "http://robbast.nl" - } - ], - "description": "Semver library that offers utilities, version constraint parsing and validation.", - "keywords": [ - "semantic", - "semver", - "validation", - "versioning" - ], - "support": { - "irc": "ircs://irc.libera.chat:6697/composer", - "issues": "https://github.com/composer/semver/issues", - "source": "https://github.com/composer/semver/tree/3.4.0" - }, - "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": "2023-08-31T09:50:34+00:00" - }, - { - "name": "dnoegel/php-xdg-base-dir", - "version": "v0.1.1", - "source": { - "type": "git", - "url": "https://github.com/dnoegel/php-xdg-base-dir.git", - "reference": "8f8a6e48c5ecb0f991c2fdcf5f154a47d85f9ffd" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/dnoegel/php-xdg-base-dir/zipball/8f8a6e48c5ecb0f991c2fdcf5f154a47d85f9ffd", - "reference": "8f8a6e48c5ecb0f991c2fdcf5f154a47d85f9ffd", - "shasum": "" - }, - "require": { - "php": ">=5.3.2" - }, - "require-dev": { - "phpunit/phpunit": "~7.0|~6.0|~5.0|~4.8.35" - }, - "type": "library", - "autoload": { - "psr-4": { - "XdgBaseDir\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "description": "implementation of xdg base directory specification for php", - "support": { - "issues": "https://github.com/dnoegel/php-xdg-base-dir/issues", - "source": "https://github.com/dnoegel/php-xdg-base-dir/tree/v0.1.1" - }, - "time": "2019-12-04T15:06:13+00:00" - }, - { - "name": "felixfbecker/advanced-json-rpc", - "version": "v3.2.1", - "source": { - "type": "git", - "url": "https://github.com/felixfbecker/php-advanced-json-rpc.git", - "reference": "b5f37dbff9a8ad360ca341f3240dc1c168b45447" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/felixfbecker/php-advanced-json-rpc/zipball/b5f37dbff9a8ad360ca341f3240dc1c168b45447", - "reference": "b5f37dbff9a8ad360ca341f3240dc1c168b45447", - "shasum": "" - }, - "require": { - "netresearch/jsonmapper": "^1.0 || ^2.0 || ^3.0 || ^4.0", - "php": "^7.1 || ^8.0", - "phpdocumentor/reflection-docblock": "^4.3.4 || ^5.0.0" - }, - "require-dev": { - "phpunit/phpunit": "^7.0 || ^8.0" - }, - "type": "library", - "autoload": { - "psr-4": { - "AdvancedJsonRpc\\": "lib/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "ISC" - ], - "authors": [ - { - "name": "Felix Becker", - "email": "felix.b@outlook.com" - } - ], - "description": "A more advanced JSONRPC implementation", - "support": { - "issues": "https://github.com/felixfbecker/php-advanced-json-rpc/issues", - "source": "https://github.com/felixfbecker/php-advanced-json-rpc/tree/v3.2.1" - }, - "time": "2021-06-11T22:34:44+00:00" - }, - { - "name": "felixfbecker/language-server-protocol", - "version": "v1.5.2", - "source": { - "type": "git", - "url": "https://github.com/felixfbecker/php-language-server-protocol.git", - "reference": "6e82196ffd7c62f7794d778ca52b69feec9f2842" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/felixfbecker/php-language-server-protocol/zipball/6e82196ffd7c62f7794d778ca52b69feec9f2842", - "reference": "6e82196ffd7c62f7794d778ca52b69feec9f2842", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "require-dev": { - "phpstan/phpstan": "*", - "squizlabs/php_codesniffer": "^3.1", - "vimeo/psalm": "^4.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.x-dev" - } - }, - "autoload": { - "psr-4": { - "LanguageServerProtocol\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "ISC" - ], - "authors": [ - { - "name": "Felix Becker", - "email": "felix.b@outlook.com" - } - ], - "description": "PHP classes for the Language Server Protocol", - "keywords": [ - "language", - "microsoft", - "php", - "server" - ], - "support": { - "issues": "https://github.com/felixfbecker/php-language-server-protocol/issues", - "source": "https://github.com/felixfbecker/php-language-server-protocol/tree/v1.5.2" - }, - "time": "2022-03-02T22:36:06+00:00" - }, - { - "name": "fidry/cpu-core-counter", - "version": "0.4.1", - "source": { - "type": "git", - "url": "https://github.com/theofidry/cpu-core-counter.git", - "reference": "79261cc280aded96d098e1b0e0ba0c4881b432c2" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/theofidry/cpu-core-counter/zipball/79261cc280aded96d098e1b0e0ba0c4881b432c2", - "reference": "79261cc280aded96d098e1b0e0ba0c4881b432c2", - "shasum": "" - }, - "require": { - "php": "^7.2 || ^8.0" - }, - "require-dev": { - "fidry/makefile": "^0.2.0", - "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": "^9.5.26 || ^8.5.31", - "theofidry/php-cs-fixer-config": "^1.0", - "webmozarts/strict-phpunit": "^7.5" - }, - "type": "library", - "autoload": { - "psr-4": { - "Fidry\\CpuCoreCounter\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Théo FIDRY", - "email": "theo.fidry@gmail.com" - } - ], - "description": "Tiny utility to get the number of CPU cores.", - "keywords": [ - "CPU", - "core" - ], - "support": { - "issues": "https://github.com/theofidry/cpu-core-counter/issues", - "source": "https://github.com/theofidry/cpu-core-counter/tree/0.4.1" - }, - "funding": [ - { - "url": "https://github.com/theofidry", - "type": "github" - } - ], - "time": "2022-12-16T22:01:02+00:00" - }, - { - "name": "friendsofphp/php-cs-fixer", - "version": "v3.47.1", - "source": { - "type": "git", - "url": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer.git", - "reference": "173c60d1eff911c9c54322704623a45561d3241d" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/PHP-CS-Fixer/PHP-CS-Fixer/zipball/173c60d1eff911c9c54322704623a45561d3241d", - "reference": "173c60d1eff911c9c54322704623a45561d3241d", - "shasum": "" - }, - "require": { - "composer/semver": "^3.4", - "composer/xdebug-handler": "^3.0.3", - "ext-filter": "*", - "ext-json": "*", - "ext-tokenizer": "*", - "php": "^7.4 || ^8.0", - "sebastian/diff": "^4.0 || ^5.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": { - "facile-it/paraunit": "^1.3 || ^2.0", - "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.4", - "php-cs-fixer/phpunit-constraint-xmlmatchesxsd": "^1.4", - "phpunit/phpunit": "^9.6 || ^10.5.5", - "symfony/yaml": "^5.4 || ^6.0 || ^7.0" - }, - "suggest": { - "ext-dom": "For handling output formats in XML", - "ext-mbstring": "For handling non-UTF8 characters." - }, - "bin": [ - "php-cs-fixer" - ], - "type": "application", - "autoload": { - "psr-4": { - "PhpCsFixer\\": "src/" - } - }, - "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.47.1" - }, - "funding": [ - { - "url": "https://github.com/keradus", - "type": "github" - } - ], - "time": "2024-01-16T18:54:21+00:00" - }, - { - "name": "infection/abstract-testframework-adapter", - "version": "0.5.0", - "source": { - "type": "git", - "url": "https://github.com/infection/abstract-testframework-adapter.git", - "reference": "18925e20d15d1a5995bb85c9dc09e8751e1e069b" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/infection/abstract-testframework-adapter/zipball/18925e20d15d1a5995bb85c9dc09e8751e1e069b", - "reference": "18925e20d15d1a5995bb85c9dc09e8751e1e069b", - "shasum": "" - }, - "require": { - "php": "^7.4 || ^8.0" - }, - "require-dev": { - "ergebnis/composer-normalize": "^2.8", - "friendsofphp/php-cs-fixer": "^2.17", - "phpunit/phpunit": "^9.5" - }, - "type": "library", - "autoload": { - "psr-4": { - "Infection\\AbstractTestFramework\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Maks Rafalko", - "email": "maks.rafalko@gmail.com" - } - ], - "description": "Abstract Test Framework Adapter for Infection", - "support": { - "issues": "https://github.com/infection/abstract-testframework-adapter/issues", - "source": "https://github.com/infection/abstract-testframework-adapter/tree/0.5.0" - }, - "funding": [ - { - "url": "https://github.com/infection", - "type": "github" - }, - { - "url": "https://opencollective.com/infection", - "type": "open_collective" - } - ], - "time": "2021-08-17T18:49:12+00:00" - }, - { - "name": "infection/extension-installer", - "version": "0.1.2", - "source": { - "type": "git", - "url": "https://github.com/infection/extension-installer.git", - "reference": "9b351d2910b9a23ab4815542e93d541e0ca0cdcf" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/infection/extension-installer/zipball/9b351d2910b9a23ab4815542e93d541e0ca0cdcf", - "reference": "9b351d2910b9a23ab4815542e93d541e0ca0cdcf", - "shasum": "" - }, - "require": { - "composer-plugin-api": "^1.1 || ^2.0" - }, - "require-dev": { - "composer/composer": "^1.9 || ^2.0", - "friendsofphp/php-cs-fixer": "^2.18, <2.19", - "infection/infection": "^0.15.2", - "php-coveralls/php-coveralls": "^2.4", - "phpstan/extension-installer": "^1.0", - "phpstan/phpstan": "^0.12.10", - "phpstan/phpstan-phpunit": "^0.12.6", - "phpstan/phpstan-strict-rules": "^0.12.2", - "phpstan/phpstan-webmozart-assert": "^0.12.2", - "phpunit/phpunit": "^9.5", - "vimeo/psalm": "^4.8" - }, - "type": "composer-plugin", - "extra": { - "class": "Infection\\ExtensionInstaller\\Plugin" - }, - "autoload": { - "psr-4": { - "Infection\\ExtensionInstaller\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Maks Rafalko", - "email": "maks.rafalko@gmail.com" - } - ], - "description": "Infection Extension Installer", - "support": { - "issues": "https://github.com/infection/extension-installer/issues", - "source": "https://github.com/infection/extension-installer/tree/0.1.2" - }, - "funding": [ - { - "url": "https://github.com/infection", - "type": "github" - }, - { - "url": "https://opencollective.com/infection", - "type": "open_collective" - } - ], - "time": "2021-10-20T22:08:34+00:00" - }, - { - "name": "infection/include-interceptor", - "version": "0.2.5", - "source": { - "type": "git", - "url": "https://github.com/infection/include-interceptor.git", - "reference": "0cc76d95a79d9832d74e74492b0a30139904bdf7" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/infection/include-interceptor/zipball/0cc76d95a79d9832d74e74492b0a30139904bdf7", - "reference": "0cc76d95a79d9832d74e74492b0a30139904bdf7", - "shasum": "" - }, - "require-dev": { - "friendsofphp/php-cs-fixer": "^2.16", - "infection/infection": "^0.15.0", - "phan/phan": "^2.4 || ^3", - "php-coveralls/php-coveralls": "^2.2", - "phpstan/phpstan": "^0.12.8", - "phpunit/phpunit": "^8.5", - "vimeo/psalm": "^3.8" - }, - "type": "library", - "autoload": { - "psr-4": { - "Infection\\StreamWrapper\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Maks Rafalko", - "email": "maks.rafalko@gmail.com" - } - ], - "description": "Stream Wrapper: Include Interceptor. Allows to replace included (autoloaded) file with another one.", - "support": { - "issues": "https://github.com/infection/include-interceptor/issues", - "source": "https://github.com/infection/include-interceptor/tree/0.2.5" - }, - "funding": [ - { - "url": "https://github.com/infection", - "type": "github" - }, - { - "url": "https://opencollective.com/infection", - "type": "open_collective" - } - ], - "time": "2021-08-09T10:03:57+00:00" - }, - { - "name": "infection/infection", - "version": "0.26.21", - "source": { - "type": "git", - "url": "https://github.com/infection/infection.git", - "reference": "9bbe4994d204587e0e27475e6681b66608a690a9" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/infection/infection/zipball/9bbe4994d204587e0e27475e6681b66608a690a9", - "reference": "9bbe4994d204587e0e27475e6681b66608a690a9", - "shasum": "" - }, - "require": { - "colinodell/json5": "^2.2", - "composer-runtime-api": "^2.0", - "composer/xdebug-handler": "^2.0 || ^3.0", - "ext-dom": "*", - "ext-json": "*", - "ext-libxml": "*", - "ext-mbstring": "*", - "fidry/cpu-core-counter": "^0.4.0", - "infection/abstract-testframework-adapter": "^0.5.0", - "infection/extension-installer": "^0.1.0", - "infection/include-interceptor": "^0.2.5", - "justinrainbow/json-schema": "^5.2.10", - "nikic/php-parser": "^4.15.1", - "ondram/ci-detector": "^4.1.0", - "php": "^8.1", - "sanmai/later": "^0.1.1", - "sanmai/pipeline": "^5.1 || ^6", - "sebastian/diff": "^3.0.2 || ^4.0 || ^5.0", - "symfony/console": "^5.4 || ^6.0", - "symfony/filesystem": "^5.4 || ^6.0", - "symfony/finder": "^5.4 || ^6.0", - "symfony/process": "^5.4 || ^6.0", - "thecodingmachine/safe": "^2.1.2", - "webmozart/assert": "^1.11" - }, - "conflict": { - "antecedent/patchwork": "<2.1.25", - "dg/bypass-finals": "<1.4.1", - "phpunit/php-code-coverage": ">9,<9.1.4 || >9.2.17,<9.2.21" - }, - "require-dev": { - "brianium/paratest": "^6.3", - "ext-simplexml": "*", - "fidry/makefile": "^0.2.0", - "helmich/phpunit-json-assert": "^3.0", - "phpspec/prophecy": "^1.15", - "phpspec/prophecy-phpunit": "^2.0", - "phpstan/extension-installer": "^1.1.0", - "phpstan/phpstan": "^1.3.0", - "phpstan/phpstan-phpunit": "^1.0.0", - "phpstan/phpstan-strict-rules": "^1.1.0", - "phpstan/phpstan-webmozart-assert": "^1.0.2", - "phpunit/phpunit": "^9.5.5", - "symfony/phpunit-bridge": "^5.4 || ^6.0", - "symfony/yaml": "^5.4 || ^6.0", - "thecodingmachine/phpstan-safe-rule": "^1.2.0" - }, - "bin": [ - "bin/infection" - ], - "type": "library", - "autoload": { - "psr-4": { - "Infection\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Maks Rafalko", - "email": "maks.rafalko@gmail.com", - "homepage": "https://twitter.com/maks_rafalko" - }, - { - "name": "Oleg Zhulnev", - "homepage": "https://github.com/sidz" - }, - { - "name": "Gert de Pagter", - "homepage": "https://github.com/BackEndTea" - }, - { - "name": "Théo FIDRY", - "email": "theo.fidry@gmail.com", - "homepage": "https://twitter.com/tfidry" - }, - { - "name": "Alexey Kopytko", - "email": "alexey@kopytko.com", - "homepage": "https://www.alexeykopytko.com" - }, - { - "name": "Andreas Möller", - "email": "am@localheinz.com", - "homepage": "https://localheinz.com" - } - ], - "description": "Infection is a Mutation Testing framework for PHP. The mutation adequacy score can be used to measure the effectiveness of a test set in terms of its ability to detect faults.", - "keywords": [ - "coverage", - "mutant", - "mutation framework", - "mutation testing", - "testing", - "unit testing" - ], - "support": { - "issues": "https://github.com/infection/infection/issues", - "source": "https://github.com/infection/infection/tree/0.26.21" - }, - "funding": [ - { - "url": "https://github.com/infection", - "type": "github" - }, - { - "url": "https://opencollective.com/infection", - "type": "open_collective" - } - ], - "time": "2023-04-25T19:40:27+00:00" - }, - { - "name": "justinrainbow/json-schema", - "version": "v5.2.13", - "source": { - "type": "git", - "url": "https://github.com/justinrainbow/json-schema.git", - "reference": "fbbe7e5d79f618997bc3332a6f49246036c45793" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/justinrainbow/json-schema/zipball/fbbe7e5d79f618997bc3332a6f49246036c45793", - "reference": "fbbe7e5d79f618997bc3332a6f49246036c45793", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "require-dev": { - "friendsofphp/php-cs-fixer": "~2.2.20||~2.15.1", - "json-schema/json-schema-test-suite": "1.2.0", - "phpunit/phpunit": "^4.8.35" - }, - "bin": [ - "bin/validate-json" - ], - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "5.0.x-dev" - } - }, - "autoload": { - "psr-4": { - "JsonSchema\\": "src/JsonSchema/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Bruno Prieto Reis", - "email": "bruno.p.reis@gmail.com" - }, - { - "name": "Justin Rainbow", - "email": "justin.rainbow@gmail.com" - }, - { - "name": "Igor Wiedler", - "email": "igor@wiedler.ch" - }, - { - "name": "Robert Schönthal", - "email": "seroscho@googlemail.com" - } - ], - "description": "A library to validate a json schema.", - "homepage": "https://github.com/justinrainbow/json-schema", - "keywords": [ - "json", - "schema" - ], - "support": { - "issues": "https://github.com/justinrainbow/json-schema/issues", - "source": "https://github.com/justinrainbow/json-schema/tree/v5.2.13" - }, - "time": "2023-09-26T02:20:38+00:00" - }, - { - "name": "myclabs/deep-copy", - "version": "1.11.1", - "source": { - "type": "git", - "url": "https://github.com/myclabs/DeepCopy.git", - "reference": "7284c22080590fb39f2ffa3e9057f10a4ddd0e0c" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/7284c22080590fb39f2ffa3e9057f10a4ddd0e0c", - "reference": "7284c22080590fb39f2ffa3e9057f10a4ddd0e0c", - "shasum": "" - }, - "require": { - "php": "^7.1 || ^8.0" - }, - "conflict": { - "doctrine/collections": "<1.6.8", - "doctrine/common": "<2.13.3 || >=3,<3.2.2" - }, - "require-dev": { - "doctrine/collections": "^1.6.8", - "doctrine/common": "^2.13.3 || ^3.2.2", - "phpunit/phpunit": "^7.5.20 || ^8.5.23 || ^9.5.13" - }, - "type": "library", - "autoload": { - "files": [ - "src/DeepCopy/deep_copy.php" - ], - "psr-4": { - "DeepCopy\\": "src/DeepCopy/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "description": "Create deep copies (clones) of your objects", - "keywords": [ - "clone", - "copy", - "duplicate", - "object", - "object graph" - ], - "support": { - "issues": "https://github.com/myclabs/DeepCopy/issues", - "source": "https://github.com/myclabs/DeepCopy/tree/1.11.1" - }, - "funding": [ - { - "url": "https://tidelift.com/funding/github/packagist/myclabs/deep-copy", - "type": "tidelift" - } - ], - "time": "2023-03-08T13:26:56+00:00" - }, - { - "name": "netresearch/jsonmapper", - "version": "v4.2.0", - "source": { - "type": "git", - "url": "https://github.com/cweiske/jsonmapper.git", - "reference": "f60565f8c0566a31acf06884cdaa591867ecc956" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/cweiske/jsonmapper/zipball/f60565f8c0566a31acf06884cdaa591867ecc956", - "reference": "f60565f8c0566a31acf06884cdaa591867ecc956", - "shasum": "" - }, - "require": { - "ext-json": "*", - "ext-pcre": "*", - "ext-reflection": "*", - "ext-spl": "*", - "php": ">=7.1" - }, - "require-dev": { - "phpunit/phpunit": "~7.5 || ~8.0 || ~9.0", - "squizlabs/php_codesniffer": "~3.5" - }, - "type": "library", - "autoload": { - "psr-0": { - "JsonMapper": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "OSL-3.0" - ], - "authors": [ - { - "name": "Christian Weiske", - "email": "cweiske@cweiske.de", - "homepage": "http://github.com/cweiske/jsonmapper/", - "role": "Developer" - } - ], - "description": "Map nested JSON structures onto PHP classes", - "support": { - "email": "cweiske@cweiske.de", - "issues": "https://github.com/cweiske/jsonmapper/issues", - "source": "https://github.com/cweiske/jsonmapper/tree/v4.2.0" - }, - "time": "2023-04-09T17:37:40+00:00" - }, - { - "name": "ocramius/package-versions", - "version": "2.8.0", - "source": { - "type": "git", - "url": "https://github.com/Ocramius/PackageVersions.git", - "reference": "7b5821f854cf1e6753c4ed7ceb3b11ae83bbad4e" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/Ocramius/PackageVersions/zipball/7b5821f854cf1e6753c4ed7ceb3b11ae83bbad4e", - "reference": "7b5821f854cf1e6753c4ed7ceb3b11ae83bbad4e", - "shasum": "" - }, - "require": { - "composer-runtime-api": "^2.2.0", - "php": "~8.1.0 || ~8.2.0 || ~8.3.0" - }, - "replace": { - "composer/package-versions-deprecated": "*" - }, - "require-dev": { - "composer/composer": "^2.6.3", - "doctrine/coding-standard": "^12.0.0", - "ext-zip": "^1.15.0", - "phpunit/phpunit": "^9.6.12", - "roave/infection-static-analysis-plugin": "^1.33", - "vimeo/psalm": "^5.15.0" - }, - "type": "library", - "autoload": { - "psr-4": { - "PackageVersions\\": "src/PackageVersions" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Marco Pivetta", - "email": "ocramius@gmail.com" - } - ], - "description": "Provides efficient querying for installed package versions (no runtime IO)", - "support": { - "issues": "https://github.com/Ocramius/PackageVersions/issues", - "source": "https://github.com/Ocramius/PackageVersions/tree/2.8.0" - }, - "funding": [ - { - "url": "https://github.com/Ocramius", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/ocramius/package-versions", - "type": "tidelift" - } - ], - "time": "2023-09-15T11:02:59+00:00" - }, - { - "name": "ondram/ci-detector", - "version": "4.1.0", - "source": { - "type": "git", - "url": "https://github.com/OndraM/ci-detector.git", - "reference": "8a4b664e916df82ff26a44709942dfd593fa6f30" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/OndraM/ci-detector/zipball/8a4b664e916df82ff26a44709942dfd593fa6f30", - "reference": "8a4b664e916df82ff26a44709942dfd593fa6f30", - "shasum": "" - }, - "require": { - "php": "^7.1 || ^8.0" - }, - "require-dev": { - "ergebnis/composer-normalize": "^2.2", - "lmc/coding-standard": "^1.3 || ^2.1", - "php-parallel-lint/php-parallel-lint": "^1.2", - "phpstan/extension-installer": "^1.0.5", - "phpstan/phpstan": "^0.12.58", - "phpstan/phpstan-phpunit": "^0.12.16", - "phpunit/phpunit": "^7.1 || ^8.0 || ^9.0" - }, - "type": "library", - "autoload": { - "psr-4": { - "OndraM\\CiDetector\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Ondřej Machulda", - "email": "ondrej.machulda@gmail.com" - } - ], - "description": "Detect continuous integration environment and provide unified access to properties of current build", - "keywords": [ - "CircleCI", - "Codeship", - "Wercker", - "adapter", - "appveyor", - "aws", - "aws codebuild", - "azure", - "azure devops", - "azure pipelines", - "bamboo", - "bitbucket", - "buddy", - "ci-info", - "codebuild", - "continuous integration", - "continuousphp", - "devops", - "drone", - "github", - "gitlab", - "interface", - "jenkins", - "pipelines", - "sourcehut", - "teamcity", - "travis" - ], - "support": { - "issues": "https://github.com/OndraM/ci-detector/issues", - "source": "https://github.com/OndraM/ci-detector/tree/4.1.0" - }, - "time": "2021-04-14T09:16:52+00:00" - }, - { - "name": "phar-io/manifest", - "version": "2.0.3", - "source": { - "type": "git", - "url": "https://github.com/phar-io/manifest.git", - "reference": "97803eca37d319dfa7826cc2437fc020857acb53" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phar-io/manifest/zipball/97803eca37d319dfa7826cc2437fc020857acb53", - "reference": "97803eca37d319dfa7826cc2437fc020857acb53", - "shasum": "" - }, - "require": { - "ext-dom": "*", - "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.3" - }, - "time": "2021-07-20T11:28:43+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": "phpdocumentor/reflection-docblock", - "version": "5.3.0", - "source": { - "type": "git", - "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", - "reference": "622548b623e81ca6d78b721c5e029f4ce664f170" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/622548b623e81ca6d78b721c5e029f4ce664f170", - "reference": "622548b623e81ca6d78b721c5e029f4ce664f170", - "shasum": "" - }, - "require": { - "ext-filter": "*", - "php": "^7.2 || ^8.0", - "phpdocumentor/reflection-common": "^2.2", - "phpdocumentor/type-resolver": "^1.3", - "webmozart/assert": "^1.9.1" - }, - "require-dev": { - "mockery/mockery": "~1.3.2", - "psalm/phar": "^4.8" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "5.x-dev" - } - }, - "autoload": { - "psr-4": { - "phpDocumentor\\Reflection\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Mike van Riel", - "email": "me@mikevanriel.com" - }, - { - "name": "Jaap van Otterdijk", - "email": "account@ijaap.nl" - } - ], - "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.", - "support": { - "issues": "https://github.com/phpDocumentor/ReflectionDocBlock/issues", - "source": "https://github.com/phpDocumentor/ReflectionDocBlock/tree/5.3.0" - }, - "time": "2021-10-19T17:43:47+00:00" - }, - { - "name": "phpstan/phpstan", - "version": "1.10.56", - "source": { - "type": "git", - "url": "https://github.com/phpstan/phpstan.git", - "reference": "27816a01aea996191ee14d010f325434c0ee76fa" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan/zipball/27816a01aea996191ee14d010f325434c0ee76fa", - "reference": "27816a01aea996191ee14d010f325434c0ee76fa", - "shasum": "" - }, - "require": { - "php": "^7.2|^8.0" - }, - "conflict": { - "phpstan/phpstan-shim": "*" - }, - "bin": [ - "phpstan", - "phpstan.phar" - ], - "type": "library", - "autoload": { - "files": [ - "bootstrap.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "description": "PHPStan - PHP Static Analysis Tool", - "keywords": [ - "dev", - "static analysis" - ], - "support": { - "docs": "https://phpstan.org/user-guide/getting-started", - "forum": "https://github.com/phpstan/phpstan/discussions", - "issues": "https://github.com/phpstan/phpstan/issues", - "security": "https://github.com/phpstan/phpstan/security/policy", - "source": "https://github.com/phpstan/phpstan-src" - }, - "funding": [ - { - "url": "https://github.com/ondrejmirtes", - "type": "github" - }, - { - "url": "https://github.com/phpstan", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/phpstan/phpstan", - "type": "tidelift" - } - ], - "time": "2024-01-15T10:43:00+00:00" - }, - { - "name": "phpstan/phpstan-symfony", - "version": "1.3.7", - "source": { - "type": "git", - "url": "https://github.com/phpstan/phpstan-symfony.git", - "reference": "ef7db637be9b85fa00278fc3477ac66abe8eb7d1" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan-symfony/zipball/ef7db637be9b85fa00278fc3477ac66abe8eb7d1", - "reference": "ef7db637be9b85fa00278fc3477ac66abe8eb7d1", - "shasum": "" - }, - "require": { - "ext-simplexml": "*", - "php": "^7.2 || ^8.0", - "phpstan/phpstan": "^1.10.36" - }, - "conflict": { - "symfony/framework-bundle": "<3.0" - }, - "require-dev": { - "nikic/php-parser": "^4.13.0", - "php-parallel-lint/php-parallel-lint": "^1.2", - "phpstan/phpstan-phpunit": "^1.3.11", - "phpstan/phpstan-strict-rules": "^1.5.1", - "phpunit/phpunit": "^8.5.29 || ^9.5", - "psr/container": "1.0 || 1.1.1", - "symfony/config": "^5.4 || ^6.1", - "symfony/console": "^5.4 || ^6.1", - "symfony/dependency-injection": "^5.4 || ^6.1", - "symfony/form": "^5.4 || ^6.1", - "symfony/framework-bundle": "^5.4 || ^6.1", - "symfony/http-foundation": "^5.4 || ^6.1", - "symfony/messenger": "^5.4", - "symfony/polyfill-php80": "^1.24", - "symfony/serializer": "^5.4", - "symfony/service-contracts": "^2.2.0" - }, - "type": "phpstan-extension", - "extra": { - "phpstan": { - "includes": [ - "extension.neon", - "rules.neon" - ] - } - }, - "autoload": { - "psr-4": { - "PHPStan\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Lukáš Unger", - "email": "looky.msc@gmail.com", - "homepage": "https://lookyman.net" - } - ], - "description": "Symfony Framework extensions and rules for PHPStan", - "support": { - "issues": "https://github.com/phpstan/phpstan-symfony/issues", - "source": "https://github.com/phpstan/phpstan-symfony/tree/1.3.7" - }, - "time": "2024-01-10T21:54:42+00:00" - }, - { - "name": "phpunit/php-code-coverage", - "version": "10.1.11", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "78c3b7625965c2513ee96569a4dbb62601784145" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/78c3b7625965c2513ee96569a4dbb62601784145", - "reference": "78c3b7625965c2513ee96569a4dbb62601784145", - "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.11" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2023-12-21T15:38:30+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" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "description": "FilterIterator implementation that filters files based on a list of suffixes.", - "homepage": "https://github.com/sebastianbergmann/php-file-iterator/", - "keywords": [ - "filesystem", - "iterator" - ], - "support": { - "issues": "https://github.com/sebastianbergmann/php-file-iterator/issues", - "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.7", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "e5c5b397a95cb0db013270a985726fcae93e61b8" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/e5c5b397a95cb0db013270a985726fcae93e61b8", - "reference": "e5c5b397a95cb0db013270a985726fcae93e61b8", - "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.7" - }, - "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-01-14T16:40:30+00:00" - }, - { - "name": "rector/rector", - "version": "0.15.25", - "source": { - "type": "git", - "url": "https://github.com/rectorphp/rector.git", - "reference": "015935c7ed9e48a4f5895ba974f337e20a263841" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/rectorphp/rector/zipball/015935c7ed9e48a4f5895ba974f337e20a263841", - "reference": "015935c7ed9e48a4f5895ba974f337e20a263841", - "shasum": "" - }, - "require": { - "php": "^7.2|^8.0", - "phpstan/phpstan": "^1.10.14" - }, - "conflict": { - "rector/rector-doctrine": "*", - "rector/rector-downgrade-php": "*", - "rector/rector-phpunit": "*", - "rector/rector-symfony": "*" - }, - "bin": [ - "bin/rector" - ], - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "0.15-dev" - } - }, - "autoload": { - "files": [ - "bootstrap.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "description": "Instant Upgrade and Automated Refactoring of any PHP code", - "keywords": [ - "automation", - "dev", - "migration", - "refactoring" - ], - "support": { - "issues": "https://github.com/rectorphp/rector/issues", - "source": "https://github.com/rectorphp/rector/tree/0.15.25" - }, - "funding": [ - { - "url": "https://github.com/tomasvotruba", - "type": "github" - } - ], - "time": "2023-04-20T16:07:39+00:00" - }, - { - "name": "roave/infection-static-analysis-plugin", - "version": "1.31.0", - "source": { - "type": "git", - "url": "https://github.com/Roave/infection-static-analysis-plugin.git", - "reference": "c8b4c262f6e7837ae5373ef456f181d231185b55" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/Roave/infection-static-analysis-plugin/zipball/c8b4c262f6e7837ae5373ef456f181d231185b55", - "reference": "c8b4c262f6e7837ae5373ef456f181d231185b55", - "shasum": "" - }, - "require": { - "infection/infection": "0.26.21", - "ocramius/package-versions": "^2.7.0", - "php": "~8.1.0 || ~8.2.0", - "sanmai/later": "^0.1.2", - "vimeo/psalm": "^4.30.0 || ^5.0.0" - }, - "require-dev": { - "doctrine/coding-standard": "^12.0.0", - "phpunit/phpunit": "^10.1.2" - }, - "bin": [ - "bin/roave-infection-static-analysis-plugin" - ], - "type": "library", - "autoload": { - "psr-4": { - "Roave\\InfectionStaticAnalysis\\": "src/Roave/InfectionStaticAnalysis" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Marco Pivetta", - "email": "ocramius@gmail.com" - } - ], - "description": "Static analysis on top of mutation testing - prevents escaped mutants from being invalid according to static analysis", - "support": { - "issues": "https://github.com/Roave/infection-static-analysis-plugin/issues", - "source": "https://github.com/Roave/infection-static-analysis-plugin/tree/1.31.0" - }, - "time": "2023-05-09T10:45:35+00:00" - }, - { - "name": "sanmai/later", - "version": "0.1.4", - "source": { - "type": "git", - "url": "https://github.com/sanmai/later.git", - "reference": "e24c4304a4b1349c2a83151a692cec0c10579f60" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sanmai/later/zipball/e24c4304a4b1349c2a83151a692cec0c10579f60", - "reference": "e24c4304a4b1349c2a83151a692cec0c10579f60", - "shasum": "" - }, - "require": { - "php": ">=7.4" - }, - "require-dev": { - "ergebnis/composer-normalize": "^2.8", - "friendsofphp/php-cs-fixer": "^3.35.1", - "infection/infection": ">=0.27.6", - "phan/phan": ">=2", - "php-coveralls/php-coveralls": "^2.0", - "phpstan/phpstan": ">=1.4.5", - "phpunit/phpunit": ">=9.5 <10", - "vimeo/psalm": ">=2" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "0.1.x-dev" - } - }, - "autoload": { - "files": [ - "src/functions.php" - ], - "psr-4": { - "Later\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "Apache-2.0" - ], - "authors": [ - { - "name": "Alexey Kopytko", - "email": "alexey@kopytko.com" - } - ], - "description": "Later: deferred wrapper object", - "support": { - "issues": "https://github.com/sanmai/later/issues", - "source": "https://github.com/sanmai/later/tree/0.1.4" - }, - "funding": [ - { - "url": "https://github.com/sanmai", - "type": "github" - } - ], - "time": "2023-10-24T00:25:28+00:00" - }, - { - "name": "sanmai/pipeline", - "version": "v6.9", - "source": { - "type": "git", - "url": "https://github.com/sanmai/pipeline.git", - "reference": "c48f45c22c3ce4140d071f7658fb151df1cc08ea" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sanmai/pipeline/zipball/c48f45c22c3ce4140d071f7658fb151df1cc08ea", - "reference": "c48f45c22c3ce4140d071f7658fb151df1cc08ea", - "shasum": "" - }, - "require": { - "php": "^7.4 || ^8.0" - }, - "require-dev": { - "ergebnis/composer-normalize": "^2.8", - "friendsofphp/php-cs-fixer": "^3.17", - "infection/infection": ">=0.10.5", - "league/pipeline": "^0.3 || ^1.0", - "phan/phan": ">=1.1", - "php-coveralls/php-coveralls": "^2.4.1", - "phpstan/phpstan": ">=0.10", - "phpunit/phpunit": ">=9.4", - "vimeo/psalm": ">=2" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "v6.x-dev" - } - }, - "autoload": { - "files": [ - "src/functions.php" - ], - "psr-4": { - "Pipeline\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "Apache-2.0" - ], - "authors": [ - { - "name": "Alexey Kopytko", - "email": "alexey@kopytko.com" - } - ], - "description": "General-purpose collections pipeline", - "support": { - "issues": "https://github.com/sanmai/pipeline/issues", - "source": "https://github.com/sanmai/pipeline/tree/v6.9" - }, - "funding": [ - { - "url": "https://github.com/sanmai", - "type": "github" - } - ], - "time": "2023-10-08T11:56:54+00:00" - }, - { - "name": "sebastian/cli-parser", - "version": "2.0.0", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/cli-parser.git", - "reference": "efdc130dbbbb8ef0b545a994fd811725c5282cae" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/cli-parser/zipball/efdc130dbbbb8ef0b545a994fd811725c5282cae", - "reference": "efdc130dbbbb8ef0b545a994fd811725c5282cae", - "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", - "source": "https://github.com/sebastianbergmann/cli-parser/tree/2.0.0" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2023-02-03T06:58:15+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.0", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/diff.git", - "reference": "fbf413a49e54f6b9b17e12d900ac7f6101591b7f" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/fbf413a49e54f6b9b17e12d900ac7f6101591b7f", - "reference": "fbf413a49e54f6b9b17e12d900ac7f6101591b7f", - "shasum": "" - }, - "require": { - "php": ">=8.1" - }, - "require-dev": { - "phpunit/phpunit": "^10.0", - "symfony/process": "^4.2 || ^5" - }, - "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.0" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2023-12-22T10:55:06+00:00" - }, - { - "name": "sebastian/environment", - "version": "6.0.1", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/environment.git", - "reference": "43c751b41d74f96cbbd4e07b7aec9675651e2951" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/43c751b41d74f96cbbd4e07b7aec9675651e2951", - "reference": "43c751b41d74f96cbbd4e07b7aec9675651e2951", - "shasum": "" - }, - "require": { - "php": ">=8.1" - }, - "require-dev": { - "phpunit/phpunit": "^10.0" - }, - "suggest": { - "ext-posix": "*" - }, - "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": "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.0.1" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2023-04-11T05:39:26+00:00" - }, - { - "name": "sebastian/exporter", - "version": "5.1.1", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/exporter.git", - "reference": "64f51654862e0f5e318db7e9dcc2292c63cdbddc" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/64f51654862e0f5e318db7e9dcc2292c63cdbddc", - "reference": "64f51654862e0f5e318db7e9dcc2292c63cdbddc", - "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.1" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2023-09-24T13:22:09+00:00" - }, - { - "name": "sebastian/global-state", - "version": "6.0.1", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/global-state.git", - "reference": "7ea9ead78f6d380d2a667864c132c2f7b83055e4" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/7ea9ead78f6d380d2a667864c132c2f7b83055e4", - "reference": "7ea9ead78f6d380d2a667864c132c2f7b83055e4", - "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": "http://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.1" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2023-07-19T07:19:23+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/type/issues", - "source": "https://github.com/sebastianbergmann/type/tree/4.0.0" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2023-02-03T07:10:45+00:00" - }, - { - "name": "sebastian/version", - "version": "4.0.1", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/version.git", - "reference": "c51fa83a5d8f43f1402e3f32a005e6262244ef17" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/c51fa83a5d8f43f1402e3f32a005e6262244ef17", - "reference": "c51fa83a5d8f43f1402e3f32a005e6262244ef17", - "shasum": "" - }, - "require": { - "php": ">=8.1" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "4.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "description": "Library that helps with managing the version number of Git-hosted PHP projects", - "homepage": "https://github.com/sebastianbergmann/version", - "support": { - "issues": "https://github.com/sebastianbergmann/version/issues", - "source": "https://github.com/sebastianbergmann/version/tree/4.0.1" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2023-02-07T11:34:05+00:00" - }, - { - "name": "spatie/array-to-xml", - "version": "3.2.2", - "source": { - "type": "git", - "url": "https://github.com/spatie/array-to-xml.git", - "reference": "96be97e664c87613121d073ea39af4c74e57a7f8" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/spatie/array-to-xml/zipball/96be97e664c87613121d073ea39af4c74e57a7f8", - "reference": "96be97e664c87613121d073ea39af4c74e57a7f8", - "shasum": "" - }, - "require": { - "ext-dom": "*", - "php": "^8.0" - }, - "require-dev": { - "mockery/mockery": "^1.2", - "pestphp/pest": "^1.21", - "spatie/pest-plugin-snapshots": "^1.1" - }, - "type": "library", - "autoload": { - "psr-4": { - "Spatie\\ArrayToXml\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Freek Van der Herten", - "email": "freek@spatie.be", - "homepage": "https://freek.dev", - "role": "Developer" - } - ], - "description": "Convert an array to xml", - "homepage": "https://github.com/spatie/array-to-xml", - "keywords": [ - "array", - "convert", - "xml" - ], - "support": { - "source": "https://github.com/spatie/array-to-xml/tree/3.2.2" - }, - "funding": [ - { - "url": "https://spatie.be/open-source/support-us", - "type": "custom" - }, - { - "url": "https://github.com/spatie", - "type": "github" - } - ], - "time": "2023-11-14T14:08:51+00:00" - }, - { - "name": "symfony/options-resolver", - "version": "v6.4.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/options-resolver.git", - "reference": "22301f0e7fdeaacc14318928612dee79be99860e" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/options-resolver/zipball/22301f0e7fdeaacc14318928612dee79be99860e", - "reference": "22301f0e7fdeaacc14318928612dee79be99860e", - "shasum": "" - }, - "require": { - "php": ">=8.1", - "symfony/deprecation-contracts": "^2.5|^3" - }, - "type": "library", - "autoload": { - "psr-4": { - "Symfony\\Component\\OptionsResolver\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Provides an improved replacement for the array_replace PHP function", - "homepage": "https://symfony.com", - "keywords": [ - "config", - "configuration", - "options" - ], - "support": { - "source": "https://github.com/symfony/options-resolver/tree/v6.4.0" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2023-08-08T10:16:24+00:00" - }, - { - "name": "symfony/polyfill-php80", - "version": "v1.28.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-php80.git", - "reference": "6caa57379c4aec19c0a12a38b59b26487dcfe4b5" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/6caa57379c4aec19c0a12a38b59b26487dcfe4b5", - "reference": "6caa57379c4aec19c0a12a38b59b26487dcfe4b5", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "1.28-dev" - }, - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } - }, - "autoload": { - "files": [ - "bootstrap.php" - ], - "psr-4": { - "Symfony\\Polyfill\\Php80\\": "" - }, - "classmap": [ - "Resources/stubs" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Ion Bazan", - "email": "ion.bazan@gmail.com" - }, - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony polyfill backporting some PHP 8.0+ features to lower PHP versions", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "polyfill", - "portable", - "shim" - ], - "support": { - "source": "https://github.com/symfony/polyfill-php80/tree/v1.28.0" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2023-01-26T09:26:14+00:00" - }, - { - "name": "symfony/polyfill-php81", - "version": "v1.28.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-php81.git", - "reference": "7581cd600fa9fd681b797d00b02f068e2f13263b" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php81/zipball/7581cd600fa9fd681b797d00b02f068e2f13263b", - "reference": "7581cd600fa9fd681b797d00b02f068e2f13263b", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "1.28-dev" - }, - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } - }, - "autoload": { - "files": [ - "bootstrap.php" - ], - "psr-4": { - "Symfony\\Polyfill\\Php81\\": "" - }, - "classmap": [ - "Resources/stubs" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony polyfill backporting some PHP 8.1+ features to lower PHP versions", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "polyfill", - "portable", - "shim" - ], - "support": { - "source": "https://github.com/symfony/polyfill-php81/tree/v1.28.0" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2023-01-26T09:26:14+00:00" - }, - { - "name": "symfony/process", - "version": "v6.4.2", - "source": { - "type": "git", - "url": "https://github.com/symfony/process.git", - "reference": "c4b1ef0bc80533d87a2e969806172f1c2a980241" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/c4b1ef0bc80533d87a2e969806172f1c2a980241", - "reference": "c4b1ef0bc80533d87a2e969806172f1c2a980241", - "shasum": "" - }, - "require": { - "php": ">=8.1" - }, - "type": "library", - "autoload": { - "psr-4": { - "Symfony\\Component\\Process\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Executes commands in sub-processes", - "homepage": "https://symfony.com", - "support": { - "source": "https://github.com/symfony/process/tree/v6.4.2" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2023-12-22T16:42:54+00:00" - }, - { - "name": "symfony/stopwatch", - "version": "v6.4.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/stopwatch.git", - "reference": "fc47f1015ec80927ff64ba9094dfe8b9d48fe9f2" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/stopwatch/zipball/fc47f1015ec80927ff64ba9094dfe8b9d48fe9f2", - "reference": "fc47f1015ec80927ff64ba9094dfe8b9d48fe9f2", - "shasum": "" - }, - "require": { - "php": ">=8.1", - "symfony/service-contracts": "^2.5|^3" - }, - "type": "library", - "autoload": { - "psr-4": { - "Symfony\\Component\\Stopwatch\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Provides a way to profile code", - "homepage": "https://symfony.com", - "support": { - "source": "https://github.com/symfony/stopwatch/tree/v6.4.0" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2023-02-16T10:14:28+00:00" - }, - { - "name": "thecodingmachine/safe", - "version": "v2.5.0", - "source": { - "type": "git", - "url": "https://github.com/thecodingmachine/safe.git", - "reference": "3115ecd6b4391662b4931daac4eba6b07a2ac1f0" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/thecodingmachine/safe/zipball/3115ecd6b4391662b4931daac4eba6b07a2ac1f0", - "reference": "3115ecd6b4391662b4931daac4eba6b07a2ac1f0", - "shasum": "" - }, - "require": { - "php": "^8.0" - }, - "require-dev": { - "phpstan/phpstan": "^1.5", - "phpunit/phpunit": "^9.5", - "squizlabs/php_codesniffer": "^3.2", - "thecodingmachine/phpstan-strict-rules": "^1.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.2.x-dev" - } - }, - "autoload": { - "files": [ - "deprecated/apc.php", - "deprecated/array.php", - "deprecated/datetime.php", - "deprecated/libevent.php", - "deprecated/misc.php", - "deprecated/password.php", - "deprecated/mssql.php", - "deprecated/stats.php", - "deprecated/strings.php", - "lib/special_cases.php", - "deprecated/mysqli.php", - "generated/apache.php", - "generated/apcu.php", - "generated/array.php", - "generated/bzip2.php", - "generated/calendar.php", - "generated/classobj.php", - "generated/com.php", - "generated/cubrid.php", - "generated/curl.php", - "generated/datetime.php", - "generated/dir.php", - "generated/eio.php", - "generated/errorfunc.php", - "generated/exec.php", - "generated/fileinfo.php", - "generated/filesystem.php", - "generated/filter.php", - "generated/fpm.php", - "generated/ftp.php", - "generated/funchand.php", - "generated/gettext.php", - "generated/gmp.php", - "generated/gnupg.php", - "generated/hash.php", - "generated/ibase.php", - "generated/ibmDb2.php", - "generated/iconv.php", - "generated/image.php", - "generated/imap.php", - "generated/info.php", - "generated/inotify.php", - "generated/json.php", - "generated/ldap.php", - "generated/libxml.php", - "generated/lzf.php", - "generated/mailparse.php", - "generated/mbstring.php", - "generated/misc.php", - "generated/mysql.php", - "generated/network.php", - "generated/oci8.php", - "generated/opcache.php", - "generated/openssl.php", - "generated/outcontrol.php", - "generated/pcntl.php", - "generated/pcre.php", - "generated/pgsql.php", - "generated/posix.php", - "generated/ps.php", - "generated/pspell.php", - "generated/readline.php", - "generated/rpminfo.php", - "generated/rrd.php", - "generated/sem.php", - "generated/session.php", - "generated/shmop.php", - "generated/sockets.php", - "generated/sodium.php", - "generated/solr.php", - "generated/spl.php", - "generated/sqlsrv.php", - "generated/ssdeep.php", - "generated/ssh2.php", - "generated/stream.php", - "generated/strings.php", - "generated/swoole.php", - "generated/uodbc.php", - "generated/uopz.php", - "generated/url.php", - "generated/var.php", - "generated/xdiff.php", - "generated/xml.php", - "generated/xmlrpc.php", - "generated/yaml.php", - "generated/yaz.php", - "generated/zip.php", - "generated/zlib.php" - ], - "classmap": [ - "lib/DateTime.php", - "lib/DateTimeImmutable.php", - "lib/Exceptions/", - "deprecated/Exceptions/", - "generated/Exceptions/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "description": "PHP core functions that throw exceptions instead of returning FALSE on error", - "support": { - "issues": "https://github.com/thecodingmachine/safe/issues", - "source": "https://github.com/thecodingmachine/safe/tree/v2.5.0" - }, - "time": "2023-04-05T11:54:14+00:00" - }, - { - "name": "theseer/tokenizer", - "version": "1.2.2", - "source": { - "type": "git", - "url": "https://github.com/theseer/tokenizer.git", - "reference": "b2ad5003ca10d4ee50a12da31de12a5774ba6b96" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/theseer/tokenizer/zipball/b2ad5003ca10d4ee50a12da31de12a5774ba6b96", - "reference": "b2ad5003ca10d4ee50a12da31de12a5774ba6b96", - "shasum": "" - }, - "require": { - "ext-dom": "*", - "ext-tokenizer": "*", - "ext-xmlwriter": "*", - "php": "^7.2 || ^8.0" - }, - "type": "library", - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Arne Blankerts", - "email": "arne@blankerts.de", - "role": "Developer" - } - ], - "description": "A small library for converting tokenized PHP source code into XML and potentially other formats", - "support": { - "issues": "https://github.com/theseer/tokenizer/issues", - "source": "https://github.com/theseer/tokenizer/tree/1.2.2" - }, - "funding": [ - { - "url": "https://github.com/theseer", - "type": "github" - } - ], - "time": "2023-11-20T00:12:19+00:00" - }, - { - "name": "vimeo/psalm", - "version": "5.20.0", - "source": { - "type": "git", - "url": "https://github.com/vimeo/psalm.git", - "reference": "3f284e96c9d9be6fe6b15c79416e1d1903dcfef4" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/vimeo/psalm/zipball/3f284e96c9d9be6fe6b15c79416e1d1903dcfef4", - "reference": "3f284e96c9d9be6fe6b15c79416e1d1903dcfef4", - "shasum": "" - }, - "require": { - "amphp/amp": "^2.4.2", - "amphp/byte-stream": "^1.5", - "composer-runtime-api": "^2", - "composer/semver": "^1.4 || ^2.0 || ^3.0", - "composer/xdebug-handler": "^2.0 || ^3.0", - "dnoegel/php-xdg-base-dir": "^0.1.1", - "ext-ctype": "*", - "ext-dom": "*", - "ext-json": "*", - "ext-libxml": "*", - "ext-mbstring": "*", - "ext-simplexml": "*", - "ext-tokenizer": "*", - "felixfbecker/advanced-json-rpc": "^3.1", - "felixfbecker/language-server-protocol": "^1.5.2", - "fidry/cpu-core-counter": "^0.4.1 || ^0.5.1 || ^1.0.0", - "netresearch/jsonmapper": "^1.0 || ^2.0 || ^3.0 || ^4.0", - "nikic/php-parser": "^4.16", - "php": "^7.4 || ~8.0.0 || ~8.1.0 || ~8.2.0 || ~8.3.0", - "sebastian/diff": "^4.0 || ^5.0", - "spatie/array-to-xml": "^2.17.0 || ^3.0", - "symfony/console": "^4.1.6 || ^5.0 || ^6.0 || ^7.0", - "symfony/filesystem": "^5.4 || ^6.0 || ^7.0" - }, - "conflict": { - "nikic/php-parser": "4.17.0" - }, - "provide": { - "psalm/psalm": "self.version" - }, - "require-dev": { - "amphp/phpunit-util": "^2.0", - "bamarni/composer-bin-plugin": "^1.4", - "brianium/paratest": "^6.9", - "ext-curl": "*", - "mockery/mockery": "^1.5", - "nunomaduro/mock-final-classes": "^1.1", - "php-parallel-lint/php-parallel-lint": "^1.2", - "phpstan/phpdoc-parser": "^1.6", - "phpunit/phpunit": "^9.6", - "psalm/plugin-mockery": "^1.1", - "psalm/plugin-phpunit": "^0.18", - "slevomat/coding-standard": "^8.4", - "squizlabs/php_codesniffer": "^3.6", - "symfony/process": "^4.4 || ^5.0 || ^6.0 || ^7.0" - }, - "suggest": { - "ext-curl": "In order to send data to shepherd", - "ext-igbinary": "^2.0.5 is required, used to serialize caching data" - }, - "bin": [ - "psalm", - "psalm-language-server", - "psalm-plugin", - "psalm-refactor", - "psalter" - ], - "type": "project", - "extra": { - "branch-alias": { - "dev-master": "5.x-dev", - "dev-4.x": "4.x-dev", - "dev-3.x": "3.x-dev", - "dev-2.x": "2.x-dev", - "dev-1.x": "1.x-dev" - } - }, - "autoload": { - "psr-4": { - "Psalm\\": "src/Psalm/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Matthew Brown" - } - ], - "description": "A static analysis tool for finding errors in PHP applications", - "keywords": [ - "code", - "inspection", - "php", - "static analysis" - ], - "support": { - "docs": "https://psalm.dev/docs", - "issues": "https://github.com/vimeo/psalm/issues", - "source": "https://github.com/vimeo/psalm" - }, - "time": "2024-01-18T12:15:06+00:00" - }, - { - "name": "webmozart/assert", - "version": "1.11.0", - "source": { - "type": "git", - "url": "https://github.com/webmozarts/assert.git", - "reference": "11cb2199493b2f8a3b53e7f19068fc6aac760991" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/webmozarts/assert/zipball/11cb2199493b2f8a3b53e7f19068fc6aac760991", - "reference": "11cb2199493b2f8a3b53e7f19068fc6aac760991", - "shasum": "" - }, - "require": { - "ext-ctype": "*", - "php": "^7.2 || ^8.0" - }, - "conflict": { - "phpstan/phpstan": "<0.12.20", - "vimeo/psalm": "<4.6.1 || 4.6.2" - }, - "require-dev": { - "phpunit/phpunit": "^8.5.13" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.10-dev" - } - }, - "autoload": { - "psr-4": { - "Webmozart\\Assert\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Bernhard Schussek", - "email": "bschussek@gmail.com" - } - ], - "description": "Assertions to validate method input/output with nice error messages.", - "keywords": [ - "assert", - "check", - "validate" - ], - "support": { - "issues": "https://github.com/webmozarts/assert/issues", - "source": "https://github.com/webmozarts/assert/tree/1.11.0" - }, - "time": "2022-06-03T18:03:27+00:00" - } - ], - "aliases": [], - "minimum-stability": "stable", - "stability-flags": [], - "prefer-stable": false, - "prefer-lowest": false, - "platform": { - "php": "^8.1", - "ext-json": "*" - }, - "platform-dev": [], - "platform-overrides": { - "php": "8.1" - }, - "plugin-api-version": "2.6.0" -} diff --git a/config/cache.php b/config/cache.php index efcebb33f..2fb67aba3 100644 --- a/config/cache.php +++ b/config/cache.php @@ -1,32 +1,20 @@ services(); - - $services - ->defaults() - ->public(); - - $services - ->set(AstFileReferenceFileCache::class) - ->args(['%deptrac.cache_file%', Application::VERSION]); - + $services->defaults()->public(); + $services->set(AstFileReferenceFileCache::class)->args(['%deptrac.cache_file%', Application::VERSION]); $services->alias(AstFileReferenceDeferredCacheInterface::class, AstFileReferenceFileCache::class); $services->alias(AstFileReferenceCacheInterface::class, AstFileReferenceDeferredCacheInterface::class); - - $services - ->set(CacheableFileSubscriber::class) - ->args([service(AstFileReferenceFileCache::class)]) - ->tag('kernel.event_subscriber'); + $services->set(CacheableFileSubscriber::class)->args([service(AstFileReferenceFileCache::class)])->tag('kernel.event_subscriber'); }; diff --git a/config/services.php b/config/services.php index dd20c76f2..fcb14714f 100644 --- a/config/services.php +++ b/config/services.php @@ -1,11 +1,12 @@ services(); - - $services - ->defaults() - ->autowire(); - + $services->defaults()->autowire(); /* * Utilities */ @@ -127,340 +122,123 @@ $services->alias(EventDispatcherInterface::class, EventDispatcher::class); $services->alias(Symfony\Component\EventDispatcher\EventDispatcherInterface::class, EventDispatcher::class); $services->alias('event_dispatcher', EventDispatcher::class); - $services - ->set(FileInputCollector::class) - ->args([ - '$paths' => param('paths'), - '$excludedFilePatterns' => param('exclude_files'), - '$basePath' => param('projectDirectory'), - ]); + $services->set(FileInputCollector::class)->args(['$paths' => param('paths'), '$excludedFilePatterns' => param('exclude_files'), '$basePath' => param('projectDirectory')]); $services->alias(InputCollectorInterface::class, FileInputCollector::class); $services->set(YmlFileLoader::class); - $services - ->set(Dumper::class) - ->args([ - '$templateFile' => __DIR__.'/deptrac_template.yaml', - ]); - + $services->set(Dumper::class)->args(['$templateFile' => __DIR__ . '/deptrac_template.yaml']); /* * AST */ $services->set(AstLoader::class); $services->set(ParserFactory::class); $services->set(Lexer::class); - $services - ->set(Parser::class) - ->factory([service(ParserFactory::class), 'create']) - ->args([ - '$kind' => ParserFactory::PREFER_PHP7, - ]); + $services->set(Parser::class)->factory([service(ParserFactory::class), 'create'])->args(['$kind' => ParserFactory::PREFER_PHP7]); $services->set(AstFileReferenceInMemoryCache::class); $services->alias(AstFileReferenceCacheInterface::class, AstFileReferenceInMemoryCache::class); - $services - ->set(NikicPhpParser::class) - ->args([ - '$extractors' => tagged_iterator('reference_extractors'), - ]); + $services->set(NikicPhpParser::class)->args(['$extractors' => tagged_iterator('reference_extractors')]); $services->alias(ParserInterface::class, NikicPhpParser::class); $services->set(TypeResolver::class); - $services - ->set(AnnotationReferenceExtractor::class) - ->tag('reference_extractors'); - $services - ->set(AnonymousClassExtractor::class) - ->tag('reference_extractors'); - $services - ->set(ClassConstantExtractor::class) - ->tag('reference_extractors'); - $services - ->set(FunctionLikeExtractor::class) - ->tag('reference_extractors'); - $services - ->set(PropertyExtractor::class) - ->tag('reference_extractors'); - $services - ->set(KeywordExtractor::class) - ->tag('reference_extractors'); - $services - ->set(StaticExtractor::class) - ->tag('reference_extractors'); - $services - ->set(FunctionLikeExtractor::class) - ->tag('reference_extractors'); - $services - ->set(VariableExtractor::class) - ->tag('reference_extractors'); - $services - ->set(FunctionCallResolver::class) - ->tag('reference_extractors'); - + $services->set(AnnotationReferenceExtractor::class)->tag('reference_extractors'); + $services->set(AnonymousClassExtractor::class)->tag('reference_extractors'); + $services->set(ClassConstantExtractor::class)->tag('reference_extractors'); + $services->set(FunctionLikeExtractor::class)->tag('reference_extractors'); + $services->set(PropertyExtractor::class)->tag('reference_extractors'); + $services->set(KeywordExtractor::class)->tag('reference_extractors'); + $services->set(StaticExtractor::class)->tag('reference_extractors'); + $services->set(FunctionLikeExtractor::class)->tag('reference_extractors'); + $services->set(VariableExtractor::class)->tag('reference_extractors'); + $services->set(FunctionCallResolver::class)->tag('reference_extractors'); /* * Dependency */ - $services - ->set(DependencyResolver::class) - ->args([ - '$config' => param('analyser'), - '$emitterLocator' => tagged_locator('dependency_emitter', 'key'), - ]); + $services->set(DependencyResolver::class)->args(['$config' => param('analyser'), '$emitterLocator' => tagged_locator('dependency_emitter', 'key')]); $services->set(TokenResolver::class); $services->set(InheritanceFlattener::class); - $services - ->set(ClassDependencyEmitter::class) - ->tag('dependency_emitter', ['key' => EmitterType::CLASS_TOKEN->value]); - $services - ->set(ClassSuperglobalDependencyEmitter::class) - ->tag('dependency_emitter', ['key' => EmitterType::CLASS_SUPERGLOBAL_TOKEN->value]); - $services - ->set(FileDependencyEmitter::class) - ->tag('dependency_emitter', ['key' => EmitterType::FILE_TOKEN->value]); - $services - ->set(FunctionDependencyEmitter::class) - ->tag('dependency_emitter', ['key' => EmitterType::FUNCTION_TOKEN->value]); - $services - ->set(FunctionCallDependencyEmitter::class) - ->tag('dependency_emitter', ['key' => EmitterType::FUNCTION_CALL->value]); - $services - ->set(FunctionSuperglobalDependencyEmitter::class) - ->tag('dependency_emitter', ['key' => EmitterType::FUNCTION_SUPERGLOBAL_TOKEN->value]); - $services - ->set(UsesDependencyEmitter::class) - ->tag('dependency_emitter', ['key' => EmitterType::USE_TOKEN->value]); - + $services->set(ClassDependencyEmitter::class)->tag('dependency_emitter', ['key' => EmitterType::CLASS_TOKEN->value]); + $services->set(ClassSuperglobalDependencyEmitter::class)->tag('dependency_emitter', ['key' => EmitterType::CLASS_SUPERGLOBAL_TOKEN->value]); + $services->set(FileDependencyEmitter::class)->tag('dependency_emitter', ['key' => EmitterType::FILE_TOKEN->value]); + $services->set(FunctionDependencyEmitter::class)->tag('dependency_emitter', ['key' => EmitterType::FUNCTION_TOKEN->value]); + $services->set(FunctionCallDependencyEmitter::class)->tag('dependency_emitter', ['key' => EmitterType::FUNCTION_CALL->value]); + $services->set(FunctionSuperglobalDependencyEmitter::class)->tag('dependency_emitter', ['key' => EmitterType::FUNCTION_SUPERGLOBAL_TOKEN->value]); + $services->set(UsesDependencyEmitter::class)->tag('dependency_emitter', ['key' => EmitterType::USE_TOKEN->value]); /* * Layer */ - $services - ->set(LayerResolver::class) - ->args([ - '$layers' => param('layers'), - ]); + $services->set(LayerResolver::class)->args(['$layers' => param('layers')]); $services->alias(LayerResolverInterface::class, LayerResolver::class); - $services - ->set(CollectorProvider::class) - ->args([ - '$collectorLocator' => tagged_locator('collector', 'type'), - ]); + $services->set(CollectorProvider::class)->args(['$collectorLocator' => tagged_locator('collector', 'type')]); $services->set(CollectorResolver::class); $services->alias(CollectorResolverInterface::class, CollectorResolver::class); - $services - ->set(AttributeCollector::class) - ->tag('collector', ['type' => CollectorType::TYPE_ATTRIBUTE->value]); - $services - ->set(BoolCollector::class) - ->tag('collector', ['type' => CollectorType::TYPE_BOOL->value]); - $services - ->set(ClassCollector::class) - ->tag('collector', ['type' => CollectorType::TYPE_CLASS->value]); - $services - ->set(ClassLikeCollector::class) - ->tag('collector', ['type' => CollectorType::TYPE_CLASSLIKE->value]); - $services - ->set(ClassNameRegexCollector::class) - ->tag('collector', ['type' => CollectorType::TYPE_CLASS_NAME_REGEX->value]); - $services - ->set(DirectoryCollector::class) - ->tag('collector', ['type' => CollectorType::TYPE_DIRECTORY->value]); - $services - ->set(ExtendsCollector::class) - ->tag('collector', ['type' => CollectorType::TYPE_EXTENDS->value]); - $services - ->set(FunctionNameCollector::class) - ->tag('collector', ['type' => CollectorType::TYPE_FUNCTION_NAME->value]); - $services - ->set(GlobCollector::class) - ->args([ - '$basePath' => param('projectDirectory'), - ]) - ->tag('collector', ['type' => CollectorType::TYPE_GLOB->value]); - $services - ->set(ImplementsCollector::class) - ->tag('collector', ['type' => CollectorType::TYPE_IMPLEMENTS->value]); - $services - ->set(InheritanceLevelCollector::class) - ->tag('collector', ['type' => CollectorType::TYPE_INHERITANCE->value]); - $services - ->set(InterfaceCollector::class) - ->tag('collector', ['type' => CollectorType::TYPE_INTERFACE->value]); - $services - ->set(InheritsCollector::class) - ->tag('collector', ['type' => CollectorType::TYPE_INHERITS->value]); - $services - ->set(LayerCollector::class) - ->tag('collector', ['type' => CollectorType::TYPE_LAYER->value]); - $services - ->set(MethodCollector::class) - ->tag('collector', ['type' => CollectorType::TYPE_METHOD->value]); - $services - ->set(SuperglobalCollector::class) - ->tag('collector', ['type' => CollectorType::TYPE_SUPERGLOBAL->value]); - $services - ->set(TraitCollector::class) - ->tag('collector', ['type' => CollectorType::TYPE_TRAIT->value]); - $services - ->set(UsesCollector::class) - ->tag('collector', ['type' => CollectorType::TYPE_USES->value]); - $services - ->set(PhpInternalCollector::class) - ->tag('collector', ['type' => CollectorType::TYPE_PHP_INTERNAL->value]); - $services - ->set(ComposerCollector::class) - ->tag('collector', ['type' => CollectorType::TYPE_COMPOSER->value]); - + $services->set(AttributeCollector::class)->tag('collector', ['type' => CollectorType::TYPE_ATTRIBUTE->value]); + $services->set(BoolCollector::class)->tag('collector', ['type' => CollectorType::TYPE_BOOL->value]); + $services->set(ClassCollector::class)->tag('collector', ['type' => CollectorType::TYPE_CLASS->value]); + $services->set(ClassLikeCollector::class)->tag('collector', ['type' => CollectorType::TYPE_CLASSLIKE->value]); + $services->set(ClassNameRegexCollector::class)->tag('collector', ['type' => CollectorType::TYPE_CLASS_NAME_REGEX->value]); + $services->set(DirectoryCollector::class)->tag('collector', ['type' => CollectorType::TYPE_DIRECTORY->value]); + $services->set(ExtendsCollector::class)->tag('collector', ['type' => CollectorType::TYPE_EXTENDS->value]); + $services->set(FunctionNameCollector::class)->tag('collector', ['type' => CollectorType::TYPE_FUNCTION_NAME->value]); + $services->set(GlobCollector::class)->args(['$basePath' => param('projectDirectory')])->tag('collector', ['type' => CollectorType::TYPE_GLOB->value]); + $services->set(ImplementsCollector::class)->tag('collector', ['type' => CollectorType::TYPE_IMPLEMENTS->value]); + $services->set(InheritanceLevelCollector::class)->tag('collector', ['type' => CollectorType::TYPE_INHERITANCE->value]); + $services->set(InterfaceCollector::class)->tag('collector', ['type' => CollectorType::TYPE_INTERFACE->value]); + $services->set(InheritsCollector::class)->tag('collector', ['type' => CollectorType::TYPE_INHERITS->value]); + $services->set(LayerCollector::class)->tag('collector', ['type' => CollectorType::TYPE_LAYER->value]); + $services->set(MethodCollector::class)->tag('collector', ['type' => CollectorType::TYPE_METHOD->value]); + $services->set(SuperglobalCollector::class)->tag('collector', ['type' => CollectorType::TYPE_SUPERGLOBAL->value]); + $services->set(TraitCollector::class)->tag('collector', ['type' => CollectorType::TYPE_TRAIT->value]); + $services->set(UsesCollector::class)->tag('collector', ['type' => CollectorType::TYPE_USES->value]); + $services->set(PhpInternalCollector::class)->tag('collector', ['type' => CollectorType::TYPE_PHP_INTERNAL->value]); + $services->set(ComposerCollector::class)->tag('collector', ['type' => CollectorType::TYPE_COMPOSER->value]); /* * Analyser */ $services->set(AstMapExtractor::class); - $services - ->set(UncoveredDependentHandler::class) - ->args([ - '$ignoreUncoveredInternalClasses' => param('ignore_uncovered_internal_classes'), - ]) - ->tag('kernel.event_subscriber'); - $services - ->set(MatchingLayersHandler::class) - ->tag('kernel.event_subscriber'); - $services - ->set(LayerProvider::class) - ->args([ - '$allowedLayers' => param('ruleset'), - ]); - $services - ->set(AllowDependencyHandler::class) - ->tag('kernel.event_subscriber'); - $services - ->set(DependsOnDisallowedLayer::class) - ->tag('kernel.event_subscriber'); - $services - ->set(DependsOnPrivateLayer::class) - ->tag('kernel.event_subscriber'); - $services - ->set(DependsOnInternalToken::class) - ->tag('kernel.event_subscriber'); - $services - ->set(UnmatchedSkippedViolations::class) - ->tag('kernel.event_subscriber'); - $services->set(EventHelper::class) - ->args([ - '$skippedViolations' => param('skip_violations'), - ]); - $services - ->set(DependencyLayersAnalyser::class); - $services->set(TokenInLayerAnalyser::class) - ->args([ - '$config' => param('analyser'), - ]); + $services->set(UncoveredDependentHandler::class)->args(['$ignoreUncoveredInternalClasses' => param('ignore_uncovered_internal_classes')])->tag('kernel.event_subscriber'); + $services->set(MatchingLayersHandler::class)->tag('kernel.event_subscriber'); + $services->set(LayerProvider::class)->args(['$allowedLayers' => param('ruleset')]); + $services->set(AllowDependencyHandler::class)->tag('kernel.event_subscriber'); + $services->set(DependsOnDisallowedLayer::class)->tag('kernel.event_subscriber'); + $services->set(DependsOnPrivateLayer::class)->tag('kernel.event_subscriber'); + $services->set(DependsOnInternalToken::class)->tag('kernel.event_subscriber'); + $services->set(UnmatchedSkippedViolations::class)->tag('kernel.event_subscriber'); + $services->set(EventHelper::class)->args(['$skippedViolations' => param('skip_violations')]); + $services->set(DependencyLayersAnalyser::class); + $services->set(TokenInLayerAnalyser::class)->args(['$config' => param('analyser')]); $services->set(LayerForTokenAnalyser::class); - $services->set(UnassignedTokenAnalyser::class) - ->args([ - '$config' => param('analyser'), - ]); + $services->set(UnassignedTokenAnalyser::class)->args(['$config' => param('analyser')]); $services->set(LayerDependenciesAnalyser::class); - $services->set(RulesetUsageAnalyser::class) - ->args([ - '$layers' => param('layers'), - ]); - + $services->set(RulesetUsageAnalyser::class)->args(['$layers' => param('layers')]); /* * OutputFormatter */ - $services - ->set(FormatterConfiguration::class) - ->args([ - '$config' => param('formatters'), - ]); - $services - ->set(FormatterProvider::class) - ->args([ - '$formatterLocator' => tagged_locator('output_formatter', null, 'getName'), - ]); - $services - ->set(ConsoleOutputFormatter::class) - ->tag('output_formatter'); - $services - ->set(GithubActionsOutputFormatter::class) - ->tag('output_formatter'); - $services - ->set(JUnitOutputFormatter::class) - ->tag('output_formatter'); - $services - ->set(TableOutputFormatter::class) - ->tag('output_formatter'); - $services - ->set(XMLOutputFormatter::class) - ->tag('output_formatter'); - $services - ->set(BaselineOutputFormatter::class) - ->tag('output_formatter'); - $services - ->set(JsonOutputFormatter::class) - ->tag('output_formatter'); - $services - ->set(GraphVizOutputDisplayFormatter::class) - ->tag('output_formatter'); - $services - ->set(GraphVizOutputImageFormatter::class) - ->tag('output_formatter'); - $services - ->set(GraphVizOutputDotFormatter::class) - ->tag('output_formatter'); - $services - ->set(GraphVizOutputHtmlFormatter::class) - ->tag('output_formatter'); - $services - ->set(CodeclimateOutputFormatter::class) - ->tag('output_formatter'); - + $services->set(FormatterConfiguration::class)->args(['$config' => param('formatters')]); + $services->set(FormatterProvider::class)->args(['$formatterLocator' => tagged_locator('output_formatter', null, 'getName')]); + $services->set(ConsoleOutputFormatter::class)->tag('output_formatter'); + $services->set(GithubActionsOutputFormatter::class)->tag('output_formatter'); + $services->set(JUnitOutputFormatter::class)->tag('output_formatter'); + $services->set(TableOutputFormatter::class)->tag('output_formatter'); + $services->set(XMLOutputFormatter::class)->tag('output_formatter'); + $services->set(BaselineOutputFormatter::class)->tag('output_formatter'); + $services->set(JsonOutputFormatter::class)->tag('output_formatter'); + $services->set(GraphVizOutputDisplayFormatter::class)->tag('output_formatter'); + $services->set(GraphVizOutputImageFormatter::class)->tag('output_formatter'); + $services->set(GraphVizOutputDotFormatter::class)->tag('output_formatter'); + $services->set(GraphVizOutputHtmlFormatter::class)->tag('output_formatter'); + $services->set(CodeclimateOutputFormatter::class)->tag('output_formatter'); /* * Console */ - $services - ->set(InitCommand::class) - ->autowire() - ->tag('console.command'); - $services - ->set(AnalyseRunner::class) - ->autowire(); - $services - ->set(AnalyseCommand::class) - ->autowire() - ->tag('console.command'); - $services - ->set(DebugLayerRunner::class) - ->autowire() - ->args([ - '$layers' => param('layers'), - ]); - $services - ->set(DebugLayerCommand::class) - ->autowire() - ->tag('console.command'); - $services - ->set(DebugTokenRunner::class) - ->autowire(); - $services - ->set(DebugTokenCommand::class) - ->autowire() - ->tag('console.command'); - $services - ->set(DebugUnassignedRunner::class) - ->autowire(); - $services - ->set(DebugUnassignedCommand::class) - ->autowire() - ->tag('console.command'); - $services - ->set(DebugDependenciesRunner::class) - ->autowire(); - $services - ->set(DebugDependenciesCommand::class) - ->autowire() - ->tag('console.command'); - $services - ->set(DebugUnusedRunner::class) - ->autowire(); - $services - ->set(DebugUnusedCommand::class) - ->autowire() - ->tag('console.command'); + $services->set(InitCommand::class)->autowire()->tag('console.command'); + $services->set(AnalyseRunner::class)->autowire(); + $services->set(AnalyseCommand::class)->autowire()->tag('console.command'); + $services->set(DebugLayerRunner::class)->autowire()->args(['$layers' => param('layers')]); + $services->set(DebugLayerCommand::class)->autowire()->tag('console.command'); + $services->set(DebugTokenRunner::class)->autowire(); + $services->set(DebugTokenCommand::class)->autowire()->tag('console.command'); + $services->set(DebugUnassignedRunner::class)->autowire(); + $services->set(DebugUnassignedCommand::class)->autowire()->tag('console.command'); + $services->set(DebugDependenciesRunner::class)->autowire(); + $services->set(DebugDependenciesCommand::class)->autowire()->tag('console.command'); + $services->set(DebugUnusedRunner::class)->autowire(); + $services->set(DebugUnusedCommand::class)->autowire()->tag('console.command'); }; diff --git a/deptrac b/deptrac deleted file mode 100755 index 5b24f7380..000000000 --- a/deptrac +++ /dev/null @@ -1,4 +0,0 @@ -#!/usr/bin/env php -services(); - $services->set(IgnoreDependenciesOnContract::class) - ->tag('kernel.event_subscriber'); - - $config - ->paths('src') - ->analysers( - EmitterType::CLASS_TOKEN, - EmitterType::CLASS_SUPERGLOBAL_TOKEN, - EmitterType::FILE_TOKEN, - EmitterType::FUNCTION_TOKEN, - EmitterType::FUNCTION_SUPERGLOBAL_TOKEN, - EmitterType::FUNCTION_CALL, - ) - ->layers( - $analyser = Layer::withName('Analyser')->collectors( - DirectoryConfig::create('src/Core/Analyser/.*') - ), - $ast = Layer::withName('Ast')->collectors( - DirectoryConfig::create('src/Core/Ast/.*'), - ComposerConfig::create() - ->addPackage('phpstan/phpdoc-parser') - ->addPackage('nikic/php-parser') - ->addPackage('phpdocumentor/type-resolver') - ->private(), - ), - $console = Layer::withName('Console')->collectors( - DirectoryConfig::create('src/Supportive/Console/.*') - ), - $dependency = Layer::withName('Dependency')->collectors( - DirectoryConfig::create('src/Core/Dependency/.*') - ), - $dependencyInjection = Layer::withName('DependencyInjection')->collectors( - DirectoryConfig::create('src/Supportive/DependencyInjection/.*') - ), - $contract = Layer::withName('Contract')->collectors( - DirectoryConfig::create('src/Contract/.*') - ), - $inputCollector = Layer::withName('InputCollector')->collectors( - DirectoryConfig::create('src/Core/InputCollector/.*') - ), - $layer = Layer::withName('Layer')->collectors( - DirectoryConfig::create('src/Core/Layer/.*') - ), - $outputFormatter = Layer::withName('OutputFormatter')->collectors( - DirectoryConfig::create('src/Supportive/OutputFormatter/.*'), - ComposerConfig::create('composer.json', 'composer.lock') - ->addPackage('phpdocumentor/graphviz')->private(), - ), - $file = Layer::withName('File')->collectors( - DirectoryConfig::create('src/Supportive/File/.*') - ), - $time = Layer::withName('Time')->collectors( - DirectoryConfig::create('src/Supportive/Time/.*') - ), - $supportive = Layer::withName('Supportive')->collectors( - BoolConfig::create() - ->mustNot(DirectoryConfig::create('src/Supportive/.*/.*')) - ->must(DirectoryConfig::create('src/Supportive/.*')) - ), - $symfony = Layer::withName('Symfony')->collectors( - ComposerConfig::create() - ->addPackage('symfony/config') - ->addPackage('symfony/console') - ->addPackage('symfony/dependency-injection') - ->addPackage('symfony/event-dispatcher') - ->addPackage('symfony/filesystem') - ->addPackage('symfony/finder') - ->addPackage('symfony/yaml'), - ), - ) - ->rulesets( - Ruleset::forLayer($layer)->accesses($ast, $symfony), - Ruleset::forLayer($console)->accesses($analyser, $outputFormatter, $dependencyInjection, $file, $time, $symfony), - Ruleset::forLayer($dependency)->accesses($ast), - Ruleset::forLayer($analyser)->accesses($layer, $dependency, $ast, $symfony), - Ruleset::forLayer($outputFormatter)->accesses($dependencyInjection, $symfony), - Ruleset::forLayer($ast)->accesses($file, $inputCollector, $symfony), - Ruleset::forLayer($inputCollector)->accesses($file, $symfony), - Ruleset::forLayer($supportive)->accesses($file), - Ruleset::forLayer($contract)->accesses($symfony), - Ruleset::forLayer($file)->accesses($symfony), - Ruleset::forLayer($dependencyInjection)->accesses($symfony), - ) - ->formatters( - GraphvizConfig::create() - ->pointsToGroup(true) - ->groups('Contract', $contract) - ->groups('Supportive', $supportive, $file, $symfony, $console, $dependencyInjection, $outputFormatter, $time) - ->groups('Core', $analyser, $ast, $dependency, $inputCollector, $layer) - ); + $services->set(IgnoreDependenciesOnContract::class)->tag('kernel.event_subscriber'); + $config->paths('src')->analysers(EmitterType::CLASS_TOKEN, EmitterType::CLASS_SUPERGLOBAL_TOKEN, EmitterType::FILE_TOKEN, EmitterType::FUNCTION_TOKEN, EmitterType::FUNCTION_SUPERGLOBAL_TOKEN, EmitterType::FUNCTION_CALL)->layers($analyser = Layer::withName('Analyser')->collectors(DirectoryConfig::create('src/Core/Analyser/.*')), $ast = Layer::withName('Ast')->collectors(DirectoryConfig::create('src/Core/Ast/.*'), ComposerConfig::create()->addPackage('phpstan/phpdoc-parser')->addPackage('nikic/php-parser')->addPackage('phpdocumentor/type-resolver')->private()), $console = Layer::withName('Console')->collectors(DirectoryConfig::create('src/Supportive/Console/.*')), $dependency = Layer::withName('Dependency')->collectors(DirectoryConfig::create('src/Core/Dependency/.*')), $dependencyInjection = Layer::withName('DependencyInjection')->collectors(DirectoryConfig::create('src/Supportive/DependencyInjection/.*')), $contract = Layer::withName('Contract')->collectors(DirectoryConfig::create('src/Contract/.*')), $inputCollector = Layer::withName('InputCollector')->collectors(DirectoryConfig::create('src/Core/InputCollector/.*')), $layer = Layer::withName('Layer')->collectors(DirectoryConfig::create('src/Core/Layer/.*')), $outputFormatter = Layer::withName('OutputFormatter')->collectors(DirectoryConfig::create('src/Supportive/OutputFormatter/.*'), ComposerConfig::create('composer.json', 'composer.lock')->addPackage('phpdocumentor/graphviz')->private()), $file = Layer::withName('File')->collectors(DirectoryConfig::create('src/Supportive/File/.*')), $time = Layer::withName('Time')->collectors(DirectoryConfig::create('src/Supportive/Time/.*')), $supportive = Layer::withName('Supportive')->collectors(BoolConfig::create()->mustNot(DirectoryConfig::create('src/Supportive/.*/.*'))->must(DirectoryConfig::create('src/Supportive/.*'))), $symfony = Layer::withName('Symfony')->collectors(ComposerConfig::create()->addPackage('symfony/config')->addPackage('symfony/console')->addPackage('symfony/dependency-injection')->addPackage('symfony/event-dispatcher')->addPackage('symfony/filesystem')->addPackage('symfony/finder')->addPackage('symfony/yaml')))->rulesets(Ruleset::forLayer($layer)->accesses($ast, $symfony), Ruleset::forLayer($console)->accesses($analyser, $outputFormatter, $dependencyInjection, $file, $time, $symfony), Ruleset::forLayer($dependency)->accesses($ast), Ruleset::forLayer($analyser)->accesses($layer, $dependency, $ast, $symfony), Ruleset::forLayer($outputFormatter)->accesses($dependencyInjection, $symfony), Ruleset::forLayer($ast)->accesses($file, $inputCollector, $symfony), Ruleset::forLayer($inputCollector)->accesses($file, $symfony), Ruleset::forLayer($supportive)->accesses($file), Ruleset::forLayer($contract)->accesses($symfony), Ruleset::forLayer($file)->accesses($symfony), Ruleset::forLayer($dependencyInjection)->accesses($symfony))->formatters(GraphvizConfig::create()->pointsToGroup(\true)->groups('Contract', $contract)->groups('Supportive', $supportive, $file, $symfony, $console, $dependencyInjection, $outputFormatter, $time)->groups('Core', $analyser, $ast, $dependency, $inputCollector, $layer)); }; diff --git a/deptrac.php b/deptrac.php deleted file mode 100755 index 8e339eb01..000000000 --- a/deptrac.php +++ /dev/null @@ -1,27 +0,0 @@ -check(); -unset($xdebug); - -(new Application())->run(); diff --git a/deptrac.yaml b/deptrac.yaml deleted file mode 100644 index a08abaa71..000000000 --- a/deptrac.yaml +++ /dev/null @@ -1,155 +0,0 @@ -services: - - class: Internal\Qossmic\Deptrac\IgnoreDependenciesOnContract - tags: - - { name: kernel.event_subscriber } - -deptrac: - paths: - - ./src - - analyser: - types: - - class - - class_superglobal - - file - - function - - function_superglobal - - function_call - - formatters: - graphviz: - pointToGroups: true - groups: - Contract: - - Contract - Supportive: - - Supportive - - File - - Time - - DependencyInjection - - OutputFormatter - - Symfony - Core: - - Analyser - - Ast - - Dependency - - InputCollector - - Layer - - layers: - # Domains - - name: Analyser - collectors: - - type: directory - value: src/Core/Analyser/.* - - name: Ast - collectors: - - type: directory - value: src/Core/Ast/.* - - type: composer - private: true - composerPath: composer.json - composerLockPath: composer.lock - packages: - - phpstan/phpdoc-parser - - nikic/php-parser - - phpdocumentor/type-resolver - - name: Console - collectors: - - type: directory - value: src/Supportive/Console/.* - - name: Dependency - collectors: - - type: directory - value: src/Core/Dependency/.* - - name: DependencyInjection - collectors: - - type: directory - value: src/Supportive/DependencyInjection/.* - - name: Contract - collectors: - - type: directory - value: src/Contract/.* - - name: InputCollector - collectors: - - type: directory - value: src/Core/InputCollector/.* - - name: Layer - collectors: - - type: directory - value: src/Core/Layer/.* - - name: OutputFormatter - collectors: - - type: directory - value: src/Supportive/OutputFormatter/.* - - type: composer - private: true - composerPath: composer.json - composerLockPath: composer.lock - packages: - - phpdocumentor/graphviz - - name: File - collectors: - - type: directory - value: src/Supportive/File/.* - - name: Time - collectors: - - type: directory - value: src/Supportive/Time/.* - - name: Supportive - collectors: - - type: bool - must_not: - - type: directory - value: src/Supportive/.*/.* - must: - - type: directory - value: src/Supportive/.* - - name: Symfony - collectors: - - type: composer - composerPath: composer.json - composerLockPath: composer.lock - packages: - - symfony/config - - symfony/console - - symfony/dependency-injection - - symfony/event-dispatcher - - symfony/filesystem - - symfony/finder - - symfony/yaml - - ruleset: - Layer: - - Ast - - Symfony - Console: - - Analyser - - OutputFormatter - - DependencyInjection - - File - - Time - - Symfony - Dependency: - - Ast - Analyser: - - Layer - - Dependency - - Ast - - Symfony - OutputFormatter: - - DependencyInjection - - Symfony - Ast: - - File - - InputCollector - - Symfony - InputCollector: - - File - - Symfony - DependencyInjection: - - Symfony - Contract: - - Symfony - File: - - Symfony diff --git a/docker-compose.yaml b/docker-compose.yaml deleted file mode 100644 index 348f3486f..000000000 --- a/docker-compose.yaml +++ /dev/null @@ -1,16 +0,0 @@ -version: '3.8' - -services: - deptrac: - build: - dockerfile: docker/php/Dockerfile - context: ./ - container_name: deptrac - tty: true - user: "${USER_ID:-1000}:${GROUP_ID:-1000}" - working_dir: /var/www/deptrac - volumes: - - ./:/var/www/deptrac - extra_hosts: - - host.docker.internal:${HOST_IP:-172.17.0.1} - diff --git a/docker/php/Dockerfile b/docker/php/Dockerfile deleted file mode 100644 index d5962685d..000000000 --- a/docker/php/Dockerfile +++ /dev/null @@ -1,9 +0,0 @@ -FROM php:8.1-cli -RUN apt-get update && apt-get install -y git zip && apt-get clean -RUN pecl install xdebug \ - && docker-php-ext-enable xdebug \ - && pecl clear-cache \ - -WORKDIR /var/www/deptrac -COPY --from=composer /usr/bin/composer /usr/bin/composer - diff --git a/infection.json.dist b/infection.json.dist deleted file mode 100644 index 86100660a..000000000 --- a/infection.json.dist +++ /dev/null @@ -1,18 +0,0 @@ -{ - "timeout": 10, - "source": { - "directories": [ - "src" - ] - }, - "logs": { - "text": "infection.log" - }, - "mutators": { - "@default": true, - "global-ignoreSourceCodeByRegex": [ - "\\$output->writeLineFormatted.*" - ], - "CatchBlockRemoval": false - } -} diff --git a/internal/deptrac/IgnoreDependenciesOnContract.php b/internal/deptrac/IgnoreDependenciesOnContract.php deleted file mode 100644 index b0e9596ee..000000000 --- a/internal/deptrac/IgnoreDependenciesOnContract.php +++ /dev/null @@ -1,28 +0,0 @@ -dependentLayers)) { - $event->stopPropagation(); - } - } - - /** - * @return array - */ - public static function getSubscribedEvents(): array - { - return [ - ProcessEvent::class => 'onProcessEvent', - ]; - } -} diff --git a/internal/stubs/ClassLike.php b/internal/stubs/ClassLike.php deleted file mode 100644 index a3bd6c91b..000000000 --- a/internal/stubs/ClassLike.php +++ /dev/null @@ -1,15 +0,0 @@ - but returns list\\\\.$#" - count: 1 - path: src/Contract/Result/OutputResult.php - - - - message: "#^Method Qossmic\\\\Deptrac\\\\Core\\\\Ast\\\\AstMap\\\\ReferenceBuilder\\:\\:superglobal\\(\\) throws checked exception TypeError but it's missing from the PHPDoc @throws tag\\.$#" - count: 1 - path: src/Core/Ast/AstMap/ReferenceBuilder.php - - - - message: "#^Method Qossmic\\\\Deptrac\\\\Core\\\\Ast\\\\AstMap\\\\ReferenceBuilder\\:\\:superglobal\\(\\) throws checked exception ValueError but it's missing from the PHPDoc @throws tag\\.$#" - count: 1 - path: src/Core/Ast/AstMap/ReferenceBuilder.php - - - - message: "#^Method Qossmic\\\\Deptrac\\\\Supportive\\\\Console\\\\Command\\\\DebugTokenCommand\\:\\:execute\\(\\) throws checked exception TypeError but it's missing from the PHPDoc @throws tag\\.$#" - count: 1 - path: src/Supportive/Console/Command/DebugTokenCommand.php - - - - message: "#^Method Qossmic\\\\Deptrac\\\\Supportive\\\\Console\\\\Command\\\\DebugTokenCommand\\:\\:execute\\(\\) throws checked exception ValueError but it's missing from the PHPDoc @throws tag\\.$#" - count: 1 - path: src/Supportive/Console/Command/DebugTokenCommand.php diff --git a/phpstan.neon.dist b/phpstan.neon.dist deleted file mode 100644 index e0201ac68..000000000 --- a/phpstan.neon.dist +++ /dev/null @@ -1,23 +0,0 @@ -includes: - - phpstan-baseline.neon - - vendor/phpdocumentor/graphviz/extension.neon - - vendor/phpstan/phpstan/conf/bleedingEdge.neon - - vendor/phpstan/phpstan-symfony/extension.neon - -parameters: - reportUnmatchedIgnoredErrors: true - checkMissingIterableValueType: true - checkGenericClassInNonGenericObjectType: true - checkMissingCallableSignature: true - level: max - paths: [src] - tmpDir: ./.cache/phpstan - stubFiles: - - internal/stubs/Function_.php - - internal/stubs/ClassLike.php - - internal/stubs/Name.php - exceptions: - implicitThrows: false - check: - missingCheckedExceptionInThrows: true - tooWideThrowType: true diff --git a/phpunit.xml.dist b/phpunit.xml.dist deleted file mode 100644 index bb0c56643..000000000 --- a/phpunit.xml.dist +++ /dev/null @@ -1,14 +0,0 @@ - - - - - ./tests/ - - - - - - ./src - - - diff --git a/psalm.xml b/psalm.xml deleted file mode 100644 index 7e4e7b588..000000000 --- a/psalm.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - - - - - - diff --git a/scoper.inc.php b/scoper.inc.php deleted file mode 100644 index 5ad809106..000000000 --- a/scoper.inc.php +++ /dev/null @@ -1,29 +0,0 @@ -files() - ->in(__DIR__ . '/vendor/symfony/polyfill-*') - ->name('*.php'); - -return [ - 'prefix' => null, // string|null - 'finders' => [], // Finder[] - 'patchers' => [], // callable[] - 'exclude-files' => array_map( - static function ($file) { - return $file->getPathName(); - }, - iterator_to_array($polyfillsBootstrap) - ), - 'exclude-namespaces' => [ - 'Qossmic\Deptrac', - 'Symfony\Polyfill', - ], - 'expose-global-constants' => true, // bool - 'expose-global-classes' => true, // bool - 'expose-global-functions' => true, // bool -]; diff --git a/src/Contract/Analyser/AnalysisResult.php b/src/Contract/Analyser/AnalysisResult.php index cbb7771e0..ecb179e45 100644 --- a/src/Contract/Analyser/AnalysisResult.php +++ b/src/Contract/Analyser/AnalysisResult.php @@ -1,15 +1,12 @@ , array> Rule type -> (ruleInstanceHash -> Rule) */ private array $rules = []; - /** * @var list */ private array $warnings = []; - /** * @var list */ private array $errors = []; - - public function addRule(RuleInterface $rule): void + public function addRule(RuleInterface $rule) : void { $this->rules[$rule::class][spl_object_id($rule)] = $rule; } - - public function removeRule(RuleInterface $rule): void + public function removeRule(RuleInterface $rule) : void { unset($this->rules[$rule::class][spl_object_id($rule)]); } - /** * @return array, array> */ - public function rules(): array + public function rules() : array { return $this->rules; } - - public function addWarning(Warning $warning): void + public function addWarning(Warning $warning) : void { $this->warnings[] = $warning; } - /** * @return list */ - public function warnings(): array + public function warnings() : array { return $this->warnings; } - - public function addError(Error $error): void + public function addError(Error $error) : void { $this->errors[] = $error; } - /** * @return list */ - public function errors(): array + public function errors() : array { return $this->errors; } diff --git a/src/Contract/Analyser/EventHelper.php b/src/Contract/Analyser/EventHelper.php index a4c937044..fdd01035f 100644 --- a/src/Contract/Analyser/EventHelper.php +++ b/src/Contract/Analyser/EventHelper.php @@ -1,13 +1,11 @@ > depender layer -> list */ private array $unmatchedSkippedViolation; - /** * @param array> $skippedViolations */ - public function __construct( - private readonly array $skippedViolations, - public readonly LayerProvider $layerProvider, - ) { + public function __construct(private readonly array $skippedViolations, public readonly LayerProvider $layerProvider) + { $this->unmatchedSkippedViolation = $skippedViolations; } - /** * @internal */ - public function shouldViolationBeSkipped(string $depender, string $dependent): bool + public function shouldViolationBeSkipped(string $depender, string $dependent) : bool { $skippedViolation = $this->skippedViolations[$depender] ?? []; - $matched = [] !== $skippedViolation && in_array($dependent, $skippedViolation, true); - + $matched = [] !== $skippedViolation && \in_array($dependent, $skippedViolation, \true); if (!$matched) { - return false; + return \false; } - - if (false !== ($key = array_search($dependent, $this->unmatchedSkippedViolation[$depender], true))) { + if (\false !== ($key = \array_search($dependent, $this->unmatchedSkippedViolation[$depender], \true))) { unset($this->unmatchedSkippedViolation[$depender][$key]); } - - return true; + return \true; } - /** * @return array depender layer -> list */ - public function unmatchedSkippedViolations(): array + public function unmatchedSkippedViolations() : array { - return array_filter($this->unmatchedSkippedViolation); + return \array_filter($this->unmatchedSkippedViolation); } - - public function addSkippableViolation(ProcessEvent $event, AnalysisResult $result, string $dependentLayer, ViolationCreatingInterface $violationCreatingRule): void + public function addSkippableViolation(\Qossmic\Deptrac\Contract\Analyser\ProcessEvent $event, \Qossmic\Deptrac\Contract\Analyser\AnalysisResult $result, string $dependentLayer, \Qossmic\Deptrac\Contract\Analyser\ViolationCreatingInterface $violationCreatingRule) : void { - if ($this->shouldViolationBeSkipped( - $event->dependency->getDepender() - ->toString(), - $event->dependency->getDependent() - ->toString() - ) - ) { + if ($this->shouldViolationBeSkipped($event->dependency->getDepender()->toString(), $event->dependency->getDependent()->toString())) { $result->addRule(new SkippedViolation($event->dependency, $event->dependerLayer, $dependentLayer)); } else { $result->addRule(new Violation($event->dependency, $event->dependerLayer, $dependentLayer, $violationCreatingRule)); diff --git a/src/Contract/Analyser/PostProcessEvent.php b/src/Contract/Analyser/PostProcessEvent.php index d38c78211..c205f1bbe 100644 --- a/src/Contract/Analyser/PostProcessEvent.php +++ b/src/Contract/Analyser/PostProcessEvent.php @@ -1,11 +1,9 @@ result; } - - public function replaceResult(AnalysisResult $result): void + public function replaceResult(\Qossmic\Deptrac\Contract\Analyser\AnalysisResult $result) : void { $this->result = $result; } diff --git a/src/Contract/Analyser/ProcessEvent.php b/src/Contract/Analyser/ProcessEvent.php index 5f3b133c7..945abb884 100644 --- a/src/Contract/Analyser/ProcessEvent.php +++ b/src/Contract/Analyser/ProcessEvent.php @@ -1,13 +1,11 @@ $dependentLayers layer name and whether the dependency is public(true) or private(false) */ - public function __construct( - public readonly DependencyInterface $dependency, - public readonly TokenReferenceInterface $dependerReference, - public readonly string $dependerLayer, - public readonly TokenReferenceInterface $dependentReference, - public readonly array $dependentLayers, - private AnalysisResult $result = new AnalysisResult() - ) {} - - public function getResult(): AnalysisResult + public function __construct(public readonly DependencyInterface $dependency, public readonly TokenReferenceInterface $dependerReference, public readonly string $dependerLayer, public readonly TokenReferenceInterface $dependentReference, public readonly array $dependentLayers, private \Qossmic\Deptrac\Contract\Analyser\AnalysisResult $result = new \Qossmic\Deptrac\Contract\Analyser\AnalysisResult()) + { + } + public function getResult() : \Qossmic\Deptrac\Contract\Analyser\AnalysisResult { return $this->result; } - - public function replaceResult(AnalysisResult $ruleset): void + public function replaceResult(\Qossmic\Deptrac\Contract\Analyser\AnalysisResult $ruleset) : void { $this->result = $ruleset; } diff --git a/src/Contract/Analyser/ViolationCreatingInterface.php b/src/Contract/Analyser/ViolationCreatingInterface.php index b890cf299..4f23e974f 100644 --- a/src/Contract/Analyser/ViolationCreatingInterface.php +++ b/src/Contract/Analyser/ViolationCreatingInterface.php @@ -1,11 +1,9 @@ */ private array $mustNot = []; - /** @var array */ private array $must = []; - - private function __construct() {} - + private function __construct() + { + } /** * @param array $must * @param array $mostNot */ - public static function create(array $must = [], array $mostNot = []): self + public static function create(array $must = [], array $mostNot = []) : self { - return (new self()) - ->must(...$must) - ->mustNot(...$mostNot); + return (new self())->must(...$must)->mustNot(...$mostNot); } - - public function mustNot(CollectorConfig ...$collectorConfigs): self + public function mustNot(CollectorConfig ...$collectorConfigs) : self { foreach ($collectorConfigs as $collectorConfig) { $this->mustNot[] = $collectorConfig; } - return $this; } - - public function must(CollectorConfig ...$collectorConfigs): self + public function must(CollectorConfig ...$collectorConfigs) : self { foreach ($collectorConfigs as $collectorConfig) { $this->must[] = $collectorConfig; } - return $this; } - /** @return array{ * must: array|mixed, * must_not: array|mixed, * private: bool, * type: string} */ - public function toArray(): array + public function toArray() : array { - return [ - 'must_not' => array_map(static fn (CollectorConfig $v) => $v->toArray(), $this->mustNot), - 'must' => array_map(static fn (CollectorConfig $v) => $v->toArray(), $this->must), - 'private' => $this->private, - 'type' => $this->collectorType->value, - ]; + return ['must_not' => \array_map(static fn(CollectorConfig $v) => $v->toArray(), $this->mustNot), 'must' => \array_map(static fn(CollectorConfig $v) => $v->toArray(), $this->must), 'private' => $this->private, 'type' => $this->collectorType->value]; } } diff --git a/src/Contract/Config/Collector/ClassConfig.php b/src/Contract/Config/Collector/ClassConfig.php index e7a285d8d..4716784d7 100644 --- a/src/Contract/Config/Collector/ClassConfig.php +++ b/src/Contract/Config/Collector/ClassConfig.php @@ -4,7 +4,6 @@ use Qossmic\Deptrac\Contract\Config\CollectorType; use Qossmic\Deptrac\Contract\Config\ConfigurableCollectorConfig; - final class ClassConfig extends ConfigurableCollectorConfig { protected CollectorType $collectorType = CollectorType::TYPE_CLASS; diff --git a/src/Contract/Config/Collector/ClassLikeConfig.php b/src/Contract/Config/Collector/ClassLikeConfig.php index 2f57f558f..a49063608 100644 --- a/src/Contract/Config/Collector/ClassLikeConfig.php +++ b/src/Contract/Config/Collector/ClassLikeConfig.php @@ -4,7 +4,6 @@ use Qossmic\Deptrac\Contract\Config\CollectorType; use Qossmic\Deptrac\Contract\Config\ConfigurableCollectorConfig; - final class ClassLikeConfig extends ConfigurableCollectorConfig { protected CollectorType $collectorType = CollectorType::TYPE_CLASSLIKE; diff --git a/src/Contract/Config/Collector/ClassNameRegexConfig.php b/src/Contract/Config/Collector/ClassNameRegexConfig.php index cdfb91b8d..5553f4349 100644 --- a/src/Contract/Config/Collector/ClassNameRegexConfig.php +++ b/src/Contract/Config/Collector/ClassNameRegexConfig.php @@ -4,7 +4,6 @@ use Qossmic\Deptrac\Contract\Config\CollectorType; use Qossmic\Deptrac\Contract\Config\ConfigurableCollectorConfig; - final class ClassNameRegexConfig extends ConfigurableCollectorConfig { protected CollectorType $collectorType = CollectorType::TYPE_CLASS_NAME_REGEX; diff --git a/src/Contract/Config/Collector/ComposerConfig.php b/src/Contract/Config/Collector/ComposerConfig.php index ee96dfcf2..c09c72bba 100644 --- a/src/Contract/Config/Collector/ComposerConfig.php +++ b/src/Contract/Config/Collector/ComposerConfig.php @@ -4,39 +4,30 @@ use Qossmic\Deptrac\Contract\Config\CollectorConfig; use Qossmic\Deptrac\Contract\Config\CollectorType; - final class ComposerConfig extends CollectorConfig { protected CollectorType $collectorType = CollectorType::TYPE_COMPOSER; - /** @var list */ private array $packages = []; - - private function __construct( - private readonly string $composerPath, - private readonly string $composerLockPath, - ) {} - + private function __construct(private readonly string $composerPath, private readonly string $composerLockPath) + { + } /** * @param list $packages */ - public static function create(string $composerPath = 'composer.json', string $composerLockPath = 'composer.lock', array $packages = []): self + public static function create(string $composerPath = 'composer.json', string $composerLockPath = 'composer.lock', array $packages = []) : self { $result = new self($composerPath, $composerLockPath); foreach ($packages as $package) { $result->addPackage($package); } - return $result; } - - public function addPackage(string $package): self + public function addPackage(string $package) : self { $this->packages[] = $package; - return $this; } - /** @return array{ * composerPath: string, * composerLockPath: string, @@ -44,14 +35,8 @@ public function addPackage(string $package): self * private: bool, * type: string} */ - public function toArray(): array + public function toArray() : array { - return [ - 'composerPath' => $this->composerPath, - 'composerLockPath' => $this->composerLockPath, - 'packages' => $this->packages, - 'private' => $this->private, - 'type' => $this->collectorType->value, - ]; + return ['composerPath' => $this->composerPath, 'composerLockPath' => $this->composerLockPath, 'packages' => $this->packages, 'private' => $this->private, 'type' => $this->collectorType->value]; } } diff --git a/src/Contract/Config/Collector/DirectoryConfig.php b/src/Contract/Config/Collector/DirectoryConfig.php index 1009a9366..b008608ba 100644 --- a/src/Contract/Config/Collector/DirectoryConfig.php +++ b/src/Contract/Config/Collector/DirectoryConfig.php @@ -4,7 +4,6 @@ use Qossmic\Deptrac\Contract\Config\CollectorType; use Qossmic\Deptrac\Contract\Config\ConfigurableCollectorConfig; - final class DirectoryConfig extends ConfigurableCollectorConfig { protected CollectorType $collectorType = CollectorType::TYPE_DIRECTORY; diff --git a/src/Contract/Config/Collector/ExtendsConfig.php b/src/Contract/Config/Collector/ExtendsConfig.php index 23d702402..7368ad702 100644 --- a/src/Contract/Config/Collector/ExtendsConfig.php +++ b/src/Contract/Config/Collector/ExtendsConfig.php @@ -4,7 +4,6 @@ use Qossmic\Deptrac\Contract\Config\CollectorType; use Qossmic\Deptrac\Contract\Config\ConfigurableCollectorConfig; - final class ExtendsConfig extends ConfigurableCollectorConfig { protected CollectorType $collectorType = CollectorType::TYPE_EXTENDS; diff --git a/src/Contract/Config/Collector/FunctionNameConfig.php b/src/Contract/Config/Collector/FunctionNameConfig.php index 9b90877c0..bfce32182 100644 --- a/src/Contract/Config/Collector/FunctionNameConfig.php +++ b/src/Contract/Config/Collector/FunctionNameConfig.php @@ -4,7 +4,6 @@ use Qossmic\Deptrac\Contract\Config\CollectorType; use Qossmic\Deptrac\Contract\Config\ConfigurableCollectorConfig; - final class FunctionNameConfig extends ConfigurableCollectorConfig { protected CollectorType $collectorType = CollectorType::TYPE_FUNCTION_NAME; diff --git a/src/Contract/Config/Collector/GlobConfig.php b/src/Contract/Config/Collector/GlobConfig.php index 22778b9d7..0d07bd743 100644 --- a/src/Contract/Config/Collector/GlobConfig.php +++ b/src/Contract/Config/Collector/GlobConfig.php @@ -4,7 +4,6 @@ use Qossmic\Deptrac\Contract\Config\CollectorType; use Qossmic\Deptrac\Contract\Config\ConfigurableCollectorConfig; - final class GlobConfig extends ConfigurableCollectorConfig { protected CollectorType $collectorType = CollectorType::TYPE_GLOB; diff --git a/src/Contract/Config/Collector/ImplementsConfig.php b/src/Contract/Config/Collector/ImplementsConfig.php index af6d88ba3..a80dd819e 100644 --- a/src/Contract/Config/Collector/ImplementsConfig.php +++ b/src/Contract/Config/Collector/ImplementsConfig.php @@ -4,7 +4,6 @@ use Qossmic\Deptrac\Contract\Config\CollectorType; use Qossmic\Deptrac\Contract\Config\ConfigurableCollectorConfig; - final class ImplementsConfig extends ConfigurableCollectorConfig { protected CollectorType $collectorType = CollectorType::TYPE_IMPLEMENTS; diff --git a/src/Contract/Config/Collector/InheritsConfig.php b/src/Contract/Config/Collector/InheritsConfig.php index 033c6004a..07a4f8a2a 100644 --- a/src/Contract/Config/Collector/InheritsConfig.php +++ b/src/Contract/Config/Collector/InheritsConfig.php @@ -4,7 +4,6 @@ use Qossmic\Deptrac\Contract\Config\CollectorType; use Qossmic\Deptrac\Contract\Config\ConfigurableCollectorConfig; - final class InheritsConfig extends ConfigurableCollectorConfig { protected CollectorType $collectorType = CollectorType::TYPE_INHERITS; diff --git a/src/Contract/Config/Collector/InterfaceConfig.php b/src/Contract/Config/Collector/InterfaceConfig.php index 0deb5319f..45f3c7449 100644 --- a/src/Contract/Config/Collector/InterfaceConfig.php +++ b/src/Contract/Config/Collector/InterfaceConfig.php @@ -4,7 +4,6 @@ use Qossmic\Deptrac\Contract\Config\CollectorType; use Qossmic\Deptrac\Contract\Config\ConfigurableCollectorConfig; - final class InterfaceConfig extends ConfigurableCollectorConfig { protected CollectorType $collectorType = CollectorType::TYPE_INTERFACE; diff --git a/src/Contract/Config/Collector/LayerConfig.php b/src/Contract/Config/Collector/LayerConfig.php index b3b4b1c20..2878cef99 100644 --- a/src/Contract/Config/Collector/LayerConfig.php +++ b/src/Contract/Config/Collector/LayerConfig.php @@ -4,7 +4,6 @@ use Qossmic\Deptrac\Contract\Config\CollectorType; use Qossmic\Deptrac\Contract\Config\ConfigurableCollectorConfig; - final class LayerConfig extends ConfigurableCollectorConfig { protected CollectorType $collectorType = CollectorType::TYPE_LAYER; diff --git a/src/Contract/Config/Collector/MethodConfig.php b/src/Contract/Config/Collector/MethodConfig.php index a72e3b595..26e8b7af5 100644 --- a/src/Contract/Config/Collector/MethodConfig.php +++ b/src/Contract/Config/Collector/MethodConfig.php @@ -4,7 +4,6 @@ use Qossmic\Deptrac\Contract\Config\CollectorType; use Qossmic\Deptrac\Contract\Config\ConfigurableCollectorConfig; - final class MethodConfig extends ConfigurableCollectorConfig { protected CollectorType $collectorType = CollectorType::TYPE_METHOD; diff --git a/src/Contract/Config/Collector/PhpInteralConfig.php b/src/Contract/Config/Collector/PhpInteralConfig.php index c5a9ae760..2ce983826 100644 --- a/src/Contract/Config/Collector/PhpInteralConfig.php +++ b/src/Contract/Config/Collector/PhpInteralConfig.php @@ -4,7 +4,6 @@ use Qossmic\Deptrac\Contract\Config\CollectorType; use Qossmic\Deptrac\Contract\Config\ConfigurableCollectorConfig; - final class PhpInteralConfig extends ConfigurableCollectorConfig { protected CollectorType $collectorType = CollectorType::TYPE_PHP_INTERNAL; diff --git a/src/Contract/Config/Collector/SuperGlobalConfig.php b/src/Contract/Config/Collector/SuperGlobalConfig.php index 5eb8c360b..af7430b9b 100644 --- a/src/Contract/Config/Collector/SuperGlobalConfig.php +++ b/src/Contract/Config/Collector/SuperGlobalConfig.php @@ -4,32 +4,24 @@ use Qossmic\Deptrac\Contract\Config\CollectorConfig; use Qossmic\Deptrac\Contract\Config\CollectorType; - final class SuperGlobalConfig extends CollectorConfig { protected CollectorType $collectorType = CollectorType::TYPE_SUPERGLOBAL; - /** * @param string[] $config */ - private function __construct( - protected array $config, - ) {} - - public static function create(string ...$config): self + private function __construct(protected array $config) + { + } + public static function create(string ...$config) : self { return new self($config); } - /** * @return array{'private': bool, 'type': string, 'value': string[]} */ - public function toArray(): array + public function toArray() : array { - return [ - 'private' => $this->private, - 'type' => $this->collectorType->value, - 'value' => $this->config, - ]; + return ['private' => $this->private, 'type' => $this->collectorType->value, 'value' => $this->config]; } } diff --git a/src/Contract/Config/Collector/TraitConfig.php b/src/Contract/Config/Collector/TraitConfig.php index f67dc8786..322d17568 100644 --- a/src/Contract/Config/Collector/TraitConfig.php +++ b/src/Contract/Config/Collector/TraitConfig.php @@ -4,7 +4,6 @@ use Qossmic\Deptrac\Contract\Config\CollectorType; use Qossmic\Deptrac\Contract\Config\ConfigurableCollectorConfig; - final class TraitConfig extends ConfigurableCollectorConfig { protected CollectorType $collectorType = CollectorType::TYPE_TRAIT; diff --git a/src/Contract/Config/Collector/UsesConfig.php b/src/Contract/Config/Collector/UsesConfig.php index 3001fc7f7..1f34812db 100644 --- a/src/Contract/Config/Collector/UsesConfig.php +++ b/src/Contract/Config/Collector/UsesConfig.php @@ -4,7 +4,6 @@ use Qossmic\Deptrac\Contract\Config\CollectorType; use Qossmic\Deptrac\Contract\Config\ConfigurableCollectorConfig; - final class UsesConfig extends ConfigurableCollectorConfig { protected CollectorType $collectorType = CollectorType::TYPE_USES; diff --git a/src/Contract/Config/CollectorConfig.php b/src/Contract/Config/CollectorConfig.php index ec5d835f4..fb2f2794a 100644 --- a/src/Contract/Config/CollectorConfig.php +++ b/src/Contract/Config/CollectorConfig.php @@ -1,27 +1,20 @@ private = true; - + $this->private = \true; return $this; } - /** @return array{'type': string, 'private': bool} */ - public function toArray(): array + public function toArray() : array { - return [ - 'type' => $this->collectorType->value, - 'private' => $this->private, - ]; + return ['type' => $this->collectorType->value, 'private' => $this->private]; } } diff --git a/src/Contract/Config/CollectorType.php b/src/Contract/Config/CollectorType.php index 44d678e3f..cebd9d4ae 100644 --- a/src/Contract/Config/CollectorType.php +++ b/src/Contract/Config/CollectorType.php @@ -1,10 +1,9 @@ $this->config, - 'type' => $this->collectorType->value, - 'private' => $this->private, - ]; + return ['value' => $this->config, 'type' => $this->collectorType->value, 'private' => $this->private]; } - - private static function regex(string $regex): string + private static function regex(string $regex) : string { - return sprintf('%s', str_replace(self::ESCAPEES, self::ESCAPED, $regex)); + return \sprintf('%s', \str_replace(self::ESCAPEES, self::ESCAPED, $regex)); } } diff --git a/src/Contract/Config/DeptracConfig.php b/src/Contract/Config/DeptracConfig.php index a7ad3cedf..ab8a264e1 100644 --- a/src/Contract/Config/DeptracConfig.php +++ b/src/Contract/Config/DeptracConfig.php @@ -1,18 +1,15 @@ */ private array $paths = []; /** @var array */ @@ -27,118 +24,91 @@ final class DeptracConfig implements ConfigBuilderInterface private array $skipViolations = []; /** @var array */ private array $excludeFiles = []; - - public function analysers(EmitterType ...$types): self + public function analysers(\Qossmic\Deptrac\Contract\Config\EmitterType ...$types) : self { foreach ($types as $type) { $this->analyser[$type->value] = $type; } - return $this; } - /** * @throws ParseException */ - public function baseline(string $baseline): self + public function baseline(string $baseline) : self { /** @var array>> $baselineAsArray */ $baselineAsArray = Yaml::parseFile($baseline); - /** @var array> $skipViolations */ $skipViolations = $baselineAsArray['deptrac']['skip_violations'] ?? []; - foreach ($skipViolations as $class => $skipViolation) { $this->skipViolations[$class] = $skipViolation; } - return $this; } - - public function formatters(FormatterConfigInterface ...$formatters): self + public function formatters(FormatterConfigInterface ...$formatters) : self { foreach ($formatters as $formatter) { $this->formatters[$formatter->getName()] = $formatter; } - return $this; } - - public function paths(string ...$paths): self + public function paths(string ...$paths) : self { foreach ($paths as $path) { $this->paths[] = $path; } - return $this; } - - public function excludeFiles(string ...$excludeFiles): self + public function excludeFiles(string ...$excludeFiles) : self { foreach ($excludeFiles as $excludeFile) { $this->excludeFiles[] = $excludeFile; } - return $this; } - - public function layers(Layer ...$layerConfigs): self + public function layers(\Qossmic\Deptrac\Contract\Config\Layer ...$layerConfigs) : self { foreach ($layerConfigs as $layerConfig) { $this->layers[$layerConfig->name] = $layerConfig; } - return $this; } - - public function rulesets(Ruleset ...$rulesetConfigs): self + public function rulesets(\Qossmic\Deptrac\Contract\Config\Ruleset ...$rulesetConfigs) : self { foreach ($rulesetConfigs as $rulesetConfig) { $this->rulesets[$rulesetConfig->layerConfig->name] = $rulesetConfig; } - return $this; } - /** @return array */ - public function toArray(): array + public function toArray() : array { $config = []; - if ([] !== $this->paths) { $config['paths'] = $this->paths; } - if ([] !== $this->analyser) { - $config['analyser']['types'] = array_map(static fn (EmitterType $emitterType) => $emitterType->value, $this->analyser); + $config['analyser']['types'] = \array_map(static fn(\Qossmic\Deptrac\Contract\Config\EmitterType $emitterType) => $emitterType->value, $this->analyser); } - if ([] !== $this->formatters) { - $config['formatters'] = array_map(static fn (FormatterConfigInterface $formatterConfig) => $formatterConfig->toArray(), $this->formatters); + $config['formatters'] = \array_map(static fn(FormatterConfigInterface $formatterConfig) => $formatterConfig->toArray(), $this->formatters); } - if ([] !== $this->excludeFiles) { $config['exclude_files'] = $this->excludeFiles; } - if ([] !== $this->layers) { - $config['layers'] = array_map(static fn (Layer $layerConfig) => $layerConfig->toArray(), $this->layers); + $config['layers'] = \array_map(static fn(\Qossmic\Deptrac\Contract\Config\Layer $layerConfig) => $layerConfig->toArray(), $this->layers); } - if ([] !== $this->rulesets) { - $config['ruleset'] = array_map(static fn (Ruleset $rulesetConfig) => $rulesetConfig->toArray(), $this->rulesets); + $config['ruleset'] = \array_map(static fn(\Qossmic\Deptrac\Contract\Config\Ruleset $rulesetConfig) => $rulesetConfig->toArray(), $this->rulesets); } - if ([] !== $this->skipViolations) { $config['skip_violations'] = $this->skipViolations; } - $config['ignore_uncovered_internal_classes'] = $this->ignoreUncoveredInternalClasses; - return $config; } - - public function getExtensionAlias(): string + public function getExtensionAlias() : string { return 'deptrac'; } diff --git a/src/Contract/Config/EmitterType.php b/src/Contract/Config/EmitterType.php index df6634b4a..19db1870d 100644 --- a/src/Contract/Config/EmitterType.php +++ b/src/Contract/Config/EmitterType.php @@ -1,10 +1,9 @@ */ - public static function values(): array + public static function values() : array { - return array_map(static fn (self $type): string => $type->value, self::cases()); + return \array_map(static fn(self $type): string => $type->value, self::cases()); } } diff --git a/src/Contract/Config/Formatter/CodeclimateConfig.php b/src/Contract/Config/Formatter/CodeclimateConfig.php index 5126c600c..39c67f90a 100644 --- a/src/Contract/Config/Formatter/CodeclimateConfig.php +++ b/src/Contract/Config/Formatter/CodeclimateConfig.php @@ -3,48 +3,30 @@ namespace Qossmic\Deptrac\Contract\Config\Formatter; use Qossmic\Deptrac\Contract\Config\CodeclimateLevelEnum; - -final class CodeclimateConfig implements FormatterConfigInterface +final class CodeclimateConfig implements \Qossmic\Deptrac\Contract\Config\Formatter\FormatterConfigInterface { - private function __construct( - private CodeclimateLevelEnum $failure, - private CodeclimateLevelEnum $skipped, - private CodeclimateLevelEnum $uncovered, - ) {} - - public static function create( - CodeclimateLevelEnum $failure = CodeclimateLevelEnum::BLOCKER, - CodeclimateLevelEnum $skipped = CodeclimateLevelEnum::MINOR, - CodeclimateLevelEnum $uncovered = CodeclimateLevelEnum::INFO, - ): self { + private function __construct(private CodeclimateLevelEnum $failure, private CodeclimateLevelEnum $skipped, private CodeclimateLevelEnum $uncovered) + { + } + public static function create(CodeclimateLevelEnum $failure = CodeclimateLevelEnum::BLOCKER, CodeclimateLevelEnum $skipped = CodeclimateLevelEnum::MINOR, CodeclimateLevelEnum $uncovered = CodeclimateLevelEnum::INFO) : self + { return new self($failure, $skipped, $uncovered); } - - public function severity( - CodeclimateLevelEnum $failure = CodeclimateLevelEnum::BLOCKER, - CodeclimateLevelEnum $skipped = CodeclimateLevelEnum::MINOR, - CodeclimateLevelEnum $uncovered = CodeclimateLevelEnum::INFO, - ): static { + public function severity(CodeclimateLevelEnum $failure = CodeclimateLevelEnum::BLOCKER, CodeclimateLevelEnum $skipped = CodeclimateLevelEnum::MINOR, CodeclimateLevelEnum $uncovered = CodeclimateLevelEnum::INFO) : static + { $this->failure = $failure; $this->skipped = $skipped; $this->uncovered = $uncovered; - return $this; } - /** * @return array{'severity': array{'failure': string, 'skipped': string, 'uncovered': string}} */ - public function toArray(): array + public function toArray() : array { - return ['severity' => [ - 'failure' => $this->failure->value, - 'skipped' => $this->skipped->value, - 'uncovered' => $this->uncovered->value, - ]]; + return ['severity' => ['failure' => $this->failure->value, 'skipped' => $this->skipped->value, 'uncovered' => $this->uncovered->value]]; } - - public function getName(): string + public function getName() : string { return 'codeclimate'; } diff --git a/src/Contract/Config/Formatter/FormatterConfigInterface.php b/src/Contract/Config/Formatter/FormatterConfigInterface.php index 7a5c6e7f8..d80cddfcc 100644 --- a/src/Contract/Config/Formatter/FormatterConfigInterface.php +++ b/src/Contract/Config/Formatter/FormatterConfigInterface.php @@ -1,13 +1,11 @@ */ - public function toArray(): array; + public function toArray() : array; } diff --git a/src/Contract/Config/Formatter/GraphvizConfig.php b/src/Contract/Config/Formatter/GraphvizConfig.php index 31bc9157b..87c4dd912 100644 --- a/src/Contract/Config/Formatter/GraphvizConfig.php +++ b/src/Contract/Config/Formatter/GraphvizConfig.php @@ -1,75 +1,56 @@ */ private array $groups = []; - - private function __construct() {} - - public static function create(): self + private function __construct() + { + } + public static function create() : self { return new self(); } - - public function pointsToGroup(bool $pointsToGroup = true): self + public function pointsToGroup(bool $pointsToGroup = \true) : self { $this->pointsToGroup = $pointsToGroup; - return $this; } - - public function hiddenLayers(Layer ...$LayerConfigs): self + public function hiddenLayers(Layer ...$LayerConfigs) : self { foreach ($LayerConfigs as $layerConfig) { $this->hiddenLayers[] = $layerConfig; } - return $this; } - - public function groups(string $name, Layer ...$layerConfigs): self + public function groups(string $name, Layer ...$layerConfigs) : self { foreach ($layerConfigs as $layerConfig) { $this->groups[$name][] = $layerConfig; } - return $this; } - - public function toArray(): array + public function toArray() : array { $output = []; - if ([] !== $this->hiddenLayers) { - $output['hidden_layers'] = array_map(static fn (Layer $config) => $config->name, $this->hiddenLayers); + $output['hidden_layers'] = \array_map(static fn(Layer $config) => $config->name, $this->hiddenLayers); } - if ([] !== $this->groups) { - $output['groups'] = array_map( - static fn (array $configs) => array_map(static fn (Layer $layer) => $layer->name, $configs), - $this->groups - ); + $output['groups'] = \array_map(static fn(array $configs) => \array_map(static fn(Layer $layer) => $layer->name, $configs), $this->groups); } - $output['point_to_groups'] = $this->pointsToGroup; - return $output; } - - public function getName(): string + public function getName() : string { return $this->name; } diff --git a/src/Contract/Config/Layer.php b/src/Contract/Config/Layer.php index 4f5f07e2f..ed3b8a64c 100644 --- a/src/Contract/Config/Layer.php +++ b/src/Contract/Config/Layer.php @@ -1,7 +1,6 @@ */ private array $collectors = []; public string $name; - /** @param array $collectorConfig */ public function __construct(string $name, array $collectorConfig = []) { $this->name = $name; $this->collectors(...$collectorConfig); } - - public static function withName(string $name): self + public static function withName(string $name) : self { return new self($name); } - - public function collectors(CollectorConfig ...$collectorConfigs): self + public function collectors(\Qossmic\Deptrac\Contract\Config\CollectorConfig ...$collectorConfigs) : self { foreach ($collectorConfigs as $collectorConfig) { $this->collectors[] = $collectorConfig; } - return $this; } - /** @return array */ - public function toArray(): array + public function toArray() : array { - return [ - 'name' => $this->name, - 'collectors' => array_map(static fn (CollectorConfig $config) => $config->toArray(), $this->collectors), - ]; + return ['name' => $this->name, 'collectors' => \array_map(static fn(\Qossmic\Deptrac\Contract\Config\CollectorConfig $config) => $config->toArray(), $this->collectors)]; } } diff --git a/src/Contract/Config/Ruleset.php b/src/Contract/Config/Ruleset.php index 9797599aa..a5f96e711 100644 --- a/src/Contract/Config/Ruleset.php +++ b/src/Contract/Config/Ruleset.php @@ -1,42 +1,34 @@ */ private array $accessableLayers = []; - /** @param array $layerConfigs */ - public function __construct(Layer $layerConfig, array $layerConfigs) + public function __construct(\Qossmic\Deptrac\Contract\Config\Layer $layerConfig, array $layerConfigs) { $this->layerConfig = $layerConfig; $this->accesses(...$layerConfigs); } - - public static function forLayer(Layer $layerConfig): self + public static function forLayer(\Qossmic\Deptrac\Contract\Config\Layer $layerConfig) : self { return new self($layerConfig, []); } - - public function accesses(Layer ...$layerConfigs): self + public function accesses(\Qossmic\Deptrac\Contract\Config\Layer ...$layerConfigs) : self { foreach ($layerConfigs as $layerConfig) { $this->accessableLayers[] = $layerConfig; } - return $this; } - /** @return non-empty-array */ - public function toArray(): array + public function toArray() : array { - $data = array_map(static fn (Layer $layerConfig) => $layerConfig->name, $this->accessableLayers); - + $data = \array_map(static fn(\Qossmic\Deptrac\Contract\Config\Layer $layerConfig) => $layerConfig->name, $this->accessableLayers); return $data + ['name' => $this->layerConfig->name]; } } diff --git a/src/Contract/Dependency/DependencyInterface.php b/src/Contract/Dependency/DependencyInterface.php index 99218aa83..2fa855f2e 100644 --- a/src/Contract/Dependency/DependencyInterface.php +++ b/src/Contract/Dependency/DependencyInterface.php @@ -1,28 +1,22 @@ */ - public function serialize(): array; - - public function getType(): DependencyType; + public function serialize() : array; + public function getType() : DependencyType; } diff --git a/src/Contract/Dependency/PostEmitEvent.php b/src/Contract/Dependency/PostEmitEvent.php index 57a34053a..a448ba0f3 100644 --- a/src/Contract/Dependency/PostEmitEvent.php +++ b/src/Contract/Dependency/PostEmitEvent.php @@ -1,12 +1,12 @@ $others */ - public static function circularLayerDependency(string $layer, array $others): self + public static function circularLayerDependency(string $layer, array $others) : self { return new self(sprintf('Circular ruleset dependency for layer %s depending on: %s', $layer, implode('->', $others))); } diff --git a/src/Contract/Layer/CollectorInterface.php b/src/Contract/Layer/CollectorInterface.php index 735b364c5..85289936f 100644 --- a/src/Contract/Layer/CollectorInterface.php +++ b/src/Contract/Layer/CollectorInterface.php @@ -1,12 +1,10 @@ > $allowedLayers source layer -> target layers */ - public function __construct(private readonly array $allowedLayers) {} - + public function __construct(private readonly array $allowedLayers) + { + } /** * @return list * * @throws CircularReferenceException */ - public function getAllowedLayers(string $layerName): array + public function getAllowedLayers(string $layerName) : array { - return array_values(array_unique($this->getTransitiveDependencies($layerName, []))); + return \array_values(\array_unique($this->getTransitiveDependencies($layerName, []))); } - /** * @param list $previousLayers * @@ -31,20 +30,19 @@ public function getAllowedLayers(string $layerName): array * * @throws CircularReferenceException */ - private function getTransitiveDependencies(string $layerName, array $previousLayers): array + private function getTransitiveDependencies(string $layerName, array $previousLayers) : array { - if (in_array($layerName, $previousLayers, true)) { - throw CircularReferenceException::circularLayerDependency($layerName, $previousLayers); + if (\in_array($layerName, $previousLayers, \true)) { + throw \Qossmic\Deptrac\Contract\Layer\CircularReferenceException::circularLayerDependency($layerName, $previousLayers); } $dependencies = []; foreach ($this->allowedLayers[$layerName] ?? [] as $layer) { - if (str_starts_with($layer, '+')) { - $layer = ltrim($layer, '+'); - $dependencies[] = $this->getTransitiveDependencies($layer, array_merge([$layerName], $previousLayers)); + if (\str_starts_with($layer, '+')) { + $layer = \ltrim($layer, '+'); + $dependencies[] = $this->getTransitiveDependencies($layer, \array_merge([$layerName], $previousLayers)); } $dependencies[] = [$layer]; } - - return [] === $dependencies ? [] : array_merge(...$dependencies); + return [] === $dependencies ? [] : \array_merge(...$dependencies); } } diff --git a/src/Contract/OutputFormatter/OutputException.php b/src/Contract/OutputFormatter/OutputException.php index 9fce19fed..e1aaa40c6 100644 --- a/src/Contract/OutputFormatter/OutputException.php +++ b/src/Contract/OutputFormatter/OutputException.php @@ -1,18 +1,16 @@ |TableSeparator ...$list */ - public function definitionList(string|array|TableSeparator ...$list): void; - + public function definitionList(string|array|TableSeparator ...$list) : void; /** * @param mixed[] $headers * @param mixed[] $rows */ - public function table(array $headers, array $rows): void; - - public function newLine(int $count = 1): void; - - public function progressStart(int $max = 0): void; - - public function progressAdvance(int $step = 1): void; - - public function progressFinish(): void; + public function table(array $headers, array $rows) : void; + public function newLine(int $count = 1) : void; + public function progressStart(int $max = 0) : void; + public function progressAdvance(int $step = 1) : void; + public function progressFinish() : void; } diff --git a/src/Contract/Result/Allowed.php b/src/Contract/Result/Allowed.php index 420ce1b97..b7faf0e0f 100644 --- a/src/Contract/Result/Allowed.php +++ b/src/Contract/Result/Allowed.php @@ -1,35 +1,28 @@ dependency; } - - public function getDependerLayer(): string + public function getDependerLayer() : string { return $this->dependerLayer; } - - public function getDependentLayer(): string + public function getDependentLayer() : string { return $this->dependentLayer; } diff --git a/src/Contract/Result/CoveredRuleInterface.php b/src/Contract/Result/CoveredRuleInterface.php index 4d7da7755..dca555bf9 100644 --- a/src/Contract/Result/CoveredRuleInterface.php +++ b/src/Contract/Result/CoveredRuleInterface.php @@ -1,7 +1,6 @@ message; } diff --git a/src/Contract/Result/OutputResult.php b/src/Contract/Result/OutputResult.php index 3022fffe8..f5d07d8c4 100644 --- a/src/Contract/Result/OutputResult.php +++ b/src/Contract/Result/OutputResult.php @@ -1,13 +1,10 @@ $errors * @param list $warnings */ - private function __construct( - public readonly array $rules, - public readonly array $errors, - public readonly array $warnings - ) {} - - public static function fromAnalysisResult(AnalysisResult $analysisResult): self + private function __construct(public readonly array $rules, public readonly array $errors, public readonly array $warnings) + { + } + public static function fromAnalysisResult(AnalysisResult $analysisResult) : self { return new self($analysisResult->rules(), $analysisResult->errors(), $analysisResult->warnings()); } - /** * @template T of RuleInterface * @@ -38,15 +31,14 @@ public static function fromAnalysisResult(AnalysisResult $analysisResult): self * * @return list */ - public function allOf(string $type): array + public function allOf(string $type) : array { - return array_key_exists($type, $this->rules) ? array_values($this->rules[$type]) : []; + return \array_key_exists($type, $this->rules) ? \array_values($this->rules[$type]) : []; } - /** * @return list */ - public function allRules(): array + public function allRules() : array { $rules = []; foreach ($this->rules as $ruleArray) { @@ -54,58 +46,49 @@ public function allRules(): array $rules[] = $rule; } } - return $rules; } - /** * @return list */ - public function violations(): array + public function violations() : array { - return $this->allOf(Violation::class); + return $this->allOf(\Qossmic\Deptrac\Contract\Result\Violation::class); } - - public function hasViolations(): bool + public function hasViolations() : bool { return count($this->violations()) > 0; } - /** * @return list */ - public function skippedViolations(): array + public function skippedViolations() : array { - return $this->allOf(SkippedViolation::class); + return $this->allOf(\Qossmic\Deptrac\Contract\Result\SkippedViolation::class); } - /** * @return list */ - public function uncovered(): array + public function uncovered() : array { - return $this->allOf(Uncovered::class); + return $this->allOf(\Qossmic\Deptrac\Contract\Result\Uncovered::class); } - - public function hasUncovered(): bool + public function hasUncovered() : bool { return count($this->uncovered()) > 0; } - /** * @return list */ - public function allowed(): array + public function allowed() : array { - return $this->allOf(Allowed::class); + return $this->allOf(\Qossmic\Deptrac\Contract\Result\Allowed::class); } - - public function hasErrors(): bool + public function hasErrors() : bool { return count($this->errors) > 0; } - - public function hasWarnings(): bool + public function hasWarnings() : bool { return count($this->warnings) > 0; } diff --git a/src/Contract/Result/RuleInterface.php b/src/Contract/Result/RuleInterface.php index ea95bb04d..4b456bb6b 100644 --- a/src/Contract/Result/RuleInterface.php +++ b/src/Contract/Result/RuleInterface.php @@ -1,11 +1,9 @@ dependency; } - - public function getDependerLayer(): string + public function getDependerLayer() : string { return $this->dependerLayer; } - - public function getDependentLayer(): string + public function getDependentLayer() : string { return $this->dependentLayer; } diff --git a/src/Contract/Result/Uncovered.php b/src/Contract/Result/Uncovered.php index 67e3c8e98..63bbea99d 100644 --- a/src/Contract/Result/Uncovered.php +++ b/src/Contract/Result/Uncovered.php @@ -1,24 +1,20 @@ dependency; } diff --git a/src/Contract/Result/Violation.php b/src/Contract/Result/Violation.php index 7b52dfab1..6fdba1b7b 100644 --- a/src/Contract/Result/Violation.php +++ b/src/Contract/Result/Violation.php @@ -1,47 +1,37 @@ dependency; } - - public function getDependerLayer(): string + public function getDependerLayer() : string { return $this->dependerLayer; } - - public function getDependentLayer(): string + public function getDependentLayer() : string { return $this->dependentLayer; } - - public function ruleName(): string + public function ruleName() : string { return $this->violationCreatingRule->ruleName(); } - - public function ruleDescription(): string + public function ruleDescription() : string { return $this->violationCreatingRule->ruleDescription(); } diff --git a/src/Contract/Result/Warning.php b/src/Contract/Result/Warning.php index 82017ad69..e810ead85 100644 --- a/src/Contract/Result/Warning.php +++ b/src/Contract/Result/Warning.php @@ -1,11 +1,9 @@ message; } diff --git a/src/Core/Analyser/AnalyserException.php b/src/Core/Analyser/AnalyserException.php index 2c1a0c1cb..c82f7d7b7 100755 --- a/src/Core/Analyser/AnalyserException.php +++ b/src/Core/Analyser/AnalyserException.php @@ -1,7 +1,6 @@ astMapExtractor->extract(); - $dependencies = $this->dependencyResolver->resolve($astMap); - $result = new AnalysisResult(); $warnings = []; - foreach ($dependencies->getDependenciesAndInheritDependencies() as $dependency) { $depender = $dependency->getDepender(); $dependerRef = $this->tokenResolver->resolve($depender, $astMap); - $dependerLayers = array_keys($this->layerResolver->getLayersForReference($dependerRef)); - + $dependerLayers = \array_keys($this->layerResolver->getLayersForReference($dependerRef)); if (!isset($warnings[$depender->toString()]) && count($dependerLayers) > 1) { - $warnings[$depender->toString()] = - Warning::tokenIsInMoreThanOneLayer($depender->toString(), $dependerLayers); + $warnings[$depender->toString()] = Warning::tokenIsInMoreThanOneLayer($depender->toString(), $dependerLayers); } - $dependent = $dependency->getDependent(); $dependentRef = $this->tokenResolver->resolve($dependent, $astMap); $dependentLayers = $this->layerResolver->getLayersForReference($dependentRef); - foreach ($dependerLayers as $dependerLayer) { - $event = new ProcessEvent( - $dependency, $dependerRef, $dependerLayer, $dependentRef, $dependentLayers, $result - ); + $event = new ProcessEvent($dependency, $dependerRef, $dependerLayer, $dependentRef, $dependentLayers, $result); $this->eventDispatcher->dispatch($event); - $result = $event->getResult(); } } - foreach ($warnings as $warning) { $result->addWarning($warning); } - $event = new PostProcessEvent($result); $this->eventDispatcher->dispatch($event); - return $event->getResult(); } catch (InvalidEmitterConfigurationException $e) { - throw AnalyserException::invalidEmitterConfiguration($e); + throw \Qossmic\Deptrac\Core\Analyser\AnalyserException::invalidEmitterConfiguration($e); } catch (UnrecognizedTokenException $e) { - throw AnalyserException::unrecognizedToken($e); + throw \Qossmic\Deptrac\Core\Analyser\AnalyserException::unrecognizedToken($e); } catch (InvalidLayerDefinitionException $e) { - throw AnalyserException::invalidLayerDefinition($e); + throw \Qossmic\Deptrac\Core\Analyser\AnalyserException::invalidLayerDefinition($e); } catch (InvalidCollectorDefinitionException $e) { - throw AnalyserException::invalidCollectorDefinition($e); + throw \Qossmic\Deptrac\Core\Analyser\AnalyserException::invalidCollectorDefinition($e); } catch (AstException $e) { - throw AnalyserException::failedAstParsing($e); + throw \Qossmic\Deptrac\Core\Analyser\AnalyserException::failedAstParsing($e); } catch (CouldNotParseFileException $e) { - throw AnalyserException::couldNotParseFile($e); + throw \Qossmic\Deptrac\Core\Analyser\AnalyserException::couldNotParseFile($e); } } } diff --git a/src/Core/Analyser/EventHandler/AllowDependencyHandler.php b/src/Core/Analyser/EventHandler/AllowDependencyHandler.php index 6ca89d66f..b6876a400 100644 --- a/src/Core/Analyser/EventHandler/AllowDependencyHandler.php +++ b/src/Core/Analyser/EventHandler/AllowDependencyHandler.php @@ -1,13 +1,11 @@ ['invoke', -100], - ]; + return [ProcessEvent::class => ['invoke', -100]]; } - - public function invoke(ProcessEvent $event): void + public function invoke(ProcessEvent $event) : void { $ruleset = $event->getResult(); - foreach ($event->dependentLayers as $dependentLayer => $_) { $ruleset->addRule(new Allowed($event->dependency, $event->dependerLayer, $dependentLayer)); $event->stopPropagation(); diff --git a/src/Core/Analyser/EventHandler/DependsOnDisallowedLayer.php b/src/Core/Analyser/EventHandler/DependsOnDisallowedLayer.php index fe307a13f..c587628d5 100644 --- a/src/Core/Analyser/EventHandler/DependsOnDisallowedLayer.php +++ b/src/Core/Analyser/EventHandler/DependsOnDisallowedLayer.php @@ -1,7 +1,6 @@ ['invoke', -1], - ]; + return [ProcessEvent::class => ['invoke', -1]]; } - - public function invoke(ProcessEvent $event): void + public function invoke(ProcessEvent $event) : void { $ruleset = $event->getResult(); - try { $allowedLayers = $this->eventHelper->layerProvider->getAllowedLayers($event->dependerLayer); } catch (CircularReferenceException $circularReferenceException) { $ruleset->addError(new Error($circularReferenceException->getMessage())); $event->stopPropagation(); - return; } - foreach ($event->dependentLayers as $dependentLayer => $_) { - if (!in_array($dependentLayer, $allowedLayers, true)) { + if (!in_array($dependentLayer, $allowedLayers, \true)) { $this->eventHelper->addSkippableViolation($event, $ruleset, $dependentLayer, $this); $event->stopPropagation(); } } } - /** * @psalm-pure */ - public function ruleName(): string + public function ruleName() : string { return 'DependsOnDisallowedLayer'; } - /** * @psalm-pure */ - public function ruleDescription(): string + public function ruleDescription() : string { return 'You are depending on token that is a part of a layer that you are not allowed to depend on.'; } diff --git a/src/Core/Analyser/EventHandler/DependsOnInternalToken.php b/src/Core/Analyser/EventHandler/DependsOnInternalToken.php index 71d1017b5..a4d705553 100644 --- a/src/Core/Analyser/EventHandler/DependsOnInternalToken.php +++ b/src/Core/Analyser/EventHandler/DependsOnInternalToken.php @@ -1,54 +1,45 @@ ['invoke', -2], - ]; + return [ProcessEvent::class => ['invoke', -2]]; } - - public function invoke(ProcessEvent $event): void + public function invoke(ProcessEvent $event) : void { $ruleset = $event->getResult(); foreach ($event->dependentLayers as $dependentLayer => $_) { - if ($event->dependerLayer !== $dependentLayer - && $event->dependentReference instanceof ClassLikeReference - && $event->dependentReference->isInternal - ) { + if ($event->dependerLayer !== $dependentLayer && $event->dependentReference instanceof ClassLikeReference && $event->dependentReference->isInternal) { $this->eventHelper->addSkippableViolation($event, $ruleset, $dependentLayer, $this); $event->stopPropagation(); } } } - /** * @psalm-pure */ - public function ruleName(): string + public function ruleName() : string { return 'DependsOnInternalToken'; } - /** * @psalm-pure */ - public function ruleDescription(): string + public function ruleDescription() : string { return 'You are depending on a token that is internal to the layer and you are not part of that layer.'; } diff --git a/src/Core/Analyser/EventHandler/DependsOnPrivateLayer.php b/src/Core/Analyser/EventHandler/DependsOnPrivateLayer.php index 70554fa95..a4b8ae290 100644 --- a/src/Core/Analyser/EventHandler/DependsOnPrivateLayer.php +++ b/src/Core/Analyser/EventHandler/DependsOnPrivateLayer.php @@ -1,31 +1,26 @@ ['invoke', -3], - ]; + return [ProcessEvent::class => ['invoke', -3]]; } - - public function invoke(ProcessEvent $event): void + public function invoke(ProcessEvent $event) : void { $ruleset = $event->getResult(); - foreach ($event->dependentLayers as $dependentLayer => $isPublic) { if ($event->dependerLayer === $dependentLayer && !$isPublic) { $this->eventHelper->addSkippableViolation($event, $ruleset, $dependentLayer, $this); @@ -33,19 +28,17 @@ public function invoke(ProcessEvent $event): void } } } - /** * @psalm-pure */ - public function ruleName(): string + public function ruleName() : string { return 'DependsOnPrivateLayer'; } - /** * @psalm-pure */ - public function ruleDescription(): string + public function ruleDescription() : string { return 'You are depending on a part of a layer that was defined as private to that layer and you are not part of that layer.'; } diff --git a/src/Core/Analyser/EventHandler/MatchingLayersHandler.php b/src/Core/Analyser/EventHandler/MatchingLayersHandler.php index 068ec434f..3fe8771a8 100644 --- a/src/Core/Analyser/EventHandler/MatchingLayersHandler.php +++ b/src/Core/Analyser/EventHandler/MatchingLayersHandler.php @@ -1,34 +1,27 @@ dependentLayers as $dependeeLayer => $_) { if ($event->dependerLayer !== $dependeeLayer) { return; } } - // For empty dependee layers see UncoveredDependeeHandler - $event->stopPropagation(); } - public static function getSubscribedEvents() { - return [ - ProcessEvent::class => ['invoke', 1], - ]; + return [ProcessEvent::class => ['invoke', 1]]; } } diff --git a/src/Core/Analyser/EventHandler/UncoveredDependentHandler.php b/src/Core/Analyser/EventHandler/UncoveredDependentHandler.php index dbb22df71..6f3bbe7bf 100644 --- a/src/Core/Analyser/EventHandler/UncoveredDependentHandler.php +++ b/src/Core/Analyser/EventHandler/UncoveredDependentHandler.php @@ -1,53 +1,43 @@ dependency->getDependent(); $ruleset = $event->getResult(); - if ([] !== $event->dependentLayers) { return; } - if ($dependent instanceof ClassLikeToken && !$this->ignoreUncoveredInternalClass($dependent)) { $ruleset->addRule(new Uncovered($event->dependency, $event->dependerLayer)); } - $event->stopPropagation(); } - - private function ignoreUncoveredInternalClass(ClassLikeToken $token): bool + private function ignoreUncoveredInternalClass(ClassLikeToken $token) : bool { if (!$this->ignoreUncoveredInternalClasses) { - return false; + return \false; } - $tokenString = $token->toString(); - return isset(PhpStormStubsMap::CLASSES[$tokenString]) || 'ReturnTypeWillChange' === $tokenString; } - public static function getSubscribedEvents() { - return [ - ProcessEvent::class => ['invoke', 2], - ]; + return [ProcessEvent::class => ['invoke', 2]]; } } diff --git a/src/Core/Analyser/EventHandler/UnmatchedSkippedViolations.php b/src/Core/Analyser/EventHandler/UnmatchedSkippedViolations.php index 46c01ea57..645ea6f19 100644 --- a/src/Core/Analyser/EventHandler/UnmatchedSkippedViolations.php +++ b/src/Core/Analyser/EventHandler/UnmatchedSkippedViolations.php @@ -1,38 +1,32 @@ getResult(); - foreach ($this->eventHelper->unmatchedSkippedViolations() as $tokenA => $tokensB) { foreach ($tokensB as $tokenB) { $ruleset->addError(new Error(sprintf('Skipped violation "%s" for "%s" was not matched.', $tokenB, $tokenA))); } } } - public static function getSubscribedEvents() { - return [ - PostProcessEvent::class => ['handleUnmatchedSkipped'], - ]; + return [PostProcessEvent::class => ['handleUnmatchedSkipped']]; } } diff --git a/src/Core/Analyser/LayerDependenciesAnalyser.php b/src/Core/Analyser/LayerDependenciesAnalyser.php index 735514d6c..2db9f90c5 100644 --- a/src/Core/Analyser/LayerDependenciesAnalyser.php +++ b/src/Core/Analyser/LayerDependenciesAnalyser.php @@ -1,7 +1,6 @@ > * * @throws AnalyserException */ - public function getDependencies(string $layer, ?string $targetLayer): array + public function getDependencies(string $layer, ?string $targetLayer) : array { try { $result = []; $astMap = $this->astMapExtractor->extract(); $dependencies = $this->dependencyResolver->resolve($astMap); foreach ($dependencies->getDependenciesAndInheritDependencies() as $dependency) { - $dependerLayerNames = $this->layerResolver->getLayersForReference( - $this->tokenResolver->resolve($dependency->getDepender(), $astMap), - ); - if (array_key_exists($layer, $dependerLayerNames)) { - $dependentLayerNames = $this->layerResolver->getLayersForReference( - $this->tokenResolver->resolve($dependency->getDependent(), $astMap), - ); + $dependerLayerNames = $this->layerResolver->getLayersForReference($this->tokenResolver->resolve($dependency->getDepender(), $astMap)); + if (\array_key_exists($layer, $dependerLayerNames)) { + $dependentLayerNames = $this->layerResolver->getLayersForReference($this->tokenResolver->resolve($dependency->getDependent(), $astMap)); foreach ($dependentLayerNames as $dependentLayerName => $_) { - if ($layer === $dependentLayerName - || (null !== $targetLayer - && $targetLayer !== $dependentLayerName) - ) { + if ($layer === $dependentLayerName || null !== $targetLayer && $targetLayer !== $dependentLayerName) { continue; } $result[$dependentLayerName][] = new Uncovered($dependency, $dependentLayerName); } } } - return $result; } catch (InvalidEmitterConfigurationException $e) { - throw AnalyserException::invalidEmitterConfiguration($e); + throw \Qossmic\Deptrac\Core\Analyser\AnalyserException::invalidEmitterConfiguration($e); } catch (UnrecognizedTokenException $e) { - throw AnalyserException::unrecognizedToken($e); + throw \Qossmic\Deptrac\Core\Analyser\AnalyserException::unrecognizedToken($e); } catch (InvalidLayerDefinitionException $e) { - throw AnalyserException::invalidLayerDefinition($e); + throw \Qossmic\Deptrac\Core\Analyser\AnalyserException::invalidLayerDefinition($e); } catch (InvalidCollectorDefinitionException $e) { - throw AnalyserException::invalidCollectorDefinition($e); + throw \Qossmic\Deptrac\Core\Analyser\AnalyserException::invalidCollectorDefinition($e); } catch (AstException $e) { - throw AnalyserException::failedAstParsing($e); + throw \Qossmic\Deptrac\Core\Analyser\AnalyserException::failedAstParsing($e); } catch (CouldNotParseFileException $e) { - throw AnalyserException::couldNotParseFile($e); + throw \Qossmic\Deptrac\Core\Analyser\AnalyserException::couldNotParseFile($e); } } } diff --git a/src/Core/Analyser/LayerForTokenAnalyser.php b/src/Core/Analyser/LayerForTokenAnalyser.php index f808df4dd..bc0fb4d09 100644 --- a/src/Core/Analyser/LayerForTokenAnalyser.php +++ b/src/Core/Analyser/LayerForTokenAnalyser.php @@ -1,7 +1,6 @@ * * @throws AnalyserException */ - public function findLayerForToken(string $tokenName, TokenType $tokenType): array + public function findLayerForToken(string $tokenName, \Qossmic\Deptrac\Core\Analyser\TokenType $tokenType) : array { try { $astMap = $this->astMapExtractor->extract(); - return match ($tokenType) { - TokenType::CLASS_LIKE => $this->findLayersForReferences( - $astMap->getClassLikeReferences(), - $tokenName, - $astMap - ), - TokenType::FUNCTION => $this->findLayersForReferences( - $astMap->getFunctionReferences(), - $tokenName, - $astMap - ), - TokenType::FILE => $this->findLayersForReferences($astMap->getFileReferences(), $tokenName, $astMap) + \Qossmic\Deptrac\Core\Analyser\TokenType::CLASS_LIKE => $this->findLayersForReferences($astMap->getClassLikeReferences(), $tokenName, $astMap), + \Qossmic\Deptrac\Core\Analyser\TokenType::FUNCTION => $this->findLayersForReferences($astMap->getFunctionReferences(), $tokenName, $astMap), + \Qossmic\Deptrac\Core\Analyser\TokenType::FILE => $this->findLayersForReferences($astMap->getFileReferences(), $tokenName, $astMap), }; } catch (UnrecognizedTokenException $e) { - throw AnalyserException::unrecognizedToken($e); + throw \Qossmic\Deptrac\Core\Analyser\AnalyserException::unrecognizedToken($e); } catch (InvalidLayerDefinitionException $e) { - throw AnalyserException::invalidLayerDefinition($e); + throw \Qossmic\Deptrac\Core\Analyser\AnalyserException::invalidLayerDefinition($e); } catch (InvalidCollectorDefinitionException $e) { - throw AnalyserException::invalidCollectorDefinition($e); + throw \Qossmic\Deptrac\Core\Analyser\AnalyserException::invalidCollectorDefinition($e); } catch (AstException $e) { - throw AnalyserException::failedAstParsing($e); + throw \Qossmic\Deptrac\Core\Analyser\AnalyserException::failedAstParsing($e); } catch (CouldNotParseFileException $e) { - throw AnalyserException::couldNotParseFile($e); + throw \Qossmic\Deptrac\Core\Analyser\AnalyserException::couldNotParseFile($e); } } - /** * @param TokenReferenceInterface[] $references * @@ -74,27 +58,22 @@ public function findLayerForToken(string $tokenName, TokenType $tokenType): arra * @throws InvalidCollectorDefinitionException * @throws CouldNotParseFileException */ - private function findLayersForReferences(array $references, string $tokenName, AstMap $astMap): array + private function findLayersForReferences(array $references, string $tokenName, AstMap $astMap) : array { if ([] === $references) { return []; } - $layersForReference = []; foreach ($references as $reference) { if (!str_contains($reference->getToken()->toString(), $tokenName)) { continue; } $token = $this->tokenResolver->resolve($reference->getToken(), $astMap); - $matchingLayers = array_keys($this->layerResolver->getLayersForReference($token)); - + $matchingLayers = \array_keys($this->layerResolver->getLayersForReference($token)); natcasesort($matchingLayers); - $layersForReference[$reference->getToken()->toString()] = array_values($matchingLayers); } - ksort($layersForReference); - return $layersForReference; } } diff --git a/src/Core/Analyser/RulesetUsageAnalyser.php b/src/Core/Analyser/RulesetUsageAnalyser.php index 0f5e611ac..8f62ed93e 100644 --- a/src/Core/Analyser/RulesetUsageAnalyser.php +++ b/src/Core/Analyser/RulesetUsageAnalyser.php @@ -1,7 +1,6 @@ $layers */ - public function __construct( - private readonly LayerProvider $layerProvider, - private readonly LayerResolverInterface $layerResolver, - private readonly AstMapExtractor $astMapExtractor, - private readonly DependencyResolver $dependencyResolver, - private readonly TokenResolver $tokenResolver, - private readonly array $layers - ) {} - + public function __construct(private readonly LayerProvider $layerProvider, private readonly LayerResolverInterface $layerResolver, private readonly AstMapExtractor $astMapExtractor, private readonly DependencyResolver $dependencyResolver, private readonly TokenResolver $tokenResolver, private readonly array $layers) + { + } /** * @return array> * * @throws AnalyserException */ - public function analyse(): array + public function analyse() : array { try { return $this->findRulesetUsages($this->rulesetResolution()); } catch (InvalidEmitterConfigurationException $e) { - throw AnalyserException::invalidEmitterConfiguration($e); + throw \Qossmic\Deptrac\Core\Analyser\AnalyserException::invalidEmitterConfiguration($e); } catch (UnrecognizedTokenException $e) { - throw AnalyserException::unrecognizedToken($e); + throw \Qossmic\Deptrac\Core\Analyser\AnalyserException::unrecognizedToken($e); } catch (InvalidLayerDefinitionException $e) { - throw AnalyserException::invalidLayerDefinition($e); + throw \Qossmic\Deptrac\Core\Analyser\AnalyserException::invalidLayerDefinition($e); } catch (InvalidCollectorDefinitionException $e) { - throw AnalyserException::invalidCollectorDefinition($e); + throw \Qossmic\Deptrac\Core\Analyser\AnalyserException::invalidCollectorDefinition($e); } catch (AstException $e) { - throw AnalyserException::failedAstParsing($e); + throw \Qossmic\Deptrac\Core\Analyser\AnalyserException::failedAstParsing($e); } catch (CouldNotParseFileException $e) { - throw AnalyserException::couldNotParseFile($e); + throw \Qossmic\Deptrac\Core\Analyser\AnalyserException::couldNotParseFile($e); } catch (CircularReferenceException $e) { - throw AnalyserException::circularReference($e); + throw \Qossmic\Deptrac\Core\Analyser\AnalyserException::circularReference($e); } } - /** * @return array> sourceLayer -> (targetLayer -> 0) * * @throws CircularReferenceException */ - private function rulesetResolution(): array + private function rulesetResolution() : array { $layerNames = []; - foreach (array_map( - static fn (array $layerDef): string => $layerDef['name'], - $this->layers - ) as $sourceLayerName) { - foreach ( - $this->layerProvider->getAllowedLayers($sourceLayerName) as $destinationLayerName - ) { + foreach (\array_map(static fn(array $layerDef): string => $layerDef['name'], $this->layers) as $sourceLayerName) { + foreach ($this->layerProvider->getAllowedLayers($sourceLayerName) as $destinationLayerName) { $layerNames[$sourceLayerName][$destinationLayerName] = 0; } } - return $layerNames; } - /** * @param array> $rulesets * @@ -91,28 +75,21 @@ private function rulesetResolution(): array * @throws InvalidLayerDefinitionException * @throws UnrecognizedTokenException */ - private function findRulesetUsages(array $rulesets): array + private function findRulesetUsages(array $rulesets) : array { $astMap = $this->astMapExtractor->extract(); $dependencyResult = $this->dependencyResolver->resolve($astMap); foreach ($dependencyResult->getDependenciesAndInheritDependencies() as $dependency) { - $dependerLayerNames = $this->layerResolver->getLayersForReference( - $this->tokenResolver->resolve($dependency->getDepender(), $astMap), - ); + $dependerLayerNames = $this->layerResolver->getLayersForReference($this->tokenResolver->resolve($dependency->getDepender(), $astMap)); foreach ($dependerLayerNames as $dependerLayerName => $_) { - $dependentLayerNames = $this->layerResolver->getLayersForReference( - $this->tokenResolver->resolve($dependency->getDependent(), $astMap), - ); + $dependentLayerNames = $this->layerResolver->getLayersForReference($this->tokenResolver->resolve($dependency->getDependent(), $astMap)); foreach ($dependentLayerNames as $dependentLayerName => $__) { - if (array_key_exists($dependerLayerName, $rulesets) - && array_key_exists($dependentLayerName, $rulesets[$dependerLayerName]) - ) { + if (\array_key_exists($dependerLayerName, $rulesets) && \array_key_exists($dependentLayerName, $rulesets[$dependerLayerName])) { ++$rulesets[$dependerLayerName][$dependentLayerName]; } } } } - return $rulesets; } } diff --git a/src/Core/Analyser/TokenInLayerAnalyser.php b/src/Core/Analyser/TokenInLayerAnalyser.php index c594e5d54..b43fc3395 100644 --- a/src/Core/Analyser/TokenInLayerAnalyser.php +++ b/src/Core/Analyser/TokenInLayerAnalyser.php @@ -1,7 +1,6 @@ */ private readonly array $tokenTypes; - /** * @param array{types: array} $config */ - public function __construct( - private readonly AstMapExtractor $astMapExtractor, - private readonly TokenResolver $tokenResolver, - private readonly LayerResolverInterface $layerResolver, - array $config - ) { - $this->tokenTypes = array_filter( - array_map( - static fn (string $emitterType): ?TokenType => TokenType::tryFromEmitterType(EmitterType::from($emitterType)), - $config['types'] - ) - ); + public function __construct(private readonly AstMapExtractor $astMapExtractor, private readonly TokenResolver $tokenResolver, private readonly LayerResolverInterface $layerResolver, array $config) + { + $this->tokenTypes = \array_filter(\array_map(static fn(string $emitterType): ?\Qossmic\Deptrac\Core\Analyser\TokenType => \Qossmic\Deptrac\Core\Analyser\TokenType::tryFromEmitterType(EmitterType::from($emitterType)), $config['types'])); } - /** * @return string[] * * @throws AnalyserException */ - public function findTokensInLayer(string $layer): array + public function findTokensInLayer(string $layer) : array { try { $astMap = $this->astMapExtractor->extract(); - $matchingTokens = []; - - if (in_array(TokenType::CLASS_LIKE, $this->tokenTypes, true)) { + if (in_array(\Qossmic\Deptrac\Core\Analyser\TokenType::CLASS_LIKE, $this->tokenTypes, \true)) { foreach ($astMap->getClassLikeReferences() as $classReference) { $classToken = $this->tokenResolver->resolve($classReference->getToken(), $astMap); - if (array_key_exists($layer, $this->layerResolver->getLayersForReference($classToken))) { - $matchingTokens[] = $classToken->getToken() - ->toString(); + if (\array_key_exists($layer, $this->layerResolver->getLayersForReference($classToken))) { + $matchingTokens[] = $classToken->getToken()->toString(); } } } - - if (in_array(TokenType::FUNCTION, $this->tokenTypes, true)) { + if (in_array(\Qossmic\Deptrac\Core\Analyser\TokenType::FUNCTION, $this->tokenTypes, \true)) { foreach ($astMap->getFunctionReferences() as $functionReference) { $functionToken = $this->tokenResolver->resolve($functionReference->getToken(), $astMap); - if (array_key_exists($layer, $this->layerResolver->getLayersForReference($functionToken))) { - $matchingTokens[] = $functionToken->getToken() - ->toString(); + if (\array_key_exists($layer, $this->layerResolver->getLayersForReference($functionToken))) { + $matchingTokens[] = $functionToken->getToken()->toString(); } } } - - if (in_array(TokenType::FILE, $this->tokenTypes, true)) { + if (in_array(\Qossmic\Deptrac\Core\Analyser\TokenType::FILE, $this->tokenTypes, \true)) { foreach ($astMap->getFileReferences() as $fileReference) { $fileToken = $this->tokenResolver->resolve($fileReference->getToken(), $astMap); - if (array_key_exists($layer, $this->layerResolver->getLayersForReference($fileToken))) { - $matchingTokens[] = $fileToken->getToken() - ->toString(); + if (\array_key_exists($layer, $this->layerResolver->getLayersForReference($fileToken))) { + $matchingTokens[] = $fileToken->getToken()->toString(); } } } - natcasesort($matchingTokens); - return array_values($matchingTokens); } catch (UnrecognizedTokenException $e) { - throw AnalyserException::unrecognizedToken($e); + throw \Qossmic\Deptrac\Core\Analyser\AnalyserException::unrecognizedToken($e); } catch (InvalidLayerDefinitionException $e) { - throw AnalyserException::invalidLayerDefinition($e); + throw \Qossmic\Deptrac\Core\Analyser\AnalyserException::invalidLayerDefinition($e); } catch (InvalidCollectorDefinitionException $e) { - throw AnalyserException::invalidCollectorDefinition($e); + throw \Qossmic\Deptrac\Core\Analyser\AnalyserException::invalidCollectorDefinition($e); } catch (AstException $e) { - throw AnalyserException::failedAstParsing($e); + throw \Qossmic\Deptrac\Core\Analyser\AnalyserException::failedAstParsing($e); } catch (CouldNotParseFileException $e) { - throw AnalyserException::couldNotParseFile($e); + throw \Qossmic\Deptrac\Core\Analyser\AnalyserException::couldNotParseFile($e); } } } diff --git a/src/Core/Analyser/TokenType.php b/src/Core/Analyser/TokenType.php index 3355c0edd..a08643a65 100644 --- a/src/Core/Analyser/TokenType.php +++ b/src/Core/Analyser/TokenType.php @@ -1,18 +1,15 @@ value); } diff --git a/src/Core/Analyser/UnassignedTokenAnalyser.php b/src/Core/Analyser/UnassignedTokenAnalyser.php index 935c777ec..34f2befa7 100644 --- a/src/Core/Analyser/UnassignedTokenAnalyser.php +++ b/src/Core/Analyser/UnassignedTokenAnalyser.php @@ -1,7 +1,6 @@ */ private readonly array $tokenTypes; - /** * @param array{types: array} $config */ - public function __construct( - private readonly AstMapExtractor $astMapExtractor, - private readonly TokenResolver $tokenResolver, - private readonly LayerResolverInterface $layerResolver, - array $config - ) { - $this->tokenTypes = array_filter( - array_map( - static fn (string $emitterType): ?TokenType => TokenType::tryFromEmitterType(EmitterType::from($emitterType)), - $config['types'] - ) - ); + public function __construct(private readonly AstMapExtractor $astMapExtractor, private readonly TokenResolver $tokenResolver, private readonly LayerResolverInterface $layerResolver, array $config) + { + $this->tokenTypes = \array_filter(\array_map(static fn(string $emitterType): ?\Qossmic\Deptrac\Core\Analyser\TokenType => \Qossmic\Deptrac\Core\Analyser\TokenType::tryFromEmitterType(EmitterType::from($emitterType)), $config['types'])); } - /** * @return string[] * * @throws AnalyserException */ - public function findUnassignedTokens(): array + public function findUnassignedTokens() : array { try { $astMap = $this->astMapExtractor->extract(); $unassignedTokens = []; - - if (in_array(TokenType::CLASS_LIKE, $this->tokenTypes, true)) { + if (\in_array(\Qossmic\Deptrac\Core\Analyser\TokenType::CLASS_LIKE, $this->tokenTypes, \true)) { foreach ($astMap->getClassLikeReferences() as $classReference) { $token = $this->tokenResolver->resolve($classReference->getToken(), $astMap); if ([] === $this->layerResolver->getLayersForReference($token)) { @@ -60,8 +45,7 @@ public function findUnassignedTokens(): array } } } - - if (in_array(TokenType::FUNCTION, $this->tokenTypes, true)) { + if (\in_array(\Qossmic\Deptrac\Core\Analyser\TokenType::FUNCTION, $this->tokenTypes, \true)) { foreach ($astMap->getFunctionReferences() as $functionReference) { $token = $this->tokenResolver->resolve($functionReference->getToken(), $astMap); if ([] === $this->layerResolver->getLayersForReference($token)) { @@ -69,8 +53,7 @@ public function findUnassignedTokens(): array } } } - - if (in_array(TokenType::FILE, $this->tokenTypes, true)) { + if (\in_array(\Qossmic\Deptrac\Core\Analyser\TokenType::FILE, $this->tokenTypes, \true)) { foreach ($astMap->getFileReferences() as $fileReference) { $token = $this->tokenResolver->resolve($fileReference->getToken(), $astMap); if ([] === $this->layerResolver->getLayersForReference($token)) { @@ -78,20 +61,18 @@ public function findUnassignedTokens(): array } } } - natcasesort($unassignedTokens); - return array_values($unassignedTokens); } catch (UnrecognizedTokenException $e) { - throw AnalyserException::unrecognizedToken($e); + throw \Qossmic\Deptrac\Core\Analyser\AnalyserException::unrecognizedToken($e); } catch (InvalidLayerDefinitionException $e) { - throw AnalyserException::invalidLayerDefinition($e); + throw \Qossmic\Deptrac\Core\Analyser\AnalyserException::invalidLayerDefinition($e); } catch (InvalidCollectorDefinitionException $e) { - throw AnalyserException::invalidCollectorDefinition($e); + throw \Qossmic\Deptrac\Core\Analyser\AnalyserException::invalidCollectorDefinition($e); } catch (AstException $e) { - throw AnalyserException::failedAstParsing($e); + throw \Qossmic\Deptrac\Core\Analyser\AnalyserException::failedAstParsing($e); } catch (CouldNotParseFileException $e) { - throw AnalyserException::couldNotParseFile($e); + throw \Qossmic\Deptrac\Core\Analyser\AnalyserException::couldNotParseFile($e); } } } diff --git a/src/Core/Ast/AstException.php b/src/Core/Ast/AstException.php index 01d4e5d94..d027847f8 100644 --- a/src/Core/Ast/AstException.php +++ b/src/Core/Ast/AstException.php @@ -1,16 +1,14 @@ $files */ - public function createAstMap(array $files): AstMap + public function createAstMap(array $files) : AstMap { $references = []; - - $this->eventDispatcher->dispatch(new PreCreateAstMapEvent(count($files))); - + $this->eventDispatcher->dispatch(new PreCreateAstMapEvent(\count($files))); foreach ($files as $file) { try { $references[] = $this->parser->parseFile($file); - $this->eventDispatcher->dispatch(new AstFileAnalysedEvent($file)); } catch (CouldNotParseFileException $e) { $this->eventDispatcher->dispatch(new AstFileSyntaxErrorEvent($file, $e->getMessage())); } } - $astMap = new AstMap($references); $this->eventDispatcher->dispatch(new PostCreateAstMapEvent()); - return $astMap; } } diff --git a/src/Core/Ast/AstMap/AstInherit.php b/src/Core/Ast/AstMap/AstInherit.php index 663ac672f..23319542a 100644 --- a/src/Core/Ast/AstMap/AstInherit.php +++ b/src/Core/Ast/AstMap/AstInherit.php @@ -1,17 +1,14 @@ path; } - - public function __toString(): string + public function __toString() : string { $description = "{$this->classLikeName->toString()}::{$this->fileOccurrence->line} ({$this->type->value})"; - if ([] === $this->path) { return $description; } - return sprintf('%s (path: %s)', $description, implode(' -> ', array_reverse($this->path))); } - /** * @param AstInherit[] $path */ - public function replacePath(array $path): self + public function replacePath(array $path) : self { return new self($this->classLikeName, $this->fileOccurrence, $this->type, $path); } diff --git a/src/Core/Ast/AstMap/AstInheritType.php b/src/Core/Ast/AstMap/AstInheritType.php index 568c3658a..6cad76343 100644 --- a/src/Core/Ast/AstMap/AstInheritType.php +++ b/src/Core/Ast/AstMap/AstInheritType.php @@ -1,10 +1,9 @@ */ private array $classReferences = []; - /** * @var array */ private array $fileReferences = []; - /** * @var array */ private array $functionReferences = []; - /** * @param FileReference[] $astFileReferences */ @@ -39,74 +34,61 @@ public function __construct(array $astFileReferences) $this->addAstFileReference($astFileReference); } } - /** * @return ClassLikeReference[] */ - public function getClassLikeReferences(): array + public function getClassLikeReferences() : array { return $this->classReferences; } - /** * @return FileReference[] */ - public function getFileReferences(): array + public function getFileReferences() : array { return $this->fileReferences; } - /** * @return FunctionReference[] */ - public function getFunctionReferences(): array + public function getFunctionReferences() : array { return $this->functionReferences; } - - public function getClassReferenceForToken(ClassLikeToken $className): ?ClassLikeReference + public function getClassReferenceForToken(ClassLikeToken $className) : ?ClassLikeReference { return $this->classReferences[$className->toString()] ?? null; } - - public function getFunctionReferenceForToken(FunctionToken $tokenName): ?FunctionReference + public function getFunctionReferenceForToken(FunctionToken $tokenName) : ?FunctionReference { return $this->functionReferences[$tokenName->toString()] ?? null; } - - public function getFileReferenceForToken(FileToken $tokenName): ?FileReference + public function getFileReferenceForToken(FileToken $tokenName) : ?FileReference { return $this->fileReferences[$tokenName->toString()] ?? null; } - /** * @return iterable */ - public function getClassInherits(ClassLikeToken $classLikeName): iterable + public function getClassInherits(ClassLikeToken $classLikeName) : iterable { $classReference = $this->getClassReferenceForToken($classLikeName); - if (null === $classReference) { return []; } - foreach ($classReference->inherits as $dep) { - yield $dep; + (yield $dep); yield from $this->recursivelyResolveDependencies($dep); } } - /** * @param ArrayObject|null $alreadyResolved * @param SplStack|null $pathStack * * @return iterable */ - private function recursivelyResolveDependencies( - AstInherit $inheritDependency, - ArrayObject $alreadyResolved = null, - SplStack $pathStack = null - ): iterable { + private function recursivelyResolveDependencies(\Qossmic\Deptrac\Core\Ast\AstMap\AstInherit $inheritDependency, ArrayObject $alreadyResolved = null, SplStack $pathStack = null) : iterable + { $alreadyResolved ??= new ArrayObject(); /** @var ArrayObject $alreadyResolved */ if (null === $pathStack) { @@ -114,46 +96,33 @@ private function recursivelyResolveDependencies( $pathStack = new SplStack(); $pathStack->push($inheritDependency); } - $className = $inheritDependency->classLikeName->toString(); - if (isset($alreadyResolved[$className])) { $pathStack->pop(); - return []; } - $classReference = $this->getClassReferenceForToken($inheritDependency->classLikeName); - if (null === $classReference) { return []; } - foreach ($classReference->inherits as $inherit) { - $alreadyResolved[$className] = true; - + $alreadyResolved[$className] = \true; /** @var AstInherit[] $path */ - $path = iterator_to_array($pathStack); - yield $inherit->replacePath($path); - + $path = \iterator_to_array($pathStack); + (yield $inherit->replacePath($path)); $pathStack->push($inherit); - yield from $this->recursivelyResolveDependencies($inherit, $alreadyResolved, $pathStack); - unset($alreadyResolved[$className]); $pathStack->pop(); } } - - private function addClassLike(ClassLikeReference $astClassReference): void + private function addClassLike(ClassLikeReference $astClassReference) : void { $this->classReferences[$astClassReference->getToken()->toString()] = $astClassReference; } - - private function addAstFileReference(FileReference $astFileReference): void + private function addAstFileReference(FileReference $astFileReference) : void { $this->fileReferences[$astFileReference->filepath] = $astFileReference; - foreach ($astFileReference->classLikeReferences as $astClassReference) { $this->addClassLike($astClassReference); } @@ -161,8 +130,7 @@ private function addAstFileReference(FileReference $astFileReference): void $this->addFunction($astFunctionReference); } } - - private function addFunction(FunctionReference $astFunctionReference): void + private function addFunction(FunctionReference $astFunctionReference) : void { $this->functionReferences[$astFunctionReference->getToken()->toString()] = $astFunctionReference; } diff --git a/src/Core/Ast/AstMap/ClassLike/ClassLikeReference.php b/src/Core/Ast/AstMap/ClassLike/ClassLikeReference.php index eb29f1d60..76ae7cc14 100644 --- a/src/Core/Ast/AstMap/ClassLike/ClassLikeReference.php +++ b/src/Core/Ast/AstMap/ClassLike/ClassLikeReference.php @@ -1,54 +1,35 @@ type = $classLikeType ?? ClassLikeType::TYPE_CLASSLIKE; + public function __construct(private readonly \Qossmic\Deptrac\Core\Ast\AstMap\ClassLike\ClassLikeToken $classLikeName, \Qossmic\Deptrac\Core\Ast\AstMap\ClassLike\ClassLikeType $classLikeType = null, public readonly array $inherits = [], public readonly array $dependencies = [], public readonly bool $isInternal = \false, private readonly ?FileReference $fileReference = null) + { + $this->type = $classLikeType ?? \Qossmic\Deptrac\Core\Ast\AstMap\ClassLike\ClassLikeType::TYPE_CLASSLIKE; } - - public function withFileReference(FileReference $astFileReference): self + public function withFileReference(FileReference $astFileReference) : self { - return new self( - $this->classLikeName, - $this->type, - $this->inherits, - $this->dependencies, - $this->isInternal, - $astFileReference - ); + return new self($this->classLikeName, $this->type, $this->inherits, $this->dependencies, $this->isInternal, $astFileReference); } - - public function getFilepath(): ?string + public function getFilepath() : ?string { return $this->fileReference?->filepath; } - - public function getToken(): ClassLikeToken + public function getToken() : \Qossmic\Deptrac\Core\Ast\AstMap\ClassLike\ClassLikeToken { return $this->classLikeName; } diff --git a/src/Core/Ast/AstMap/ClassLike/ClassLikeReferenceBuilder.php b/src/Core/Ast/AstMap/ClassLike/ClassLikeReferenceBuilder.php index 651bb0a87..060136727 100644 --- a/src/Core/Ast/AstMap/ClassLike/ClassLikeReferenceBuilder.php +++ b/src/Core/Ast/AstMap/ClassLike/ClassLikeReferenceBuilder.php @@ -1,106 +1,69 @@ $tokenTemplates */ - private function __construct( - array $tokenTemplates, - string $filepath, - private readonly ClassLikeToken $classLikeToken, - private readonly ClassLikeType $classLikeType, - private readonly bool $isInternal - ) { + private function __construct(array $tokenTemplates, string $filepath, private readonly \Qossmic\Deptrac\Core\Ast\AstMap\ClassLike\ClassLikeToken $classLikeToken, private readonly \Qossmic\Deptrac\Core\Ast\AstMap\ClassLike\ClassLikeType $classLikeType, private readonly bool $isInternal) + { parent::__construct($tokenTemplates, $filepath); } - /** * @param list $classTemplates */ - public static function createClassLike(string $filepath, string $classLikeName, array $classTemplates, bool $isInternal): self + public static function createClassLike(string $filepath, string $classLikeName, array $classTemplates, bool $isInternal) : self { - return new self($classTemplates, $filepath, ClassLikeToken::fromFQCN($classLikeName), ClassLikeType::TYPE_CLASSLIKE, $isInternal); + return new self($classTemplates, $filepath, \Qossmic\Deptrac\Core\Ast\AstMap\ClassLike\ClassLikeToken::fromFQCN($classLikeName), \Qossmic\Deptrac\Core\Ast\AstMap\ClassLike\ClassLikeType::TYPE_CLASSLIKE, $isInternal); } - /** * @param list $classTemplates */ - public static function createClass(string $filepath, string $classLikeName, array $classTemplates, bool $isInternal): self + public static function createClass(string $filepath, string $classLikeName, array $classTemplates, bool $isInternal) : self { - return new self($classTemplates, $filepath, ClassLikeToken::fromFQCN($classLikeName), ClassLikeType::TYPE_CLASS, $isInternal); + return new self($classTemplates, $filepath, \Qossmic\Deptrac\Core\Ast\AstMap\ClassLike\ClassLikeToken::fromFQCN($classLikeName), \Qossmic\Deptrac\Core\Ast\AstMap\ClassLike\ClassLikeType::TYPE_CLASS, $isInternal); } - /** * @param list $classTemplates */ - public static function createTrait(string $filepath, string $classLikeName, array $classTemplates, bool $isInternal): self + public static function createTrait(string $filepath, string $classLikeName, array $classTemplates, bool $isInternal) : self { - return new self($classTemplates, $filepath, ClassLikeToken::fromFQCN($classLikeName), ClassLikeType::TYPE_TRAIT, $isInternal); + return new self($classTemplates, $filepath, \Qossmic\Deptrac\Core\Ast\AstMap\ClassLike\ClassLikeToken::fromFQCN($classLikeName), \Qossmic\Deptrac\Core\Ast\AstMap\ClassLike\ClassLikeType::TYPE_TRAIT, $isInternal); } - /** * @param list $classTemplates */ - public static function createInterface(string $filepath, string $classLikeName, array $classTemplates, bool $isInternal): self + public static function createInterface(string $filepath, string $classLikeName, array $classTemplates, bool $isInternal) : self { - return new self($classTemplates, $filepath, ClassLikeToken::fromFQCN($classLikeName), ClassLikeType::TYPE_INTERFACE, $isInternal); + return new self($classTemplates, $filepath, \Qossmic\Deptrac\Core\Ast\AstMap\ClassLike\ClassLikeToken::fromFQCN($classLikeName), \Qossmic\Deptrac\Core\Ast\AstMap\ClassLike\ClassLikeType::TYPE_INTERFACE, $isInternal); } - /** @internal */ - public function build(): ClassLikeReference + public function build() : \Qossmic\Deptrac\Core\Ast\AstMap\ClassLike\ClassLikeReference { - return new ClassLikeReference( - $this->classLikeToken, - $this->classLikeType, - $this->inherits, - $this->dependencies, - $this->isInternal - ); + return new \Qossmic\Deptrac\Core\Ast\AstMap\ClassLike\ClassLikeReference($this->classLikeToken, $this->classLikeType, $this->inherits, $this->dependencies, $this->isInternal); } - - public function extends(string $classLikeName, int $occursAtLine): self + public function extends(string $classLikeName, int $occursAtLine) : self { - $this->inherits[] = new AstInherit( - ClassLikeToken::fromFQCN($classLikeName), - new FileOccurrence($this->filepath, $occursAtLine), - AstInheritType::EXTENDS - ); - + $this->inherits[] = new AstInherit(\Qossmic\Deptrac\Core\Ast\AstMap\ClassLike\ClassLikeToken::fromFQCN($classLikeName), new FileOccurrence($this->filepath, $occursAtLine), AstInheritType::EXTENDS); return $this; } - - public function implements(string $classLikeName, int $occursAtLine): self + public function implements(string $classLikeName, int $occursAtLine) : self { - $this->inherits[] = new AstInherit( - ClassLikeToken::fromFQCN($classLikeName), - new FileOccurrence($this->filepath, $occursAtLine), - AstInheritType::IMPLEMENTS - ); - + $this->inherits[] = new AstInherit(\Qossmic\Deptrac\Core\Ast\AstMap\ClassLike\ClassLikeToken::fromFQCN($classLikeName), new FileOccurrence($this->filepath, $occursAtLine), AstInheritType::IMPLEMENTS); return $this; } - - public function trait(string $classLikeName, int $occursAtLine): self + public function trait(string $classLikeName, int $occursAtLine) : self { - $this->inherits[] = new AstInherit( - ClassLikeToken::fromFQCN($classLikeName), - new FileOccurrence($this->filepath, $occursAtLine), - AstInheritType::USES - ); - + $this->inherits[] = new AstInherit(\Qossmic\Deptrac\Core\Ast\AstMap\ClassLike\ClassLikeToken::fromFQCN($classLikeName), new FileOccurrence($this->filepath, $occursAtLine), AstInheritType::USES); return $this; } } diff --git a/src/Core/Ast/AstMap/ClassLike/ClassLikeToken.php b/src/Core/Ast/AstMap/ClassLike/ClassLikeToken.php index a28e94b3b..7e65b4a81 100644 --- a/src/Core/Ast/AstMap/ClassLike/ClassLikeToken.php +++ b/src/Core/Ast/AstMap/ClassLike/ClassLikeToken.php @@ -1,31 +1,27 @@ className); + return new self(\ltrim($className, '\\')); } - - public function toString(): string + public function match(string $pattern) : bool + { + return 1 === \preg_match($pattern, $this->className); + } + public function toString() : string { return $this->className; } - - public function equals(ClassLikeToken $classLikeName): bool + public function equals(\Qossmic\Deptrac\Core\Ast\AstMap\ClassLike\ClassLikeToken $classLikeName) : bool { return $this->className === $classLikeName->className; } diff --git a/src/Core/Ast/AstMap/ClassLike/ClassLikeType.php b/src/Core/Ast/AstMap/ClassLike/ClassLikeType.php index ecbdd58b1..e7b967c6e 100644 --- a/src/Core/Ast/AstMap/ClassLike/ClassLikeType.php +++ b/src/Core/Ast/AstMap/ClassLike/ClassLikeType.php @@ -1,19 +1,16 @@ value; } diff --git a/src/Core/Ast/AstMap/DependencyToken.php b/src/Core/Ast/AstMap/DependencyToken.php index c98447e5d..717f988b7 100644 --- a/src/Core/Ast/AstMap/DependencyToken.php +++ b/src/Core/Ast/AstMap/DependencyToken.php @@ -1,21 +1,17 @@ classLikeReferences = array_map( - fn (ClassLikeReference $classReference): ClassLikeReference => $classReference->withFileReference($this), - $classLikeReferences - ); + $this->classLikeReferences = \array_map(fn(ClassLikeReference $classReference): ClassLikeReference => $classReference->withFileReference($this), $classLikeReferences); /** @psalm-suppress ImpureFunctionCall */ - $this->functionReferences = array_map( - fn (FunctionReference $functionReference): FunctionReference => $functionReference->withFileReference($this), - $functionReferences - ); + $this->functionReferences = \array_map(fn(FunctionReference $functionReference): FunctionReference => $functionReference->withFileReference($this), $functionReferences); } - - public function getFilepath(): ?string + public function getFilepath() : ?string { return $this->filepath; } - - public function getToken(): TokenInterface + public function getToken() : TokenInterface { - return new FileToken($this->filepath); + return new \Qossmic\Deptrac\Core\Ast\AstMap\File\FileToken($this->filepath); } } diff --git a/src/Core/Ast/AstMap/File/FileReferenceBuilder.php b/src/Core/Ast/AstMap/File/FileReferenceBuilder.php index fc097578d..31514050a 100644 --- a/src/Core/Ast/AstMap/File/FileReferenceBuilder.php +++ b/src/Core/Ast/AstMap/File/FileReferenceBuilder.php @@ -1,7 +1,6 @@ dependencies[] = new DependencyToken( - ClassLikeToken::fromFQCN($classLikeName), - new FileOccurrence($this->filepath, $occursAtLine), - DependencyType::USE - ); - + $this->dependencies[] = new DependencyToken(ClassLikeToken::fromFQCN($classLikeName), new FileOccurrence($this->filepath, $occursAtLine), DependencyType::USE); return $this; } - /** * @param list $templateTypes */ - public function newClass(string $classLikeName, array $templateTypes, bool $isInternal): ClassLikeReferenceBuilder + public function newClass(string $classLikeName, array $templateTypes, bool $isInternal) : ClassLikeReferenceBuilder { $classReference = ClassLikeReferenceBuilder::createClass($this->filepath, $classLikeName, $templateTypes, $isInternal); $this->classReferences[] = $classReference; - return $classReference; } - /** * @param list $templateTypes */ - public function newTrait(string $classLikeName, array $templateTypes, bool $isInternal): ClassLikeReferenceBuilder + public function newTrait(string $classLikeName, array $templateTypes, bool $isInternal) : ClassLikeReferenceBuilder { $classReference = ClassLikeReferenceBuilder::createTrait($this->filepath, $classLikeName, $templateTypes, $isInternal); $this->classReferences[] = $classReference; - return $classReference; } - /** * @param list $templateTypes */ - public function newClassLike(string $classLikeName, array $templateTypes, bool $isInternal): ClassLikeReferenceBuilder + public function newClassLike(string $classLikeName, array $templateTypes, bool $isInternal) : ClassLikeReferenceBuilder { $classReference = ClassLikeReferenceBuilder::createClassLike($this->filepath, $classLikeName, $templateTypes, $isInternal); $this->classReferences[] = $classReference; - return $classReference; } - /** * @param list $templateTypes */ - public function newInterface(string $classLikeName, array $templateTypes, bool $isInternal): ClassLikeReferenceBuilder + public function newInterface(string $classLikeName, array $templateTypes, bool $isInternal) : ClassLikeReferenceBuilder { $classReference = ClassLikeReferenceBuilder::createInterface($this->filepath, $classLikeName, $templateTypes, $isInternal); $this->classReferences[] = $classReference; - return $classReference; } - /** * @param list $templateTypes */ - public function newFunction(string $functionName, array $templateTypes = []): FunctionReferenceBuilder + public function newFunction(string $functionName, array $templateTypes = []) : FunctionReferenceBuilder { $functionReference = FunctionReferenceBuilder::create($this->filepath, $functionName, $templateTypes); $this->functionReferences[] = $functionReference; - return $functionReference; } - - public function build(): FileReference + public function build() : \Qossmic\Deptrac\Core\Ast\AstMap\File\FileReference { $classReferences = []; foreach ($this->classReferences as $classReference) { $classReferences[] = $classReference->build(); } - $functionReferences = []; foreach ($this->functionReferences as $functionReference) { $functionReferences[] = $functionReference->build(); } - - return new FileReference($this->filepath, $classReferences, $functionReferences, $this->dependencies); + return new \Qossmic\Deptrac\Core\Ast\AstMap\File\FileReference($this->filepath, $classReferences, $functionReferences, $this->dependencies); } } diff --git a/src/Core/Ast/AstMap/File/FileToken.php b/src/Core/Ast/AstMap/File/FileToken.php index 9fdd9bdf5..55dcceace 100644 --- a/src/Core/Ast/AstMap/File/FileToken.php +++ b/src/Core/Ast/AstMap/File/FileToken.php @@ -1,33 +1,26 @@ path = Path::normalize($path); } - - public function toString(): string + public function toString() : string { - $wd = getcwd(); - - if (false !== $wd) { + $wd = \getcwd(); + if (\false !== $wd) { $wd = Path::normalize($wd); } - - if (false !== $wd && str_starts_with($this->path, $wd)) { - return substr($this->path, strlen($wd)); + if (\false !== $wd && \str_starts_with($this->path, $wd)) { + return \substr($this->path, \strlen($wd)); } - return $this->path; } } diff --git a/src/Core/Ast/AstMap/Function/FunctionReference.php b/src/Core/Ast/AstMap/Function/FunctionReference.php index 7201c79e2..cb397c143 100644 --- a/src/Core/Ast/AstMap/Function/FunctionReference.php +++ b/src/Core/Ast/AstMap/Function/FunctionReference.php @@ -1,14 +1,12 @@ functionName, - $this->dependencies, - $astFileReference - ); } - - public function getFilepath(): ?string + public function withFileReference(FileReference $astFileReference) : self + { + return new self($this->functionName, $this->dependencies, $astFileReference); + } + public function getFilepath() : ?string { return $this->fileReference?->filepath; } - - public function getToken(): TokenInterface + public function getToken() : TokenInterface { return $this->functionName; } diff --git a/src/Core/Ast/AstMap/Function/FunctionReferenceBuilder.php b/src/Core/Ast/AstMap/Function/FunctionReferenceBuilder.php index fc52bbbcc..1c40942d1 100644 --- a/src/Core/Ast/AstMap/Function/FunctionReferenceBuilder.php +++ b/src/Core/Ast/AstMap/Function/FunctionReferenceBuilder.php @@ -1,11 +1,9 @@ $functionTemplates */ - public static function create(string $filepath, string $functionName, array $functionTemplates): self + public static function create(string $filepath, string $functionName, array $functionTemplates) : self { return new self($functionTemplates, $filepath, $functionName); } - /** @internal */ - public function build(): FunctionReference + public function build() : \Qossmic\Deptrac\Core\Ast\AstMap\Function\FunctionReference { - return new FunctionReference( - FunctionToken::fromFQCN($this->functionName), - $this->dependencies - ); + return new \Qossmic\Deptrac\Core\Ast\AstMap\Function\FunctionReference(\Qossmic\Deptrac\Core\Ast\AstMap\Function\FunctionToken::fromFQCN($this->functionName), $this->dependencies); } } diff --git a/src/Core/Ast/AstMap/Function/FunctionToken.php b/src/Core/Ast/AstMap/Function/FunctionToken.php index d094d62d6..39ca41b9d 100644 --- a/src/Core/Ast/AstMap/Function/FunctionToken.php +++ b/src/Core/Ast/AstMap/Function/FunctionToken.php @@ -1,31 +1,27 @@ functionName); + return new self(\ltrim($functionName, '\\')); } - - public function toString(): string + public function match(string $pattern) : bool { - return $this->functionName.'()'; + return 1 === \preg_match($pattern, $this->functionName); } - - public function equals(self $functionName): bool + public function toString() : string + { + return $this->functionName . '()'; + } + public function equals(self $functionName) : bool { return $this->functionName === $functionName->functionName; } diff --git a/src/Core/Ast/AstMap/ReferenceBuilder.php b/src/Core/Ast/AstMap/ReferenceBuilder.php index 4ff20047e..f8214d0e0 100644 --- a/src/Core/Ast/AstMap/ReferenceBuilder.php +++ b/src/Core/Ast/AstMap/ReferenceBuilder.php @@ -1,7 +1,6 @@ $tokenTemplates */ - protected function __construct(protected array $tokenTemplates, protected string $filepath) {} - + protected function __construct(protected array $tokenTemplates, protected string $filepath) + { + } /** * @return string[] */ - final public function getTokenTemplates(): array + public final function getTokenTemplates() : array { return $this->tokenTemplates; } - /** * Unqualified function and constant names inside a namespace cannot be * statically resolved. Inside a namespace Foo, a call to strlen() may @@ -35,181 +32,89 @@ final public function getTokenTemplates(): array * Because PHP-Parser does not have the necessary context to decide this, * such names are left unresolved. */ - public function unresolvedFunctionCall(string $functionName, int $occursAtLine): self + public function unresolvedFunctionCall(string $functionName, int $occursAtLine) : self { - $this->dependencies[] = new DependencyToken( - FunctionToken::fromFQCN($functionName), - new FileOccurrence($this->filepath, $occursAtLine), - DependencyType::UNRESOLVED_FUNCTION_CALL - ); - + $this->dependencies[] = new \Qossmic\Deptrac\Core\Ast\AstMap\DependencyToken(FunctionToken::fromFQCN($functionName), new FileOccurrence($this->filepath, $occursAtLine), DependencyType::UNRESOLVED_FUNCTION_CALL); return $this; } - - public function variable(string $classLikeName, int $occursAtLine): self + public function variable(string $classLikeName, int $occursAtLine) : self { - $this->dependencies[] = new DependencyToken( - ClassLikeToken::fromFQCN($classLikeName), - new FileOccurrence($this->filepath, $occursAtLine), - DependencyType::VARIABLE - ); - + $this->dependencies[] = new \Qossmic\Deptrac\Core\Ast\AstMap\DependencyToken(ClassLikeToken::fromFQCN($classLikeName), new FileOccurrence($this->filepath, $occursAtLine), DependencyType::VARIABLE); return $this; } - - public function superglobal(string $superglobalName, int $occursAtLine): void + public function superglobal(string $superglobalName, int $occursAtLine) : void { - $this->dependencies[] = new DependencyToken( - SuperGlobalToken::from($superglobalName), - new FileOccurrence($this->filepath, $occursAtLine), - DependencyType::SUPERGLOBAL_VARIABLE - ); + $this->dependencies[] = new \Qossmic\Deptrac\Core\Ast\AstMap\DependencyToken(SuperGlobalToken::from($superglobalName), new FileOccurrence($this->filepath, $occursAtLine), DependencyType::SUPERGLOBAL_VARIABLE); } - - public function returnType(string $classLikeName, int $occursAtLine): self + public function returnType(string $classLikeName, int $occursAtLine) : self { - $this->dependencies[] = new DependencyToken( - ClassLikeToken::fromFQCN($classLikeName), - new FileOccurrence($this->filepath, $occursAtLine), - DependencyType::RETURN_TYPE - ); - + $this->dependencies[] = new \Qossmic\Deptrac\Core\Ast\AstMap\DependencyToken(ClassLikeToken::fromFQCN($classLikeName), new FileOccurrence($this->filepath, $occursAtLine), DependencyType::RETURN_TYPE); return $this; } - - public function throwStatement(string $classLikeName, int $occursAtLine): self + public function throwStatement(string $classLikeName, int $occursAtLine) : self { - $this->dependencies[] = new DependencyToken( - ClassLikeToken::fromFQCN($classLikeName), - new FileOccurrence($this->filepath, $occursAtLine), - DependencyType::THROW - ); - + $this->dependencies[] = new \Qossmic\Deptrac\Core\Ast\AstMap\DependencyToken(ClassLikeToken::fromFQCN($classLikeName), new FileOccurrence($this->filepath, $occursAtLine), DependencyType::THROW); return $this; } - - public function anonymousClassExtends(string $classLikeName, int $occursAtLine): void + public function anonymousClassExtends(string $classLikeName, int $occursAtLine) : void { - $this->dependencies[] = new DependencyToken( - ClassLikeToken::fromFQCN($classLikeName), - new FileOccurrence($this->filepath, $occursAtLine), - DependencyType::ANONYMOUS_CLASS_EXTENDS - ); + $this->dependencies[] = new \Qossmic\Deptrac\Core\Ast\AstMap\DependencyToken(ClassLikeToken::fromFQCN($classLikeName), new FileOccurrence($this->filepath, $occursAtLine), DependencyType::ANONYMOUS_CLASS_EXTENDS); } - - public function anonymousClassTrait(string $classLikeName, int $occursAtLine): void + public function anonymousClassTrait(string $classLikeName, int $occursAtLine) : void { - $this->dependencies[] = new DependencyToken( - ClassLikeToken::fromFQCN($classLikeName), - new FileOccurrence($this->filepath, $occursAtLine), - DependencyType::ANONYMOUS_CLASS_TRAIT - ); + $this->dependencies[] = new \Qossmic\Deptrac\Core\Ast\AstMap\DependencyToken(ClassLikeToken::fromFQCN($classLikeName), new FileOccurrence($this->filepath, $occursAtLine), DependencyType::ANONYMOUS_CLASS_TRAIT); } - - public function constFetch(string $classLikeName, int $occursAtLine): void + public function constFetch(string $classLikeName, int $occursAtLine) : void { - $this->dependencies[] = new DependencyToken( - ClassLikeToken::fromFQCN($classLikeName), - new FileOccurrence($this->filepath, $occursAtLine), - DependencyType::CONST - ); + $this->dependencies[] = new \Qossmic\Deptrac\Core\Ast\AstMap\DependencyToken(ClassLikeToken::fromFQCN($classLikeName), new FileOccurrence($this->filepath, $occursAtLine), DependencyType::CONST); } - - public function anonymousClassImplements(string $classLikeName, int $occursAtLine): void + public function anonymousClassImplements(string $classLikeName, int $occursAtLine) : void { - $this->dependencies[] = new DependencyToken( - ClassLikeToken::fromFQCN($classLikeName), - new FileOccurrence($this->filepath, $occursAtLine), - DependencyType::ANONYMOUS_CLASS_IMPLEMENTS - ); + $this->dependencies[] = new \Qossmic\Deptrac\Core\Ast\AstMap\DependencyToken(ClassLikeToken::fromFQCN($classLikeName), new FileOccurrence($this->filepath, $occursAtLine), DependencyType::ANONYMOUS_CLASS_IMPLEMENTS); } - - public function parameter(string $classLikeName, int $occursAtLine): self + public function parameter(string $classLikeName, int $occursAtLine) : self { - $this->dependencies[] = new DependencyToken( - ClassLikeToken::fromFQCN($classLikeName), - new FileOccurrence($this->filepath, $occursAtLine), - DependencyType::PARAMETER - ); - + $this->dependencies[] = new \Qossmic\Deptrac\Core\Ast\AstMap\DependencyToken(ClassLikeToken::fromFQCN($classLikeName), new FileOccurrence($this->filepath, $occursAtLine), DependencyType::PARAMETER); return $this; } - - public function attribute(string $classLikeName, int $occursAtLine): self + public function attribute(string $classLikeName, int $occursAtLine) : self { - $this->dependencies[] = new DependencyToken( - ClassLikeToken::fromFQCN($classLikeName), - new FileOccurrence($this->filepath, $occursAtLine), - DependencyType::ATTRIBUTE - ); - + $this->dependencies[] = new \Qossmic\Deptrac\Core\Ast\AstMap\DependencyToken(ClassLikeToken::fromFQCN($classLikeName), new FileOccurrence($this->filepath, $occursAtLine), DependencyType::ATTRIBUTE); return $this; } - - public function instanceof(string $classLikeName, int $occursAtLine): self + public function instanceof(string $classLikeName, int $occursAtLine) : self { - $this->dependencies[] = new DependencyToken( - ClassLikeToken::fromFQCN($classLikeName), - new FileOccurrence($this->filepath, $occursAtLine), - DependencyType::INSTANCEOF - ); - + $this->dependencies[] = new \Qossmic\Deptrac\Core\Ast\AstMap\DependencyToken(ClassLikeToken::fromFQCN($classLikeName), new FileOccurrence($this->filepath, $occursAtLine), DependencyType::INSTANCEOF); return $this; } - - public function newStatement(string $classLikeName, int $occursAtLine): self + public function newStatement(string $classLikeName, int $occursAtLine) : self { - $this->dependencies[] = new DependencyToken( - ClassLikeToken::fromFQCN($classLikeName), - new FileOccurrence($this->filepath, $occursAtLine), - DependencyType::NEW - ); - + $this->dependencies[] = new \Qossmic\Deptrac\Core\Ast\AstMap\DependencyToken(ClassLikeToken::fromFQCN($classLikeName), new FileOccurrence($this->filepath, $occursAtLine), DependencyType::NEW); return $this; } - - public function staticProperty(string $classLikeName, int $occursAtLine): self + public function staticProperty(string $classLikeName, int $occursAtLine) : self { - $this->dependencies[] = new DependencyToken( - ClassLikeToken::fromFQCN($classLikeName), - new FileOccurrence($this->filepath, $occursAtLine), - DependencyType::STATIC_PROPERTY - ); - + $this->dependencies[] = new \Qossmic\Deptrac\Core\Ast\AstMap\DependencyToken(ClassLikeToken::fromFQCN($classLikeName), new FileOccurrence($this->filepath, $occursAtLine), DependencyType::STATIC_PROPERTY); return $this; } - - public function staticMethod(string $classLikeName, int $occursAtLine): self + public function staticMethod(string $classLikeName, int $occursAtLine) : self { - $this->dependencies[] = new DependencyToken( - ClassLikeToken::fromFQCN($classLikeName), - new FileOccurrence($this->filepath, $occursAtLine), - DependencyType::STATIC_METHOD - ); - + $this->dependencies[] = new \Qossmic\Deptrac\Core\Ast\AstMap\DependencyToken(ClassLikeToken::fromFQCN($classLikeName), new FileOccurrence($this->filepath, $occursAtLine), DependencyType::STATIC_METHOD); return $this; } - - public function catchStmt(string $classLikeName, int $occursAtLine): self + public function catchStmt(string $classLikeName, int $occursAtLine) : self { - $this->dependencies[] = new DependencyToken( - ClassLikeToken::fromFQCN($classLikeName), - new FileOccurrence($this->filepath, $occursAtLine), - DependencyType::CATCH - ); - + $this->dependencies[] = new \Qossmic\Deptrac\Core\Ast\AstMap\DependencyToken(ClassLikeToken::fromFQCN($classLikeName), new FileOccurrence($this->filepath, $occursAtLine), DependencyType::CATCH); return $this; } - - public function addTokenTemplate(string $tokenTemplate): void + public function addTokenTemplate(string $tokenTemplate) : void { $this->tokenTemplates[] = $tokenTemplate; } - - public function removeTokenTemplate(string $tokenTemplate): void + public function removeTokenTemplate(string $tokenTemplate) : void { - $key = array_search($tokenTemplate, $this->tokenTemplates, true); - if (false !== $key) { + $key = \array_search($tokenTemplate, $this->tokenTemplates, \true); + if (\false !== $key) { unset($this->tokenTemplates[$key]); } } diff --git a/src/Core/Ast/AstMap/Variable/SuperGlobalToken.php b/src/Core/Ast/AstMap/Variable/SuperGlobalToken.php index 5ff3acc31..d3843129d 100644 --- a/src/Core/Ast/AstMap/Variable/SuperGlobalToken.php +++ b/src/Core/Ast/AstMap/Variable/SuperGlobalToken.php @@ -1,12 +1,10 @@ */ - public static function allowedNames(): array + public static function allowedNames() : array { - return array_map(static fn (self $token): string => $token->value, self::cases()); + return \array_map(static fn(self $token): string => $token->value, self::cases()); } - - public function toString(): string + public function toString() : string { - return '$'.$this->value; + return '$' . $this->value; } } diff --git a/src/Core/Ast/AstMap/Variable/VariableReference.php b/src/Core/Ast/AstMap/Variable/VariableReference.php index d0ba30d7e..8898195ec 100644 --- a/src/Core/Ast/AstMap/Variable/VariableReference.php +++ b/src/Core/Ast/AstMap/Variable/VariableReference.php @@ -1,25 +1,23 @@ tokenName; } diff --git a/src/Core/Ast/AstMapExtractor.php b/src/Core/Ast/AstMapExtractor.php index 71f3750ea..b29fbe5d8 100644 --- a/src/Core/Ast/AstMapExtractor.php +++ b/src/Core/Ast/AstMapExtractor.php @@ -1,31 +1,26 @@ astMapCache ??= $this->astLoader->createAstMap($this->inputCollector->collect()); } catch (InputException $exception) { - throw AstException::couldNotCollectFiles($exception); + throw \Qossmic\Deptrac\Core\Ast\AstException::couldNotCollectFiles($exception); } } } diff --git a/src/Core/Ast/Parser/Cache/AstFileReferenceCacheInterface.php b/src/Core/Ast/Parser/Cache/AstFileReferenceCacheInterface.php index 9d9ecd682..a308e5bfb 100644 --- a/src/Core/Ast/Parser/Cache/AstFileReferenceCacheInterface.php +++ b/src/Core/Ast/Parser/Cache/AstFileReferenceCacheInterface.php @@ -3,10 +3,8 @@ namespace Qossmic\Deptrac\Core\Ast\Parser\Cache; use Qossmic\Deptrac\Core\Ast\AstMap\File\FileReference; - interface AstFileReferenceCacheInterface { - public function get(string $filepath): ?FileReference; - - public function set(FileReference $fileReference): void; + public function get(string $filepath) : ?FileReference; + public function set(FileReference $fileReference) : void; } diff --git a/src/Core/Ast/Parser/Cache/AstFileReferenceDeferredCacheInterface.php b/src/Core/Ast/Parser/Cache/AstFileReferenceDeferredCacheInterface.php index 25f1879fb..cf2e308f4 100644 --- a/src/Core/Ast/Parser/Cache/AstFileReferenceDeferredCacheInterface.php +++ b/src/Core/Ast/Parser/Cache/AstFileReferenceDeferredCacheInterface.php @@ -2,9 +2,8 @@ namespace Qossmic\Deptrac\Core\Ast\Parser\Cache; -interface AstFileReferenceDeferredCacheInterface extends AstFileReferenceCacheInterface +interface AstFileReferenceDeferredCacheInterface extends \Qossmic\Deptrac\Core\Ast\Parser\Cache\AstFileReferenceCacheInterface { - public function load(): void; - - public function write(): void; + public function load() : void; + public function write() : void; } diff --git a/src/Core/Ast/Parser/Cache/AstFileReferenceFileCache.php b/src/Core/Ast/Parser/Cache/AstFileReferenceFileCache.php index fc8095e64..a007d339f 100644 --- a/src/Core/Ast/Parser/Cache/AstFileReferenceFileCache.php +++ b/src/Core/Ast/Parser/Cache/AstFileReferenceFileCache.php @@ -1,7 +1,6 @@ */ private array $cache = []; - private bool $loaded = false; + private bool $loaded = \false; /** @var array */ private array $parsedFiles = []; - - public function __construct(private readonly string $cacheFile, private readonly string $cacheVersion) {} - - public function get(string $filepath): ?FileReference + public function __construct(private readonly string $cacheFile, private readonly string $cacheVersion) + { + } + public function get(string $filepath) : ?FileReference { $this->load(); - /** @throws void */ $filepath = $this->normalizeFilepath($filepath); - /** @throws void */ if ($this->has($filepath)) { - $this->parsedFiles[$filepath] = true; - + $this->parsedFiles[$filepath] = \true; return $this->cache[$filepath]['reference']; } - return null; } - - public function set(FileReference $fileReference): void + public function set(FileReference $fileReference) : void { $this->load(); - /** @throws void */ $filepath = $this->normalizeFilepath($fileReference->filepath); - - $this->parsedFiles[$filepath] = true; - - $this->cache[$filepath] = [ - 'hash' => (string) sha1_file($filepath), - 'reference' => $fileReference, - ]; + $this->parsedFiles[$filepath] = \true; + $this->cache[$filepath] = ['hash' => (string) sha1_file($filepath), 'reference' => $fileReference]; } - - public function load(): void + public function load() : void { - if (true === $this->loaded) { + if (\true === $this->loaded) { return; } - if (!file_exists($this->cacheFile) || !is_readable($this->cacheFile)) { return; } - try { $contents = FileReader::read($this->cacheFile); } catch (CouldNotReadFileException) { return; } - /** @var ?array{version: string, payload: array} $cache */ - $cache = json_decode($contents, true); - - $this->loaded = true; - + $cache = json_decode($contents, \true); + $this->loaded = \true; if (null === $cache || $this->cacheVersion !== $cache['version']) { return; } - $this->cache = array_map( /** @param array{hash: string, reference: string} $data */ - static function (array $data): array { - $reference = unserialize( - $data['reference'], - [ - 'allowed_classes' => [ - FileReference::class, - ClassLikeReference::class, - FunctionReference::class, - VariableReference::class, - AstInherit::class, - DependencyToken::class, - DependencyType::class, - FileToken::class, - ClassLikeToken::class, - ClassLikeType::class, - FunctionToken::class, - SuperGlobalToken::class, - FileOccurrence::class, - ], - ] - ); + static function (array $data) : array { + $reference = unserialize($data['reference'], ['allowed_classes' => [FileReference::class, ClassLikeReference::class, FunctionReference::class, VariableReference::class, AstInherit::class, DependencyToken::class, DependencyType::class, FileToken::class, ClassLikeToken::class, ClassLikeType::class, FunctionToken::class, SuperGlobalToken::class, FileOccurrence::class]]); assert($reference instanceof FileReference); - - return [ - 'hash' => $data['hash'], - 'reference' => $reference, - ]; + return ['hash' => $data['hash'], 'reference' => $reference]; }, $cache['payload'] ); } - - public function write(): void + public function write() : void { if (!is_writable(dirname($this->cacheFile))) { return; } - - $cache = array_filter( - $this->cache, - fn (string $key): bool => isset($this->parsedFiles[$key]), - ARRAY_FILTER_USE_KEY - ); - - $payload = array_map( - static function (array $data): array { - $data['reference'] = serialize($data['reference']); - - return $data; - }, - $cache - ); - - file_put_contents( - $this->cacheFile, - json_encode( - [ - 'version' => $this->cacheVersion, - 'payload' => $payload, - ] - ) - ); + $cache = array_filter($this->cache, fn(string $key): bool => isset($this->parsedFiles[$key]), \ARRAY_FILTER_USE_KEY); + $payload = array_map(static function (array $data) : array { + $data['reference'] = \serialize($data['reference']); + return $data; + }, $cache); + \file_put_contents($this->cacheFile, json_encode(['version' => $this->cacheVersion, 'payload' => $payload])); } - /** * @throws FileNotExistsException */ - private function has(string $filepath): bool + private function has(string $filepath) : bool { $this->load(); - $filepath = $this->normalizeFilepath($filepath); - if (!isset($this->cache[$filepath])) { - return false; + return \false; } - $hash = sha1_file($filepath); - if ($hash !== $this->cache[$filepath]['hash']) { unset($this->cache[$filepath]); - - return false; + return \false; } - - return true; + return \true; } - /** * @throws FileNotExistsException */ - private function normalizeFilepath(string $filepath): string + private function normalizeFilepath(string $filepath) : string { $normalized = realpath($filepath); - - if (false === $normalized) { + if (\false === $normalized) { throw FileNotExistsException::fromFilePath($filepath); } - return $normalized; } } diff --git a/src/Core/Ast/Parser/Cache/AstFileReferenceInMemoryCache.php b/src/Core/Ast/Parser/Cache/AstFileReferenceInMemoryCache.php index 1ccd0c9af..5a59ece6b 100644 --- a/src/Core/Ast/Parser/Cache/AstFileReferenceInMemoryCache.php +++ b/src/Core/Ast/Parser/Cache/AstFileReferenceInMemoryCache.php @@ -1,29 +1,23 @@ */ private array $cache = []; - - public function get(string $filepath): ?FileReference + public function get(string $filepath) : ?FileReference { - $filepath = realpath($filepath); - + $filepath = \realpath($filepath); return $this->cache[$filepath] ?? null; } - - public function set(FileReference $fileReference): void + public function set(FileReference $fileReference) : void { - $filepath = (string) realpath($fileReference->filepath); - + $filepath = (string) \realpath($fileReference->filepath); $this->cache[$filepath] = $fileReference; } } diff --git a/src/Core/Ast/Parser/Cache/CacheableFileSubscriber.php b/src/Core/Ast/Parser/Cache/CacheableFileSubscriber.php index 6233cbf26..2c1e28019 100644 --- a/src/Core/Ast/Parser/Cache/CacheableFileSubscriber.php +++ b/src/Core/Ast/Parser/Cache/CacheableFileSubscriber.php @@ -1,34 +1,28 @@ > */ - public static function getSubscribedEvents(): array + public static function getSubscribedEvents() : array { - return [ - PreCreateAstMapEvent::class => 'onPreCreateAstMapEvent', - PostCreateAstMapEvent::class => 'onPostCreateAstMapEvent', - ]; + return [PreCreateAstMapEvent::class => 'onPreCreateAstMapEvent', PostCreateAstMapEvent::class => 'onPostCreateAstMapEvent']; } - - public function onPreCreateAstMapEvent(PreCreateAstMapEvent $event): void + public function onPreCreateAstMapEvent(PreCreateAstMapEvent $event) : void { $this->deferredCache->load(); } - - public function onPostCreateAstMapEvent(PostCreateAstMapEvent $event): void + public function onPostCreateAstMapEvent(PostCreateAstMapEvent $event) : void { $this->deferredCache->write(); } diff --git a/src/Core/Ast/Parser/Extractors/AnnotationReferenceExtractor.php b/src/Core/Ast/Parser/Extractors/AnnotationReferenceExtractor.php index 2cf7a3a4a..361510382 100644 --- a/src/Core/Ast/Parser/Extractors/AnnotationReferenceExtractor.php +++ b/src/Core/Ast/Parser/Extractors/AnnotationReferenceExtractor.php @@ -1,86 +1,63 @@ lexer = new Lexer(); $this->docParser = new PhpDocParser(new TypeParser(), new ConstExprParser()); } - - public function processNode(Node $node, ReferenceBuilder $referenceBuilder, TypeScope $typeScope): void + public function processNode(Node $node, ReferenceBuilder $referenceBuilder, TypeScope $typeScope) : void { - if (!$node instanceof Property - && !$node instanceof Variable - && !$node instanceof ClassMethod - ) { + if (!$node instanceof Property && !$node instanceof Variable && !$node instanceof ClassMethod) { return; } - $docComment = $node->getDocComment(); if (!$docComment instanceof Doc) { return; } - $tokens = new TokenIterator($this->lexer->tokenize($docComment->getText())); $docNode = $this->docParser->parse($tokens); - $templateTypes = array_merge( - array_map( - static fn (TemplateTagValueNode $node): string => $node->name, - $docNode->getTemplateTagValues() - ), - $referenceBuilder->getTokenTemplates() - ); - + $templateTypes = \array_merge(\array_map(static fn(TemplateTagValueNode $node): string => $node->name, $docNode->getTemplateTagValues()), $referenceBuilder->getTokenTemplates()); foreach ($docNode->getVarTagValues() as $tag) { $types = $this->typeResolver->resolvePHPStanDocParserType($tag->type, $typeScope, $templateTypes); - foreach ($types as $type) { $referenceBuilder->variable($type, $docComment->getStartLine()); } } - foreach ($docNode->getParamTagValues() as $tag) { $types = $this->typeResolver->resolvePHPStanDocParserType($tag->type, $typeScope, $templateTypes); - foreach ($types as $type) { $referenceBuilder->parameter($type, $docComment->getStartLine()); } } - foreach ($docNode->getReturnTagValues() as $tag) { $types = $this->typeResolver->resolvePHPStanDocParserType($tag->type, $typeScope, $templateTypes); - foreach ($types as $type) { $referenceBuilder->returnType($type, $docComment->getStartLine()); } } - foreach ($docNode->getThrowsTagValues() as $tag) { $types = $this->typeResolver->resolvePHPStanDocParserType($tag->type, $typeScope, $templateTypes); - foreach ($types as $type) { $referenceBuilder->throwStatement($type, $docComment->getStartLine()); } diff --git a/src/Core/Ast/Parser/Extractors/AnonymousClassExtractor.php b/src/Core/Ast/Parser/Extractors/AnonymousClassExtractor.php index b9491a6ba..2a7fd1fcd 100644 --- a/src/Core/Ast/Parser/Extractors/AnonymousClassExtractor.php +++ b/src/Core/Ast/Parser/Extractors/AnonymousClassExtractor.php @@ -1,31 +1,26 @@ name) { return; } - if ($node->extends instanceof Name) { $referenceBuilder->anonymousClassExtends($node->extends->toCodeString(), $node->extends->getLine()); } - foreach ($node->implements as $implement) { $referenceBuilder->anonymousClassImplements($implement->toCodeString(), $implement->getLine()); } - foreach ($node->getTraitUses() as $traitUse) { foreach ($traitUse->traits as $trait) { $referenceBuilder->anonymousClassTrait($trait->toCodeString(), $trait->getLine()); diff --git a/src/Core/Ast/Parser/Extractors/ClassConstantExtractor.php b/src/Core/Ast/Parser/Extractors/ClassConstantExtractor.php index cc7175196..ca5b4d39d 100644 --- a/src/Core/Ast/Parser/Extractors/ClassConstantExtractor.php +++ b/src/Core/Ast/Parser/Extractors/ClassConstantExtractor.php @@ -1,23 +1,20 @@ class instanceof Name || $node->class->isSpecialClassName()) { return; } - $referenceBuilder->constFetch($node->class->toCodeString(), $node->class->getLine()); } } diff --git a/src/Core/Ast/Parser/Extractors/FunctionCallResolver.php b/src/Core/Ast/Parser/Extractors/FunctionCallResolver.php index 20c9c8ecf..e56f96038 100644 --- a/src/Core/Ast/Parser/Extractors/FunctionCallResolver.php +++ b/src/Core/Ast/Parser/Extractors/FunctionCallResolver.php @@ -1,19 +1,18 @@ typeResolver->resolvePHPParserTypes($typeScope, $node->name) as $functionName) { diff --git a/src/Core/Ast/Parser/Extractors/FunctionLikeExtractor.php b/src/Core/Ast/Parser/Extractors/FunctionLikeExtractor.php index d7676e1f2..313e5fa55 100644 --- a/src/Core/Ast/Parser/Extractors/FunctionLikeExtractor.php +++ b/src/Core/Ast/Parser/Extractors/FunctionLikeExtractor.php @@ -1,24 +1,22 @@ getAttrGroups() as $attrGroup) { foreach ($attrGroup->attrs as $attribute) { foreach ($this->typeResolver->resolvePHPParserTypes($typeScope, $attribute->name) as $classLikeName) { diff --git a/src/Core/Ast/Parser/Extractors/KeywordExtractor.php b/src/Core/Ast/Parser/Extractors/KeywordExtractor.php index 05ac92932..306cc78ee 100644 --- a/src/Core/Ast/Parser/Extractors/KeywordExtractor.php +++ b/src/Core/Ast/Parser/Extractors/KeywordExtractor.php @@ -1,49 +1,42 @@ typeResolver->resolvePHPParserTypes($typeScope, ...$node->traits) as $classLikeName) { $referenceBuilder->trait($classLikeName, $node->getLine()); } - return; } - if ($node instanceof Instanceof_ && $node->class instanceof Name) { foreach ($this->typeResolver->resolvePHPParserTypes($typeScope, $node->class) as $classLikeName) { $referenceBuilder->instanceof($classLikeName, $node->class->getLine()); } - return; } - if ($node instanceof New_ && $node->class instanceof Name) { foreach ($this->typeResolver->resolvePHPParserTypes($typeScope, $node->class) as $classLikeName) { $referenceBuilder->newStatement($classLikeName, $node->class->getLine()); } - return; } - if ($node instanceof Catch_) { foreach ($this->typeResolver->resolvePHPParserTypes($typeScope, ...$node->types) as $classLikeName) { $referenceBuilder->catchStmt($classLikeName, $node->getLine()); diff --git a/src/Core/Ast/Parser/Extractors/PropertyExtractor.php b/src/Core/Ast/Parser/Extractors/PropertyExtractor.php index c3e5eb3e4..0e68e3b4d 100644 --- a/src/Core/Ast/Parser/Extractors/PropertyExtractor.php +++ b/src/Core/Ast/Parser/Extractors/PropertyExtractor.php @@ -1,25 +1,23 @@ attrGroups as $attrGroup) { foreach ($attrGroup->attrs as $attribute) { foreach ($this->typeResolver->resolvePHPParserTypes($typeScope, $attribute->name) as $classLikeName) { diff --git a/src/Core/Ast/Parser/Extractors/ReferenceExtractorInterface.php b/src/Core/Ast/Parser/Extractors/ReferenceExtractorInterface.php index ed74e80eb..7d1271dfa 100644 --- a/src/Core/Ast/Parser/Extractors/ReferenceExtractorInterface.php +++ b/src/Core/Ast/Parser/Extractors/ReferenceExtractorInterface.php @@ -1,14 +1,12 @@ class instanceof Name) { foreach ($this->typeResolver->resolvePHPParserTypes($typeScope, $node->class) as $classLikeName) { $referenceBuilder->staticProperty($classLikeName, $node->class->getLine()); } } - if ($node instanceof StaticCall && $node->class instanceof Name) { foreach ($this->typeResolver->resolvePHPParserTypes($typeScope, $node->class) as $classLikeName) { $referenceBuilder->staticMethod($classLikeName, $node->class->getLine()); diff --git a/src/Core/Ast/Parser/Extractors/VariableExtractor.php b/src/Core/Ast/Parser/Extractors/VariableExtractor.php index a043fdac0..8aebf88eb 100644 --- a/src/Core/Ast/Parser/Extractors/VariableExtractor.php +++ b/src/Core/Ast/Parser/Extractors/VariableExtractor.php @@ -1,29 +1,25 @@ */ private array $allowedNames; - public function __construct() { $this->allowedNames = SuperGlobalToken::allowedNames(); } - - public function processNode(Node $node, ReferenceBuilder $referenceBuilder, TypeScope $typeScope): void + public function processNode(Node $node, ReferenceBuilder $referenceBuilder, TypeScope $typeScope) : void { - if ($node instanceof Node\Expr\Variable && in_array($node->name, $this->allowedNames, true)) { + if ($node instanceof Node\Expr\Variable && \in_array($node->name, $this->allowedNames, \true)) { $referenceBuilder->superglobal($node->name, $node->getLine()); } } diff --git a/src/Core/Ast/Parser/NikicPhpParser/FileReferenceVisitor.php b/src/Core/Ast/Parser/NikicPhpParser/FileReferenceVisitor.php index 617e5136a..3a98a060e 100644 --- a/src/Core/Ast/Parser/NikicPhpParser/FileReferenceVisitor.php +++ b/src/Core/Ast/Parser/NikicPhpParser/FileReferenceVisitor.php @@ -1,92 +1,77 @@ currentTypeScope = new TypeScope(''); $this->lexer = new Lexer(); $this->docParser = new PhpDocParser(new TypeParser(), new ConstExprParser()); $this->dependencyResolvers = $dependencyResolvers; $this->currentReference = $fileReferenceBuilder; } - /** * @return list */ - private function templatesFromDocs(Node $node): array + private function templatesFromDocs(Node $node) : array { $docComment = $node->getDocComment(); if (null === $docComment) { return []; } $docText = $docComment->getText(); - // prevent expensive parsing, when not templates involved. - if (!str_contains($docText, '@template')) { + if (!\str_contains($docText, '@template')) { return []; } - $tokens = new TokenIterator($this->lexer->tokenize($docText)); $docNode = $this->docParser->parse($tokens); - - return array_values(array_map(static fn (TemplateTagValueNode $tag): string => $tag->name, $docNode->getTemplateTagValues())); + return \array_values(\array_map(static fn(TemplateTagValueNode $tag): string => $tag->name, $docNode->getTemplateTagValues())); } - public function enterNode(Node $node) { - match (true) { + match (\true) { $node instanceof Namespace_ => $this->currentTypeScope = new TypeScope($node->name ? $node->name->toCodeString() : ''), $node instanceof Node\Stmt\Function_ => $this->enterFunction($node), $node instanceof ClassLike => $this->enterClassLike($node), $node instanceof Node\FunctionLike => $this->enterFunctionLike($node), - default => null + default => null, }; - return null; } - public function leaveNode(Node $node) { if ($node instanceof Node\FunctionLike) { @@ -94,59 +79,46 @@ public function leaveNode(Node $node) $this->currentReference->removeTokenTemplate($template); } } - - match (true) { + match (\true) { $node instanceof Node\Stmt\Function_ => $this->currentReference = $this->fileReferenceBuilder, $node instanceof ClassLike && null !== $this->getClassReferenceName($node) => $this->currentReference = $this->fileReferenceBuilder, $node instanceof Use_ && Use_::TYPE_NORMAL === $node->type => $this->leaveUse($node), $node instanceof GroupUse => $this->leaveGroupUse($node), - default => null + default => null, }; - foreach ($this->dependencyResolvers as $resolver) { $resolver->processNode($node, $this->currentReference, $this->currentTypeScope); } - return null; } - /** * @return ?array{PhpDocNode, int} DocNode, comment start line */ - private function getDocNodeCrate(ClassLike $node): ?array + private function getDocNodeCrate(ClassLike $node) : ?array { $docComment = $node->getDocComment(); if (null === $docComment) { return null; } $tokens = new TokenIterator($this->lexer->tokenize($docComment->getText())); - return [$this->docParser->parse($tokens), $docComment->getStartLine()]; } - - private function enterClassLike(ClassLike $node): void + private function enterClassLike(ClassLike $node) : void { $name = $this->getClassReferenceName($node); $docNodeCrate = $this->getDocNodeCrate($node); if (null !== $name) { - $isInternal = false; + $isInternal = \false; if (null !== $docNodeCrate) { - $isInternal = [] !== array_merge( - $docNodeCrate[0]->getTagsByName('@internal'), - $docNodeCrate[0]->getTagsByName('@deptrac-internal') - ); + $isInternal = [] !== \array_merge($docNodeCrate[0]->getTagsByName('@internal'), $docNodeCrate[0]->getTagsByName('@deptrac-internal')); } - - match (true) { + match (\true) { $node instanceof Interface_ => $this->enterInterface($name, $node, $isInternal), $node instanceof Class_ => $this->enterClass($name, $node, $isInternal), - $node instanceof Trait_ => $this->currentReference = - $this->fileReferenceBuilder->newTrait($name, $this->templatesFromDocs($node), $isInternal), - default => $this->currentReference = - $this->fileReferenceBuilder->newClassLike($name, $this->templatesFromDocs($node), $isInternal) + $node instanceof Trait_ => $this->currentReference = $this->fileReferenceBuilder->newTrait($name, $this->templatesFromDocs($node), $isInternal), + default => $this->currentReference = $this->fileReferenceBuilder->newClassLike($name, $this->templatesFromDocs($node), $isInternal), }; } - foreach ($node->attrGroups as $attrGroup) { foreach ($attrGroup->attrs as $attribute) { foreach ($this->typeResolver->resolvePHPParserTypes($this->currentTypeScope, $attribute->name) as $classLikeName) { @@ -154,13 +126,11 @@ private function enterClassLike(ClassLike $node): void } } } - if (null !== $docNodeCrate) { $this->processClassLikeDocs($docNodeCrate); } } - - private function enterFunction(Node\Stmt\Function_ $node): void + private function enterFunction(Node\Stmt\Function_ $node) : void { if (isset($node->namespacedName)) { $namespacedName = $node->namespacedName; @@ -168,9 +138,7 @@ private function enterFunction(Node\Stmt\Function_ $node): void } else { $name = $node->name->toString(); } - $this->currentReference = $this->fileReferenceBuilder->newFunction($name, $this->templatesFromDocs($node)); - foreach ($node->getParams() as $param) { if (null !== $param->type) { foreach ($this->typeResolver->resolvePHPParserTypes($this->currentTypeScope, $param->type) as $classLikeName) { @@ -178,14 +146,12 @@ private function enterFunction(Node\Stmt\Function_ $node): void } } } - $returnType = $node->getReturnType(); if (null !== $returnType) { foreach ($this->typeResolver->resolvePHPParserTypes($this->currentTypeScope, $returnType) as $classLikeName) { $this->currentReference->returnType($classLikeName, $returnType->getLine()); } } - foreach ($node->getAttrGroups() as $attrGroup) { foreach ($attrGroup->attrs as $attribute) { foreach ($this->typeResolver->resolvePHPParserTypes($this->currentTypeScope, $attribute) as $classLikeName) { @@ -194,85 +160,67 @@ private function enterFunction(Node\Stmt\Function_ $node): void } } } - - private function getClassReferenceName(ClassLike $node): ?string + private function getClassReferenceName(ClassLike $node) : ?string { if (isset($node->namespacedName)) { return $node->namespacedName->toCodeString(); } - if ($node->name instanceof Identifier) { return $node->name->toString(); } - return null; } - - private function enterInterface(string $name, Interface_ $node, bool $isInternal): void + private function enterInterface(string $name, Interface_ $node, bool $isInternal) : void { $this->currentReference = $this->fileReferenceBuilder->newInterface($name, $this->templatesFromDocs($node), $isInternal); - foreach ($node->extends as $extend) { $this->currentReference->implements($extend->toCodeString(), $extend->getLine()); } } - - private function enterClass(string $name, Class_ $node, bool $isInternal): void + private function enterClass(string $name, Class_ $node, bool $isInternal) : void { $this->currentReference = $this->fileReferenceBuilder->newClass($name, $this->templatesFromDocs($node), $isInternal); if ($node->extends instanceof Name) { $this->currentReference->extends($node->extends->toCodeString(), $node->extends->getLine()); } - foreach ($node->implements as $implement) { $this->currentReference->implements($implement->toCodeString(), $implement->getLine()); } } - - private function enterFunctionLike(Node\FunctionLike $node): void + private function enterFunctionLike(Node\FunctionLike $node) : void { foreach ($this->templatesFromDocs($node) as $template) { $this->currentReference->addTokenTemplate($template); } } - - private function leaveUse(Use_ $node): void + private function leaveUse(Use_ $node) : void { foreach ($node->uses as $use) { $this->currentTypeScope->addUse($use->name->toString(), $use->getAlias()->toString()); $this->fileReferenceBuilder->useStatement($use->name->toString(), $use->name->getLine()); } } - - private function leaveGroupUse(GroupUse $node): void + private function leaveGroupUse(GroupUse $node) : void { foreach ($node->uses as $use) { if (Use_::TYPE_NORMAL === $use->type) { - $classLikeName = $node->prefix->toString().'\\'.$use->name->toString(); + $classLikeName = $node->prefix->toString() . '\\' . $use->name->toString(); $this->currentTypeScope->addUse($classLikeName, $use->getAlias()->toString()); $this->fileReferenceBuilder->useStatement($classLikeName, $use->name->getLine()); } } } - /** * @param array{PhpDocNode, int} $docNodeCrate */ - private function processClassLikeDocs(array $docNodeCrate): void + private function processClassLikeDocs(array $docNodeCrate) : void { [$docNode, $line] = $docNodeCrate; foreach ($docNode->getMethodTagValues() as $methodTagValue) { - $templateTypes = array_merge( - array_map( - static fn (TemplateTagValueNode $node): string => $node->name, - $methodTagValue->templateTypes - ), - $this->currentReference->getTokenTemplates() - ); + $templateTypes = \array_merge(\array_map(static fn(TemplateTagValueNode $node): string => $node->name, $methodTagValue->templateTypes), $this->currentReference->getTokenTemplates()); foreach ($methodTagValue->parameters as $tag) { if (null !== $tag->type) { $types = $this->typeResolver->resolvePHPStanDocParserType($tag->type, $this->currentTypeScope, $templateTypes); - foreach ($types as $type) { $this->currentReference->parameter($type, $line); } @@ -281,18 +229,15 @@ private function processClassLikeDocs(array $docNodeCrate): void $returnType = $methodTagValue->returnType; if (null !== $returnType) { $types = $this->typeResolver->resolvePHPStanDocParserType($returnType, $this->currentTypeScope, $templateTypes); - foreach ($types as $type) { $this->currentReference->returnType($type, $line); } } } - /** @var list $propertyTags */ - $propertyTags = array_merge($docNode->getPropertyTagValues(), $docNode->getPropertyReadTagValues(), $docNode->getPropertyWriteTagValues()); + $propertyTags = \array_merge($docNode->getPropertyTagValues(), $docNode->getPropertyReadTagValues(), $docNode->getPropertyWriteTagValues()); foreach ($propertyTags as $tag) { $types = $this->typeResolver->resolvePHPStanDocParserType($tag->type, $this->currentTypeScope, $this->currentReference->getTokenTemplates()); - foreach ($types as $type) { $this->currentReference->variable($type, $line); } diff --git a/src/Core/Ast/Parser/NikicPhpParser/NikicPhpParser.php b/src/Core/Ast/Parser/NikicPhpParser/NikicPhpParser.php index e6910ea1d..046cb60e4 100644 --- a/src/Core/Ast/Parser/NikicPhpParser/NikicPhpParser.php +++ b/src/Core/Ast/Parser/NikicPhpParser/NikicPhpParser.php @@ -1,18 +1,17 @@ */ private static array $classAstMap = []; - private readonly NodeTraverser $traverser; - /** * @param ReferenceExtractorInterface[] $extractors */ - public function __construct( - private readonly Parser $parser, - private readonly AstFileReferenceCacheInterface $cache, - private readonly TypeResolver $typeResolver, - private readonly iterable $extractors - ) { + public function __construct(private readonly Parser $parser, private readonly AstFileReferenceCacheInterface $cache, private readonly TypeResolver $typeResolver, private readonly iterable $extractors) + { $this->traverser = new NodeTraverser(); $this->traverser->addVisitor(new NameResolver()); } - - public function parseFile(string $file): FileReference + public function parseFile(string $file) : FileReference { - if (null !== $fileReference = $this->cache->get($file)) { + if (null !== ($fileReference = $this->cache->get($file))) { return $fileReference; } - $fileReferenceBuilder = FileReferenceBuilder::create($file); - $visitor = new FileReferenceVisitor($fileReferenceBuilder, $this->typeResolver, ...$this->extractors); + $visitor = new \Qossmic\Deptrac\Core\Ast\Parser\NikicPhpParser\FileReferenceVisitor($fileReferenceBuilder, $this->typeResolver, ...$this->extractors); $nodes = $this->loadNodesFromFile($file); $this->traverser->addVisitor($visitor); $this->traverser->traverse($nodes); $this->traverser->removeVisitor($visitor); - $fileReference = $fileReferenceBuilder->build(); $this->cache->set($fileReference); - return $fileReference; } - /** * @throws CouldNotParseFileException */ - public function getNodeForClassLikeReference(ClassLikeReference $classReference): ?ClassLike + public function getNodeForClassLikeReference(ClassLikeReference $classReference) : ?ClassLike { $classLikeName = $classReference->getToken()->toString(); - if (isset(self::$classAstMap[$classLikeName])) { return self::$classAstMap[$classLikeName]; } - $filepath = $classReference->getFilepath(); - if (null === $filepath) { return null; } - - $visitor = new FindingVisitor(static fn (Node $node): bool => $node instanceof ClassLike); + $visitor = new FindingVisitor(static fn(Node $node): bool => $node instanceof ClassLike); $nodes = $this->loadNodesFromFile($filepath); $this->traverser->addVisitor($visitor); $this->traverser->traverse($nodes); $this->traverser->removeVisitor($visitor); - /** @var ClassLike[] $classLikeNodes */ $classLikeNodes = $visitor->getFoundNodes(); - foreach ($classLikeNodes as $classLikeNode) { if (isset($classLikeNode->namespacedName)) { $namespacedName = $classLikeNode->namespacedName; @@ -100,26 +81,22 @@ public function getNodeForClassLikeReference(ClassLikeReference $classReference) } else { continue; } - self::$classAstMap[$className] = $classLikeNode; } - /** @psalm-var ?ClassLike */ return self::$classAstMap[$classLikeName] ?? null; } - /** * @return array * * @throws CouldNotParseFileException */ - private function loadNodesFromFile(string $filepath): array + private function loadNodesFromFile(string $filepath) : array { try { $fileContents = FileReader::read($filepath); /** @throws Error */ $nodes = $this->parser->parse($fileContents, new Throwing()); - /** @var array $nodes */ return $nodes; } catch (Error|CouldNotReadFileException $e) { diff --git a/src/Core/Ast/Parser/ParserInterface.php b/src/Core/Ast/Parser/ParserInterface.php index 2b0eee73d..814fe58cd 100644 --- a/src/Core/Ast/Parser/ParserInterface.php +++ b/src/Core/Ast/Parser/ParserInterface.php @@ -1,16 +1,14 @@ typeResolver = new phpDocumentorTypeResolver(new FqsenResolver()); } - /** * @return string[] */ - public function resolvePHPParserTypes(TypeScope $typeScope, NodeAbstract ...$nodes): array + public function resolvePHPParserTypes(\Qossmic\Deptrac\Core\Ast\Parser\TypeScope $typeScope, NodeAbstract ...$nodes) : array { $types = []; foreach ($nodes as $node) { $types[] = $this->resolvePHPParserType($typeScope, $node); } - - return array_merge([], ...$types); + return \array_merge([], ...$types); } - /** * @return string[] */ - private function resolvePHPParserType(TypeScope $typeScope, NodeAbstract $node): array + private function resolvePHPParserType(\Qossmic\Deptrac\Core\Ast\Parser\TypeScope $typeScope, NodeAbstract $node) : array { - return match (true) { + return match (\true) { $node instanceof Name && $node->isSpecialClassName() => [], $node instanceof Name => $this->resolveString($node->toCodeString(), $typeScope), $node instanceof NullableType => $this->resolvePHPParserType($typeScope, $node->type), $node instanceof UnionType => $this->resolvePHPParserTypes($typeScope, ...$node->types), $node instanceof IntersectionType => $this->resolvePHPParserTypes($typeScope, ...$node->types), - default => [] + default => [], }; } - /** * @param array $templateTypes * * @return string[] */ - public function resolvePHPStanDocParserType(TypeNode $type, TypeScope $typeScope, array $templateTypes): array + public function resolvePHPStanDocParserType(TypeNode $type, \Qossmic\Deptrac\Core\Ast\Parser\TypeScope $typeScope, array $templateTypes) : array { - return match (true) { - $type instanceof IdentifierTypeNode => in_array($type->name, $templateTypes, true) ? [] : $this->resolveString($type->name, $typeScope), + return match (\true) { + $type instanceof IdentifierTypeNode => \in_array($type->name, $templateTypes, \true) ? [] : $this->resolveString($type->name, $typeScope), $type instanceof ConstTypeNode && $type->constExpr instanceof ConstFetchNode => $this->resolveString($type->constExpr->className, $typeScope), $type instanceof NullableTypeNode => $this->resolvePHPStanDocParserType($type->type, $typeScope, $templateTypes), $type instanceof ArrayTypeNode => $this->resolvePHPStanDocParserType($type->type, $typeScope, $templateTypes), @@ -87,141 +80,81 @@ public function resolvePHPStanDocParserType(TypeNode $type, TypeScope $typeScope $type instanceof GenericTypeNode => $this->resolveGeneric($type, $typeScope, $templateTypes), $type instanceof ArrayShapeNode => $this->resolveArray($type, $typeScope, $templateTypes), $type instanceof CallableTypeNode => $this->resolveCallable($type, $typeScope, $templateTypes), - default => $this->resolveString((string) $type, $typeScope) + default => $this->resolveString((string) $type, $typeScope), }; } - /** * @return string[] */ - private function resolveString(string $type, TypeScope $nameScope): array + private function resolveString(string $type, \Qossmic\Deptrac\Core\Ast\Parser\TypeScope $nameScope) : array { try { $context = new Context($nameScope->namespace, $nameScope->getUses()); /** @throws InvalidArgumentException */ $resolvedType = $this->typeResolver->resolve($type, $context); - return $this->resolveReflectionType($resolvedType); } catch (Throwable) { return []; } } - /** * @return string[] */ - public function resolvePropertyType(Identifier|Name|ComplexType $type): array + public function resolvePropertyType(Identifier|Name|ComplexType $type) : array { - return match (true) { + return match (\true) { $type instanceof FullyQualified => [(string) $type], $type instanceof NullableType => $this->resolvePropertyType($type->type), - $type instanceof UnionType || $type instanceof IntersectionType => array_merge( - [], - ...array_map( - fn (Identifier|Name|IntersectionType $typeNode): array => $this->resolvePropertyType($typeNode), - $type->types - ) - ), - default => [] + $type instanceof UnionType || $type instanceof IntersectionType => \array_merge([], ...\array_map(fn(Identifier|Name|IntersectionType $typeNode): array => $this->resolvePropertyType($typeNode), $type->types)), + default => [], }; } - /** * @return string[] */ - private function resolveReflectionType(Type $resolvedType): array + private function resolveReflectionType(Type $resolvedType) : array { - return match (true) { + return match (\true) { $resolvedType instanceof Object_ => ($fqsen = $resolvedType->getFqsen()) ? [(string) $fqsen] : [], - $resolvedType instanceof Compound => array_merge([], ...array_map(fn (Type $type) => $this->resolveReflectionType($type), iterator_to_array($resolvedType))), - default => [] + $resolvedType instanceof Compound => \array_merge([], ...\array_map(fn(Type $type) => $this->resolveReflectionType($type), \iterator_to_array($resolvedType))), + default => [], }; } - /** * @param array $templateTypes * * @return string[] */ - private function resolveGeneric(GenericTypeNode $type, TypeScope $typeScope, array $templateTypes): array + private function resolveGeneric(GenericTypeNode $type, \Qossmic\Deptrac\Core\Ast\Parser\TypeScope $typeScope, array $templateTypes) : array { - $preType = 'list' === $type->type->name - ? [] - : $this->resolvePHPStanDocParserType( - $type->type, - $typeScope, - $templateTypes - ); - - return array_merge( - $preType, - ...array_map( - fn (TypeNode $typeNode): array => $this->resolvePHPStanDocParserType( - $typeNode, - $typeScope, - $templateTypes - ), - $type->genericTypes - ) - ); + $preType = 'list' === $type->type->name ? [] : $this->resolvePHPStanDocParserType($type->type, $typeScope, $templateTypes); + return \array_merge($preType, ...\array_map(fn(TypeNode $typeNode): array => $this->resolvePHPStanDocParserType($typeNode, $typeScope, $templateTypes), $type->genericTypes)); } - /** * @param array $templateTypes * * @return string[] */ - private function resolveCallable(CallableTypeNode $type, TypeScope $typeScope, array $templateTypes): array + private function resolveCallable(CallableTypeNode $type, \Qossmic\Deptrac\Core\Ast\Parser\TypeScope $typeScope, array $templateTypes) : array { - return array_merge( - $this->resolvePHPStanDocParserType($type->returnType, $typeScope, $templateTypes), - ...array_map( - fn (CallableTypeParameterNode $parameterNode): array => $this->resolvePHPStanDocParserType( - $parameterNode->type, - $typeScope, - $templateTypes - ), - $type->parameters - ) - ); + return \array_merge($this->resolvePHPStanDocParserType($type->returnType, $typeScope, $templateTypes), ...\array_map(fn(CallableTypeParameterNode $parameterNode): array => $this->resolvePHPStanDocParserType($parameterNode->type, $typeScope, $templateTypes), $type->parameters)); } - /** * @param array $templateTypes * * @return string[] */ - private function resolveArray(ArrayShapeNode $type, TypeScope $typeScope, array $templateTypes): array + private function resolveArray(ArrayShapeNode $type, \Qossmic\Deptrac\Core\Ast\Parser\TypeScope $typeScope, array $templateTypes) : array { - return array_merge([], - ...array_map( - fn (ArrayShapeItemNode $itemNode): array => $this->resolvePHPStanDocParserType( - $itemNode->valueType, - $typeScope, - $templateTypes - ), - $type->items - )); + return \array_merge([], ...\array_map(fn(ArrayShapeItemNode $itemNode): array => $this->resolvePHPStanDocParserType($itemNode->valueType, $typeScope, $templateTypes), $type->items)); } - /** * @param array $templateTypes * * @return string[] */ - private function resolveVariableType( - UnionTypeNode|IntersectionTypeNode $type, - TypeScope $typeScope, - array $templateTypes - ): array { - return array_merge([], - ...array_map( - fn (TypeNode $typeNode): array => $this->resolvePHPStanDocParserType( - $typeNode, - $typeScope, - $templateTypes - ), - $type->types - )); + private function resolveVariableType(UnionTypeNode|IntersectionTypeNode $type, \Qossmic\Deptrac\Core\Ast\Parser\TypeScope $typeScope, array $templateTypes) : array + { + return \array_merge([], ...\array_map(fn(TypeNode $typeNode): array => $this->resolvePHPStanDocParserType($typeNode, $typeScope, $templateTypes), $type->types)); } } diff --git a/src/Core/Ast/Parser/TypeScope.php b/src/Core/Ast/Parser/TypeScope.php index 05ea9f826..de81a501b 100644 --- a/src/Core/Ast/Parser/TypeScope.php +++ b/src/Core/Ast/Parser/TypeScope.php @@ -1,7 +1,6 @@ alias => className */ private array $uses = []; - - public function __construct(public readonly string $namespace) {} - - public function addUse(string $className, ?string $alias): void + public function __construct(public readonly string $namespace) + { + } + public function addUse(string $className, ?string $alias) : void { $this->uses[$alias ?: $className] = $className; } - /** * @return array */ - public function getUses(): array + public function getUses() : array { return $this->uses; } diff --git a/src/Core/Dependency/Dependency.php b/src/Core/Dependency/Dependency.php index 4a8d551b4..adde7deab 100644 --- a/src/Core/Dependency/Dependency.php +++ b/src/Core/Dependency/Dependency.php @@ -1,47 +1,34 @@ $this->dependent->toString(), - 'line' => $this->fileOccurrence->line, - ]]; } - - public function getDepender(): TokenInterface + public function serialize() : array + { + return [['name' => $this->dependent->toString(), 'line' => $this->fileOccurrence->line]]; + } + public function getDepender() : TokenInterface { return $this->depender; } - - public function getDependent(): TokenInterface + public function getDependent() : TokenInterface { return $this->dependent; } - - public function getFileOccurrence(): FileOccurrence + public function getFileOccurrence() : FileOccurrence { return $this->fileOccurrence; } - - public function getType(): DependencyType + public function getType() : DependencyType { return $this->dependencyType; } diff --git a/src/Core/Dependency/DependencyList.php b/src/Core/Dependency/DependencyList.php index dd7be5456..930091111 100644 --- a/src/Core/Dependency/DependencyList.php +++ b/src/Core/Dependency/DependencyList.php @@ -1,59 +1,47 @@ */ private array $dependencies = []; - /** @var array */ private array $inheritDependencies = []; - - public function addDependency(Dependency $dependency): self + public function addDependency(\Qossmic\Deptrac\Core\Dependency\Dependency $dependency) : self { $tokenName = $dependency->getDepender()->toString(); if (!isset($this->dependencies[$tokenName])) { $this->dependencies[$tokenName] = []; } - $this->dependencies[$tokenName][] = $dependency; - return $this; } - - public function addInheritDependency(InheritDependency $dependency): self + public function addInheritDependency(\Qossmic\Deptrac\Core\Dependency\InheritDependency $dependency) : self { $classLikeName = $dependency->getDepender()->toString(); if (!isset($this->inheritDependencies[$classLikeName])) { $this->inheritDependencies[$classLikeName] = []; } - $this->inheritDependencies[$classLikeName][] = $dependency; - return $this; } - /** * @return Dependency[] */ - public function getDependenciesByClass(ClassLikeToken $classLikeName): array + public function getDependenciesByClass(ClassLikeToken $classLikeName) : array { return $this->dependencies[$classLikeName->toString()] ?? []; } - /** * @return DependencyInterface[] */ - public function getDependenciesAndInheritDependencies(): array + public function getDependenciesAndInheritDependencies() : array { $buffer = []; - foreach ($this->dependencies as $deps) { foreach ($deps as $dependency) { $buffer[] = $dependency; @@ -64,7 +52,6 @@ public function getDependenciesAndInheritDependencies(): array $buffer[] = $dependency; } } - return $buffer; } } diff --git a/src/Core/Dependency/DependencyResolver.php b/src/Core/Dependency/DependencyResolver.php index dc7642ab7..a6384ad46 100644 --- a/src/Core/Dependency/DependencyResolver.php +++ b/src/Core/Dependency/DependencyResolver.php @@ -1,57 +1,47 @@ } $config */ - public function __construct( - private readonly array $config, - private readonly InheritanceFlattener $inheritanceFlattener, - private readonly ContainerInterface $emitterLocator, - private readonly EventDispatcherInterface $eventDispatcher - ) {} - + public function __construct(private readonly array $config, private readonly \Qossmic\Deptrac\Core\Dependency\InheritanceFlattener $inheritanceFlattener, private readonly ContainerInterface $emitterLocator, private readonly EventDispatcherInterface $eventDispatcher) + { + } /** * @throws InvalidEmitterConfigurationException */ - public function resolve(AstMap $astMap): DependencyList + public function resolve(AstMap $astMap) : \Qossmic\Deptrac\Core\Dependency\DependencyList { - $result = new DependencyList(); - + $result = new \Qossmic\Deptrac\Core\Dependency\DependencyList(); foreach ($this->config['types'] as $type) { try { $emitter = $this->emitterLocator->get($type); } catch (ContainerExceptionInterface) { - throw InvalidEmitterConfigurationException::couldNotLocate($type); + throw \Qossmic\Deptrac\Core\Dependency\InvalidEmitterConfigurationException::couldNotLocate($type); } if (!$emitter instanceof DependencyEmitterInterface) { - throw InvalidEmitterConfigurationException::isNotEmitter($type, $emitter); + throw \Qossmic\Deptrac\Core\Dependency\InvalidEmitterConfigurationException::isNotEmitter($type, $emitter); } - $this->eventDispatcher->dispatch(new PreEmitEvent($emitter->getName())); $emitter->applyDependencies($astMap, $result); $this->eventDispatcher->dispatch(new PostEmitEvent()); } - $this->eventDispatcher->dispatch(new PreFlattenEvent()); $this->inheritanceFlattener->flattenDependencies($astMap, $result); $this->eventDispatcher->dispatch(new PostFlattenEvent()); - return $result; } } diff --git a/src/Core/Dependency/Emitter/ClassDependencyEmitter.php b/src/Core/Dependency/Emitter/ClassDependencyEmitter.php index d7280d81d..8a36cdbe7 100644 --- a/src/Core/Dependency/Emitter/ClassDependencyEmitter.php +++ b/src/Core/Dependency/Emitter/ClassDependencyEmitter.php @@ -1,26 +1,22 @@ getClassLikeReferences() as $classReference) { $classLikeName = $classReference->getToken(); - foreach ($classReference->dependencies as $dependency) { if (DependencyType::SUPERGLOBAL_VARIABLE === $dependency->type) { continue; @@ -28,26 +24,10 @@ public function applyDependencies(AstMap $astMap, DependencyList $dependencyList if (DependencyType::UNRESOLVED_FUNCTION_CALL === $dependency->type) { continue; } - - $dependencyList->addDependency( - new Dependency( - $classLikeName, - $dependency->token, - $dependency->fileOccurrence, - $dependency->type - ) - ); + $dependencyList->addDependency(new Dependency($classLikeName, $dependency->token, $dependency->fileOccurrence, $dependency->type)); } - foreach ($astMap->getClassInherits($classLikeName) as $inherit) { - $dependencyList->addDependency( - new Dependency( - $classLikeName, - $inherit->classLikeName, - $inherit->fileOccurrence, - DependencyType::INHERIT - ) - ); + $dependencyList->addDependency(new Dependency($classLikeName, $inherit->classLikeName, $inherit->fileOccurrence, DependencyType::INHERIT)); } } } diff --git a/src/Core/Dependency/Emitter/ClassSuperglobalDependencyEmitter.php b/src/Core/Dependency/Emitter/ClassSuperglobalDependencyEmitter.php index 43739eb27..3d6161157 100644 --- a/src/Core/Dependency/Emitter/ClassSuperglobalDependencyEmitter.php +++ b/src/Core/Dependency/Emitter/ClassSuperglobalDependencyEmitter.php @@ -1,36 +1,26 @@ getClassLikeReferences() as $classReference) { foreach ($classReference->dependencies as $dependency) { if (DependencyType::SUPERGLOBAL_VARIABLE !== $dependency->type) { continue; } - $dependencyList->addDependency( - new Dependency( - $classReference->getToken(), - $dependency->token, - $dependency->fileOccurrence, - $dependency->type - ) - ); + $dependencyList->addDependency(new Dependency($classReference->getToken(), $dependency->token, $dependency->fileOccurrence, $dependency->type)); } } } diff --git a/src/Core/Dependency/Emitter/DependencyEmitterInterface.php b/src/Core/Dependency/Emitter/DependencyEmitterInterface.php index 1940d81da..67cf594de 100644 --- a/src/Core/Dependency/Emitter/DependencyEmitterInterface.php +++ b/src/Core/Dependency/Emitter/DependencyEmitterInterface.php @@ -1,15 +1,12 @@ */ private array $nodes = []; - - public function isFQDN(): bool + public function isFQDN() : bool { return $this->FQDN; } - /** * @param string[] $keys */ - public function getNestedNode(array $keys): ?self + public function getNestedNode(array $keys) : ?self { $index = $this; foreach ($keys as $key) { @@ -32,31 +27,25 @@ public function getNestedNode(array $keys): ?self if (null === $node) { return null; } - $index = $node; } - return $index; } - /** * @param string[] $keys */ - public function setNestedNode(array $keys): void + public function setNestedNode(array $keys) : void { if (0 === count($keys)) { - $this->FQDN = true; - + $this->FQDN = \true; return; } - $key = array_shift($keys); $node = $this->nodes[$key] ?? null; if (null === $node) { $node = new self(); $this->nodes[$key] = $node; } - $node->setNestedNode($keys); } } diff --git a/src/Core/Dependency/Emitter/FileDependencyEmitter.php b/src/Core/Dependency/Emitter/FileDependencyEmitter.php index aa3f13fe5..ede78bc12 100644 --- a/src/Core/Dependency/Emitter/FileDependencyEmitter.php +++ b/src/Core/Dependency/Emitter/FileDependencyEmitter.php @@ -1,41 +1,29 @@ getFileReferences() as $fileReference) { foreach ($fileReference->dependencies as $dependency) { if (DependencyType::USE === $dependency->type) { continue; } - if (DependencyType::UNRESOLVED_FUNCTION_CALL === $dependency->type) { continue; } - - $dependencyList->addDependency( - new Dependency( - $fileReference->getToken(), - $dependency->token, - $dependency->fileOccurrence, - $dependency->type - ) - ); + $dependencyList->addDependency(new Dependency($fileReference->getToken(), $dependency->token, $dependency->fileOccurrence, $dependency->type)); } } } diff --git a/src/Core/Dependency/Emitter/FunctionCallDependencyEmitter.php b/src/Core/Dependency/Emitter/FunctionCallDependencyEmitter.php index 1624ac93c..0b62f9ac4 100644 --- a/src/Core/Dependency/Emitter/FunctionCallDependencyEmitter.php +++ b/src/Core/Dependency/Emitter/FunctionCallDependencyEmitter.php @@ -1,7 +1,6 @@ createDependenciesForReferences($astMap->getClassLikeReferences(), $astMap, $dependencyList); $this->createDependenciesForReferences($astMap->getFunctionReferences(), $astMap, $dependencyList); $this->createDependenciesForReferences($astMap->getFileReferences(), $astMap, $dependencyList); } - /** * @param array $references */ - private function createDependenciesForReferences(array $references, AstMap $astMap, DependencyList $dependencyList): void + private function createDependenciesForReferences(array $references, AstMap $astMap, DependencyList $dependencyList) : void { foreach ($references as $reference) { foreach ($reference->dependencies as $dependency) { if (DependencyType::UNRESOLVED_FUNCTION_CALL !== $dependency->type) { continue; } - $token = $dependency->token; - assert($token instanceof FunctionToken); + \assert($token instanceof FunctionToken); if (null === $astMap->getFunctionReferenceForToken($token)) { continue; } - - $dependencyList->addDependency( - new Dependency( - $reference->getToken(), $dependency->token, $dependency->fileOccurrence, $dependency->type - ) - ); + $dependencyList->addDependency(new Dependency($reference->getToken(), $dependency->token, $dependency->fileOccurrence, $dependency->type)); } } } diff --git a/src/Core/Dependency/Emitter/FunctionDependencyEmitter.php b/src/Core/Dependency/Emitter/FunctionDependencyEmitter.php index 6a74f58c7..42023b566 100644 --- a/src/Core/Dependency/Emitter/FunctionDependencyEmitter.php +++ b/src/Core/Dependency/Emitter/FunctionDependencyEmitter.php @@ -1,22 +1,19 @@ getFileReferences() as $astFileReference) { foreach ($astFileReference->functionReferences as $astFunctionReference) { @@ -24,19 +21,10 @@ public function applyDependencies(AstMap $astMap, DependencyList $dependencyList if (DependencyType::SUPERGLOBAL_VARIABLE === $dependency->type) { continue; } - if (DependencyType::UNRESOLVED_FUNCTION_CALL === $dependency->type) { continue; } - - $dependencyList->addDependency( - new Dependency( - $astFunctionReference->getToken(), - $dependency->token, - $dependency->fileOccurrence, - $dependency->type - ) - ); + $dependencyList->addDependency(new Dependency($astFunctionReference->getToken(), $dependency->token, $dependency->fileOccurrence, $dependency->type)); } } } diff --git a/src/Core/Dependency/Emitter/FunctionSuperglobalDependencyEmitter.php b/src/Core/Dependency/Emitter/FunctionSuperglobalDependencyEmitter.php index 0025a0bcd..e49f99b09 100644 --- a/src/Core/Dependency/Emitter/FunctionSuperglobalDependencyEmitter.php +++ b/src/Core/Dependency/Emitter/FunctionSuperglobalDependencyEmitter.php @@ -1,22 +1,19 @@ getFileReferences() as $astFileReference) { foreach ($astFileReference->functionReferences as $astFunctionReference) { @@ -24,14 +21,7 @@ public function applyDependencies(AstMap $astMap, DependencyList $dependencyList if (DependencyType::SUPERGLOBAL_VARIABLE !== $dependency->type) { continue; } - $dependencyList->addDependency( - new Dependency( - $astFunctionReference->getToken(), - $dependency->token, - $dependency->fileOccurrence, - $dependency->type - ) - ); + $dependencyList->addDependency(new Dependency($astFunctionReference->getToken(), $dependency->token, $dependency->fileOccurrence, $dependency->type)); } } } diff --git a/src/Core/Dependency/Emitter/UsesDependencyEmitter.php b/src/Core/Dependency/Emitter/UsesDependencyEmitter.php index e1068e003..e54b767ec 100644 --- a/src/Core/Dependency/Emitter/UsesDependencyEmitter.php +++ b/src/Core/Dependency/Emitter/UsesDependencyEmitter.php @@ -1,7 +1,6 @@ getClassLikeReferences(), $astMap->getFunctionReferences()); - $referencesFQDN = array_map( - static fn ($ref): string => $ref->getToken()->toString(), - $references - ); - - $FQDNIndex = new FQDNIndexNode(); + $referencesFQDN = array_map(static fn($ref): string => $ref->getToken()->toString(), $references); + $FQDNIndex = new \Qossmic\Deptrac\Core\Dependency\Emitter\FQDNIndexNode(); foreach ($referencesFQDN as $reference) { $path = explode('\\', $reference); $FQDNIndex->setNestedNode($path); } - foreach ($astMap->getFileReferences() as $fileReference) { foreach ($fileReference->classLikeReferences as $astClassReference) { foreach ($fileReference->dependencies as $emittedDependency) { - if (DependencyType::USE === $emittedDependency->type - && $this->isFQDN($emittedDependency, $FQDNIndex) - ) { - $dependencyList->addDependency( - new Dependency( - $astClassReference->getToken(), - $emittedDependency->token, - $emittedDependency->fileOccurrence, - $emittedDependency->type - ) - ); + if (DependencyType::USE === $emittedDependency->type && $this->isFQDN($emittedDependency, $FQDNIndex)) { + $dependencyList->addDependency(new Dependency($astClassReference->getToken(), $emittedDependency->token, $emittedDependency->fileOccurrence, $emittedDependency->type)); } } } } } - - private function isFQDN(DependencyToken $dependency, FQDNIndexNode $FQDNIndex): bool + private function isFQDN(DependencyToken $dependency, \Qossmic\Deptrac\Core\Dependency\Emitter\FQDNIndexNode $FQDNIndex) : bool { $dependencyFQDN = $dependency->token->toString(); $path = explode('\\', $dependencyFQDN); $value = $FQDNIndex->getNestedNode($path); if (null === $value) { - return true; + return \true; } - return $value->isFQDN(); } } diff --git a/src/Core/Dependency/InheritDependency.php b/src/Core/Dependency/InheritDependency.php index c21a183bf..9451c64d0 100644 --- a/src/Core/Dependency/InheritDependency.php +++ b/src/Core/Dependency/InheritDependency.php @@ -1,7 +1,6 @@ inheritPath->getPath() as $p) { - array_unshift($buffer, ['name' => $p->classLikeName->toString(), 'line' => $p->fileOccurrence->line]); + \array_unshift($buffer, ['name' => $p->classLikeName->toString(), 'line' => $p->fileOccurrence->line]); } - $buffer[] = ['name' => $this->inheritPath->classLikeName->toString(), 'line' => $this->inheritPath->fileOccurrence->line]; $buffer[] = ['name' => $this->originalDependency->getDependent()->toString(), 'line' => $this->originalDependency->getFileOccurrence()->line]; - return $buffer; } - - public function getDepender(): ClassLikeToken + public function getDepender() : ClassLikeToken { return $this->depender; } - - public function getFileOccurrence(): FileOccurrence + public function getFileOccurrence() : FileOccurrence { return $this->originalDependency->getFileOccurrence(); } - - public function getDependent(): TokenInterface + public function getDependent() : TokenInterface { return $this->dependent; } - - public function getType(): DependencyType + public function getType() : DependencyType { return $this->originalDependency->getType(); } diff --git a/src/Core/Dependency/InheritanceFlattener.php b/src/Core/Dependency/InheritanceFlattener.php index e2900d135..5bb256d25 100644 --- a/src/Core/Dependency/InheritanceFlattener.php +++ b/src/Core/Dependency/InheritanceFlattener.php @@ -1,24 +1,18 @@ getClassLikeReferences() as $classReference) { $classLikeName = $classReference->getToken(); foreach ($astMap->getClassInherits($classLikeName) as $inherit) { foreach ($dependencyList->getDependenciesByClass($inherit->classLikeName) as $dep) { - $dependencyList->addInheritDependency( - new InheritDependency( - $classLikeName, $dep->getDependent(), $dep, $inherit - ) - ); + $dependencyList->addInheritDependency(new \Qossmic\Deptrac\Core\Dependency\InheritDependency($classLikeName, $dep->getDependent(), $dep, $inherit)); } } } diff --git a/src/Core/Dependency/InvalidEmitterConfigurationException.php b/src/Core/Dependency/InvalidEmitterConfigurationException.php index ae8816dec..c81c2db68 100755 --- a/src/Core/Dependency/InvalidEmitterConfigurationException.php +++ b/src/Core/Dependency/InvalidEmitterConfigurationException.php @@ -1,29 +1,20 @@ $astMap->getClassReferenceForToken($token) ?? new ClassLikeReference($token), $token instanceof FunctionToken => $astMap->getFunctionReferenceForToken($token) ?? new FunctionReference($token), $token instanceof SuperGlobalToken => new VariableReference($token), $token instanceof FileToken => $astMap->getFileReferenceForToken($token) ?? new FileReference($token->path, [], [], []), - default => throw UnrecognizedTokenException::cannotCreateReference($token) + default => throw \Qossmic\Deptrac\Core\Dependency\UnrecognizedTokenException::cannotCreateReference($token), }; } } diff --git a/src/Core/Dependency/UnrecognizedTokenException.php b/src/Core/Dependency/UnrecognizedTokenException.php index c655d1026..28a02fa6a 100644 --- a/src/Core/Dependency/UnrecognizedTokenException.php +++ b/src/Core/Dependency/UnrecognizedTokenException.php @@ -1,17 +1,15 @@ paths[] = Path::canonicalize($path->getPathname()); } } - - public function collect(): array + public function collect() : array { try { if ([] === $this->paths) { throw new LogicException("No 'paths' defined in the depfile."); } - - $finder = (new Finder()) - ->in($this->paths) - ->name('*.php') - ->files() - ->followLinks() - ->ignoreUnreadableDirs() - ->ignoreVCS(true) - ->notPath($this->excludedFilePatterns); - + $finder = (new Finder())->in($this->paths)->name('*.php')->files()->followLinks()->ignoreUnreadableDirs()->ignoreVCS(\true)->notPath($this->excludedFilePatterns); $customFilterIterator = $finder->getIterator(); } catch (LogicException|DirectoryNotFoundException $exception) { - throw InputException::couldNotCollectFiles($exception); + throw \Qossmic\Deptrac\Core\InputCollector\InputException::couldNotCollectFiles($exception); } - - $finder = new PathNameFilterIterator($customFilterIterator, [], $this->excludedFilePatterns); - - return array_values(array_map( - static fn (SplFileInfo $fileInfo) => (string) $fileInfo->getRealPath(), - iterator_to_array($finder) - )); + $finder = new \Qossmic\Deptrac\Core\InputCollector\PathNameFilterIterator($customFilterIterator, [], $this->excludedFilePatterns); + return \array_values(\array_map(static fn(SplFileInfo $fileInfo) => (string) $fileInfo->getRealPath(), \iterator_to_array($finder))); } } diff --git a/src/Core/InputCollector/InputCollectorInterface.php b/src/Core/InputCollector/InputCollectorInterface.php index 8e506821f..3bf9ae2c8 100644 --- a/src/Core/InputCollector/InputCollectorInterface.php +++ b/src/Core/InputCollector/InputCollectorInterface.php @@ -1,7 +1,6 @@ current(); $filename = $this->isWindows() ? Path::normalize($fileInfo->getPathname()) : $fileInfo->getPathName(); - return $this->isAccepted($filename); } - - private function isWindows(): bool + private function isWindows() : bool { return '\\' === DIRECTORY_SEPARATOR; } diff --git a/src/Core/Layer/Collector/AbstractTypeCollector.php b/src/Core/Layer/Collector/AbstractTypeCollector.php index 3caaeec5e..eceefed55 100644 --- a/src/Core/Layer/Collector/AbstractTypeCollector.php +++ b/src/Core/Layer/Collector/AbstractTypeCollector.php @@ -1,38 +1,30 @@ getType(); $isSameType = $reference->type === $this->getType(); - return ($isClassLike || $isSameType) && $reference->getToken()->match($this->getValidatedPattern($config)); } - - protected function getPattern(array $config): string + protected function getPattern(array $config) : string { if (!isset($config['value']) || !is_string($config['value'])) { - throw InvalidCollectorDefinitionException::invalidCollectorConfiguration(sprintf('Collector "%s" needs the regex configuration.', $this->getType()->toString())); + throw InvalidCollectorDefinitionException::invalidCollectorConfiguration(\sprintf('Collector "%s" needs the regex configuration.', $this->getType()->toString())); } - - return '/'.$config['value'].'/i'; + return '/' . $config['value'] . '/i'; } } diff --git a/src/Core/Layer/Collector/AttributeCollector.php b/src/Core/Layer/Collector/AttributeCollector.php index 698bce65c..20b44780f 100644 --- a/src/Core/Layer/Collector/AttributeCollector.php +++ b/src/Core/Layer/Collector/AttributeCollector.php @@ -1,7 +1,6 @@ getSearchedSubstring($config); - foreach ($reference->dependencies as $dependency) { if (DependencyType::ATTRIBUTE !== $dependency->type) { continue; } - $usedAttribute = $dependency->token->toString(); - if (str_contains($usedAttribute, $match)) { - return true; + return \true; } } - - return false; + return \false; } - /** * @param array> $config * * @throws InvalidCollectorDefinitionException */ - private function getSearchedSubstring(array $config): string + private function getSearchedSubstring(array $config) : string { - if (!isset($config['value']) || !is_string($config['value'])) { + if (!isset($config['value']) || !\is_string($config['value'])) { throw InvalidCollectorDefinitionException::invalidCollectorConfiguration('AttributeCollector needs the attribute name as a string.'); } - return $config['value']; } } diff --git a/src/Core/Layer/Collector/BoolCollector.php b/src/Core/Layer/Collector/BoolCollector.php index cc72838f3..6489641bb 100644 --- a/src/Core/Layer/Collector/BoolCollector.php +++ b/src/Core/Layer/Collector/BoolCollector.php @@ -1,74 +1,57 @@ normalizeConfiguration($config); - /** @var array{type: string, args: array} $v */ foreach ((array) $configuration['must'] as $v) { $collectable = $this->collectorResolver->resolve($v); - $satisfied = $collectable->collector->satisfy($collectable->attributes, $reference); if (!$satisfied) { - return false; + return \false; } } - /** @var array{type: string, args: array} $v */ foreach ((array) $configuration['must_not'] as $v) { $collectable = $this->collectorResolver->resolve($v); - $satisfied = $collectable->collector->satisfy($collectable->attributes, $reference); if ($satisfied) { - return false; + return \false; } } - - return true; + return \true; } - - public function resolvable(array $config): bool + public function resolvable(array $config) : bool { $configuration = $this->normalizeConfiguration($config); - /** @var array{type: string, args: array} $v */ foreach ((array) $configuration['must'] as $v) { $collectable = $this->collectorResolver->resolve($v); $collector = $collectable->collector; - - if ($collector instanceof ConditionalCollectorInterface - && !$collector->resolvable($collectable->attributes) - ) { - return false; + if ($collector instanceof \Qossmic\Deptrac\Core\Layer\Collector\ConditionalCollectorInterface && !$collector->resolvable($collectable->attributes)) { + return \false; } } - /** @var array{type: string, args: array} $v */ foreach ((array) $configuration['must_not'] as $v) { $collectable = $this->collectorResolver->resolve($v); $collector = $collectable->collector; - - if ($collector instanceof ConditionalCollectorInterface - && !$collector->resolvable($collectable->attributes) - ) { - return false; + if ($collector instanceof \Qossmic\Deptrac\Core\Layer\Collector\ConditionalCollectorInterface && !$collector->resolvable($collectable->attributes)) { + return \false; } } - - return true; + return \true; } - /** * @param array> $configuration * @@ -76,20 +59,17 @@ public function resolvable(array $config): bool * * @throws InvalidCollectorDefinitionException */ - private function normalizeConfiguration(array $configuration): array + private function normalizeConfiguration(array $configuration) : array { if (!isset($configuration['must'])) { $configuration['must'] = []; } - if (!isset($configuration['must_not'])) { $configuration['must_not'] = []; } - if (!$configuration['must'] && !$configuration['must_not']) { throw InvalidCollectorDefinitionException::invalidCollectorConfiguration('"bool" collector must have a "must" or a "must_not" attribute.'); } - return $configuration; } } diff --git a/src/Core/Layer/Collector/ClassCollector.php b/src/Core/Layer/Collector/ClassCollector.php index 42d0da859..6a8244cdd 100644 --- a/src/Core/Layer/Collector/ClassCollector.php +++ b/src/Core/Layer/Collector/ClassCollector.php @@ -1,14 +1,12 @@ getToken()->match($this->getValidatedPattern($config)); } - - protected function getPattern(array $config): string + protected function getPattern(array $config) : string { - if (!isset($config['value']) || !is_string($config['value'])) { + if (!isset($config['value']) || !\is_string($config['value'])) { throw InvalidCollectorDefinitionException::invalidCollectorConfiguration('ClassNameRegexCollector needs the regex configuration.'); } - return $config['value']; } } diff --git a/src/Core/Layer/Collector/Collectable.php b/src/Core/Layer/Collector/Collectable.php index 7968e19d8..3bcfee029 100644 --- a/src/Core/Layer/Collector/Collectable.php +++ b/src/Core/Layer/Collector/Collectable.php @@ -1,11 +1,9 @@ > $attributes */ - public function __construct( - public readonly CollectorInterface $collector, - public readonly array $attributes - ) {} + public function __construct(public readonly CollectorInterface $collector, public readonly array $attributes) + { + } } diff --git a/src/Core/Layer/Collector/CollectorProvider.php b/src/Core/Layer/Collector/CollectorProvider.php index 8077632d8..aca0b7385 100644 --- a/src/Core/Layer/Collector/CollectorProvider.php +++ b/src/Core/Layer/Collector/CollectorProvider.php @@ -1,48 +1,40 @@ $collectorLocator */ - public function __construct( - private readonly ServiceLocator $collectorLocator - ) {} - - public function get(string $id): CollectorInterface + public function __construct(private readonly ServiceLocator $collectorLocator) + { + } + public function get(string $id) : CollectorInterface { $collector = $this->collectorLocator->get($id); - if (!$collector instanceof CollectorInterface) { $exception = InvalidCollectorDefinitionException::unsupportedClass($id, $collector); - throw new \Symfony\Component\DependencyInjection\Exception\RuntimeException($exception->getMessage(), 0, $exception); + throw new \DEPTRAC_202401\Symfony\Component\DependencyInjection\Exception\RuntimeException($exception->getMessage(), 0, $exception); } - return $collector; } - - public function has(string $id): bool + public function has(string $id) : bool { return $this->collectorLocator->has($id); } - /** * @psalm-suppress MixedReturnTypeCoercion * * @return string[] */ - public function getKnownCollectors(): array + public function getKnownCollectors() : array { return array_keys($this->collectorLocator->getProvidedServices()); } diff --git a/src/Core/Layer/Collector/CollectorResolver.php b/src/Core/Layer/Collector/CollectorResolver.php index 548511bee..9b17b1b95 100644 --- a/src/Core/Layer/Collector/CollectorResolver.php +++ b/src/Core/Layer/Collector/CollectorResolver.php @@ -1,36 +1,32 @@ > $config * * @throws InvalidCollectorDefinitionException */ - public function resolve(array $config): Collectable + public function resolve(array $config) : \Qossmic\Deptrac\Core\Layer\Collector\Collectable { if (!array_key_exists('type', $config) || !is_string($config['type'])) { throw InvalidCollectorDefinitionException::missingType(); } - try { $collector = $this->collectorProvider->get($config['type']); } catch (ContainerExceptionInterface $containerException) { throw InvalidCollectorDefinitionException::unsupportedType($config['type'], $this->collectorProvider->getKnownCollectors(), $containerException); } - - return new Collectable($collector, $config); + return new \Qossmic\Deptrac\Core\Layer\Collector\Collectable($collector, $config); } } diff --git a/src/Core/Layer/Collector/CollectorResolverInterface.php b/src/Core/Layer/Collector/CollectorResolverInterface.php index b014282ad..d4fb20dfe 100644 --- a/src/Core/Layer/Collector/CollectorResolverInterface.php +++ b/src/Core/Layer/Collector/CollectorResolverInterface.php @@ -1,7 +1,6 @@ > $config */ - public function resolve(array $config): Collectable; + public function resolve(array $config) : \Qossmic\Deptrac\Core\Layer\Collector\Collectable; } diff --git a/src/Core/Layer/Collector/ComposerCollector.php b/src/Core/Layer/Collector/ComposerCollector.php index 78d603dc1..f3cbfd81f 100644 --- a/src/Core/Layer/Collector/ComposerCollector.php +++ b/src/Core/Layer/Collector/ComposerCollector.php @@ -1,7 +1,6 @@ */ private array $parser = []; - - public function satisfy(array $config, TokenReferenceInterface $reference): bool + public function satisfy(array $config, TokenReferenceInterface $reference) : bool { - if (!isset($config['composerPath']) || !is_string($config['composerPath'])) { + if (!isset($config['composerPath']) || !\is_string($config['composerPath'])) { throw InvalidCollectorDefinitionException::invalidCollectorConfiguration('ComposerCollector needs the path to the composer.json file as string.'); } - - if (!isset($config['composerLockPath']) || !is_string($config['composerLockPath'])) { + if (!isset($config['composerLockPath']) || !\is_string($config['composerLockPath'])) { throw InvalidCollectorDefinitionException::invalidCollectorConfiguration('ComposerCollector needs the path to the composer.lock file as string.'); } - - if (!isset($config['packages']) || !is_array($config['packages'])) { + if (!isset($config['packages']) || !\is_array($config['packages'])) { throw InvalidCollectorDefinitionException::invalidCollectorConfiguration('ComposerCollector needs the list of packages as string.'); } - try { - $this->parser[$config['composerLockPath']] ??= new ComposerFilesParser($config['composerLockPath']); + $this->parser[$config['composerLockPath']] ??= new \Qossmic\Deptrac\Core\Layer\Collector\ComposerFilesParser($config['composerLockPath']); $parser = $this->parser[$config['composerLockPath']]; } catch (RuntimeException $exception) { throw new CouldNotParseFileException('Could not parse composer files.', 0, $exception); } - try { - $namespaces = $parser->autoloadableNamespacesForRequirements($config['packages'], true); + $namespaces = $parser->autoloadableNamespacesForRequirements($config['packages'], \true); } catch (RuntimeException $e) { - throw InvalidCollectorDefinitionException::invalidCollectorConfiguration(sprintf('ComposerCollector has a non-existent package defined. %s', $e->getMessage())); + throw InvalidCollectorDefinitionException::invalidCollectorConfiguration(\sprintf('ComposerCollector has a non-existent package defined. %s', $e->getMessage())); } - $token = $reference->getToken()->toString(); - foreach ($namespaces as $namespace) { - if (str_starts_with($token, $namespace)) { - return true; + if (\str_starts_with($token, $namespace)) { + return \true; } } - - return false; + return \false; } } diff --git a/src/Core/Layer/Collector/ComposerFilesParser.php b/src/Core/Layer/Collector/ComposerFilesParser.php index e78a54b4e..7f6ebab7d 100644 --- a/src/Core/Layer/Collector/ComposerFilesParser.php +++ b/src/Core/Layer/Collector/ComposerFilesParser.php @@ -1,12 +1,10 @@ , 'psr-4'?: array}, @@ -32,14 +29,13 @@ class ComposerFilesParser * }> */ private array $lockedPackages; - /** * @throws RuntimeException */ public function __construct(string $lockFile) { - $contents = file_get_contents($lockFile); - if (false === $contents) { + $contents = \file_get_contents($lockFile); + if (\false === $contents) { throw new RuntimeException('Could not load composer.lock file'); } try { @@ -57,14 +53,13 @@ public function __construct(string $lockFile) * }>, * } $jsonDecode */ - $jsonDecode = json_decode($contents, true, 512, JSON_THROW_ON_ERROR); + $jsonDecode = \json_decode($contents, \true, 512, \JSON_THROW_ON_ERROR); $this->lockFile = $jsonDecode; } catch (JsonException $exception) { throw new RuntimeException('Could not parse composer.lock file', 0, $exception); } $this->lockedPackages = $this->getPackagesFromLockFile(); } - /** * Resolves an array of package names to an array of namespaces declared by those packages. * @@ -74,42 +69,34 @@ public function __construct(string $lockFile) * * @throws RuntimeException */ - public function autoloadableNamespacesForRequirements(array $requirements, bool $includeDev): array + public function autoloadableNamespacesForRequirements(array $requirements, bool $includeDev) : array { $namespaces = [[]]; - foreach ($requirements as $package) { - if (!array_key_exists($package, $this->lockedPackages)) { - throw new RuntimeException(sprintf('Could not find a "%s" package', $package)); + if (!\array_key_exists($package, $this->lockedPackages)) { + throw new RuntimeException(\sprintf('Could not find a "%s" package', $package)); } - $namespaces[] = $this->extractNamespaces($this->lockedPackages[$package], $includeDev); } - - return array_merge(...$namespaces); + return \array_merge(...$namespaces); } - /** * @return array, 'psr-4'?: array}, * autoload-dev?: array{'psr-0'?: array, 'psr-4'?: array}, * }> */ - private function getPackagesFromLockFile(): array + private function getPackagesFromLockFile() : array { $lockedPackages = []; - foreach ($this->lockFile['packages'] ?? [] as $package) { $lockedPackages[$package['name']] = $package; } - foreach ($this->lockFile['packages-dev'] ?? [] as $package) { $lockedPackages[$package['name']] = $package; } - return $lockedPackages; } - /** * @param array{ * autoload?: array{'psr-0'?: array, 'psr-4'?: array}, @@ -118,25 +105,23 @@ private function getPackagesFromLockFile(): array * * @return string[] */ - private function extractNamespaces(array $package, bool $includeDev): array + private function extractNamespaces(array $package, bool $includeDev) : array { $namespaces = []; - foreach (array_keys($package['autoload']['psr-0'] ?? []) as $namespace) { + foreach (\array_keys($package['autoload']['psr-0'] ?? []) as $namespace) { $namespaces[] = $namespace; } - foreach (array_keys($package['autoload']['psr-4'] ?? []) as $namespace) { + foreach (\array_keys($package['autoload']['psr-4'] ?? []) as $namespace) { $namespaces[] = $namespace; } - if ($includeDev) { - foreach (array_keys($package['autoload-dev']['psr-0'] ?? []) as $namespace) { + foreach (\array_keys($package['autoload-dev']['psr-0'] ?? []) as $namespace) { $namespaces[] = $namespace; } - foreach (array_keys($package['autoload-dev']['psr-4'] ?? []) as $namespace) { + foreach (\array_keys($package['autoload-dev']['psr-4'] ?? []) as $namespace) { $namespaces[] = $namespace; } } - return $namespaces; } } diff --git a/src/Core/Layer/Collector/ConditionalCollectorInterface.php b/src/Core/Layer/Collector/ConditionalCollectorInterface.php index bf6c24285..f372800c7 100644 --- a/src/Core/Layer/Collector/ConditionalCollectorInterface.php +++ b/src/Core/Layer/Collector/ConditionalCollectorInterface.php @@ -1,11 +1,9 @@ getFilepath(); - if (null === $filepath) { - return false; + return \false; } - $validatedPattern = $this->getValidatedPattern($config); $normalizedPath = Path::normalize($filepath); - - return 1 === preg_match($validatedPattern, $normalizedPath); + return 1 === \preg_match($validatedPattern, $normalizedPath); } - - protected function getPattern(array $config): string + protected function getPattern(array $config) : string { - if (!isset($config['value']) || !is_string($config['value'])) { + if (!isset($config['value']) || !\is_string($config['value'])) { throw InvalidCollectorDefinitionException::invalidCollectorConfiguration('DirectoryCollector needs the regex configuration.'); } - - return '#'.$config['value'].'#i'; + return '#' . $config['value'] . '#i'; } } diff --git a/src/Core/Layer/Collector/ExtendsCollector.php b/src/Core/Layer/Collector/ExtendsCollector.php index 327c833bc..6929a9a04 100644 --- a/src/Core/Layer/Collector/ExtendsCollector.php +++ b/src/Core/Layer/Collector/ExtendsCollector.php @@ -1,7 +1,6 @@ astMap = $astMapExtractor->extract(); } - - public function satisfy(array $config, TokenReferenceInterface $reference): bool + public function satisfy(array $config, TokenReferenceInterface $reference) : bool { if (!$reference instanceof ClassLikeReference) { - return false; + return \false; } - $interfaceName = $this->getInterfaceName($config); - foreach ($this->astMap->getClassInherits($reference->getToken()) as $inherit) { if (AstInheritType::EXTENDS === $inherit->type && $inherit->classLikeName->equals($interfaceName)) { - return true; + return \true; } } - - return false; + return \false; } - /** * @param array> $config * * @throws InvalidCollectorDefinitionException */ - private function getInterfaceName(array $config): ClassLikeToken + private function getInterfaceName(array $config) : ClassLikeToken { - if (!isset($config['value']) || !is_string($config['value'])) { + if (!isset($config['value']) || !\is_string($config['value'])) { throw InvalidCollectorDefinitionException::invalidCollectorConfiguration('ExtendsCollector needs the interface or class name as a string.'); } - return ClassLikeToken::fromFQCN($config['value']); } } diff --git a/src/Core/Layer/Collector/FunctionNameCollector.php b/src/Core/Layer/Collector/FunctionNameCollector.php index bf7439276..226f62aec 100644 --- a/src/Core/Layer/Collector/FunctionNameCollector.php +++ b/src/Core/Layer/Collector/FunctionNameCollector.php @@ -1,7 +1,6 @@ getToken(); - return $tokenName->match($this->getPattern($config)); } - /** * @param array> $config * * @throws InvalidCollectorDefinitionException */ - private function getPattern(array $config): string + private function getPattern(array $config) : string { - if (!isset($config['value']) || !is_string($config['value'])) { + if (!isset($config['value']) || !\is_string($config['value'])) { throw InvalidCollectorDefinitionException::invalidCollectorConfiguration('FunctionNameCollector needs the regex configuration.'); } - - return '/'.$config['value'].'/i'; + return '/' . $config['value'] . '/i'; } } diff --git a/src/Core/Layer/Collector/GlobCollector.php b/src/Core/Layer/Collector/GlobCollector.php index 2cd58ccca..5ab0d541e 100644 --- a/src/Core/Layer/Collector/GlobCollector.php +++ b/src/Core/Layer/Collector/GlobCollector.php @@ -1,45 +1,36 @@ basePath = Path::normalize($basePath); } - - public function satisfy(array $config, TokenReferenceInterface $reference): bool + public function satisfy(array $config, TokenReferenceInterface $reference) : bool { $filepath = $reference->getFilepath(); - if (null === $filepath) { - return false; + return \false; } - $validatedPattern = $this->getValidatedPattern($config); $normalizedPath = Path::normalize($filepath); /** @throws void */ $relativeFilePath = Path::makeRelative($normalizedPath, $this->basePath); - - return 1 === preg_match($validatedPattern, $relativeFilePath); + return 1 === \preg_match($validatedPattern, $relativeFilePath); } - - protected function getPattern(array $config): string + protected function getPattern(array $config) : string { - if (!isset($config['value']) || !is_string($config['value'])) { + if (!isset($config['value']) || !\is_string($config['value'])) { throw InvalidCollectorDefinitionException::invalidCollectorConfiguration('GlobCollector needs the glob pattern configuration.'); } - return Glob::toRegex($config['value']); } } diff --git a/src/Core/Layer/Collector/ImplementsCollector.php b/src/Core/Layer/Collector/ImplementsCollector.php index a19bed7ee..52811d0c7 100644 --- a/src/Core/Layer/Collector/ImplementsCollector.php +++ b/src/Core/Layer/Collector/ImplementsCollector.php @@ -1,7 +1,6 @@ astMap = $this->astMapExtractor->extract(); } - - public function satisfy(array $config, TokenReferenceInterface $reference): bool + public function satisfy(array $config, TokenReferenceInterface $reference) : bool { if (!$reference instanceof ClassLikeReference) { - return false; + return \false; } - $interfaceName = $this->getInterfaceName($config); - foreach ($this->astMap->getClassInherits($reference->getToken()) as $inherit) { if (AstInheritType::IMPLEMENTS === $inherit->type && $inherit->classLikeName->equals($interfaceName)) { - return true; + return \true; } } - - return false; + return \false; } - /** * @param array> $config * * @throws InvalidCollectorDefinitionException */ - private function getInterfaceName(array $config): ClassLikeToken + private function getInterfaceName(array $config) : ClassLikeToken { - if (!isset($config['value']) || !is_string($config['value'])) { + if (!isset($config['value']) || !\is_string($config['value'])) { throw InvalidCollectorDefinitionException::invalidCollectorConfiguration('ImplementsCollector needs the interface name as a string.'); } - return ClassLikeToken::fromFQCN($config['value']); } } diff --git a/src/Core/Layer/Collector/InheritanceLevelCollector.php b/src/Core/Layer/Collector/InheritanceLevelCollector.php index d8c6dc645..d595815de 100644 --- a/src/Core/Layer/Collector/InheritanceLevelCollector.php +++ b/src/Core/Layer/Collector/InheritanceLevelCollector.php @@ -1,7 +1,6 @@ astMap = $this->astMapExtractor->extract(); } - - public function satisfy(array $config, TokenReferenceInterface $reference): bool + public function satisfy(array $config, TokenReferenceInterface $reference) : bool { if (!$reference instanceof ClassLikeReference) { - return false; + return \false; } - $classInherits = $this->astMap->getClassInherits($reference->getToken()); - if (!isset($config['value']) || !is_numeric($config['value'])) { + if (!isset($config['value']) || !\is_numeric($config['value'])) { throw InvalidCollectorDefinitionException::invalidCollectorConfiguration('InheritanceLevelCollector needs inheritance depth as int.'); } - $depth = (int) $config['value']; foreach ($classInherits as $classInherit) { - if (count($classInherit->getPath()) >= $depth) { - return true; + if (\count($classInherit->getPath()) >= $depth) { + return \true; } } - - return false; + return \false; } } diff --git a/src/Core/Layer/Collector/InheritsCollector.php b/src/Core/Layer/Collector/InheritsCollector.php index f391c0d80..4c26416ec 100644 --- a/src/Core/Layer/Collector/InheritsCollector.php +++ b/src/Core/Layer/Collector/InheritsCollector.php @@ -1,7 +1,6 @@ astMap = $this->astMapExtractor->extract(); } - - public function satisfy(array $config, TokenReferenceInterface $reference): bool + public function satisfy(array $config, TokenReferenceInterface $reference) : bool { if (!$reference instanceof ClassLikeReference) { - return false; + return \false; } - $classLikeName = $this->getClassLikeName($config); - foreach ($this->astMap->getClassInherits($reference->getToken()) as $inherit) { if ($inherit->classLikeName->equals($classLikeName)) { - return true; + return \true; } } - - return false; + return \false; } - /** * @param array> $config * * @throws InvalidCollectorDefinitionException */ - private function getClassLikeName(array $config): ClassLikeToken + private function getClassLikeName(array $config) : ClassLikeToken { - if (!isset($config['value']) || !is_string($config['value'])) { + if (!isset($config['value']) || !\is_string($config['value'])) { throw InvalidCollectorDefinitionException::invalidCollectorConfiguration('InheritsCollector needs the interface, trait or class name as a string.'); } - return ClassLikeToken::fromFQCN($config['value']); } } diff --git a/src/Core/Layer/Collector/InterfaceCollector.php b/src/Core/Layer/Collector/InterfaceCollector.php index 7bb9f0d70..8033774b4 100644 --- a/src/Core/Layer/Collector/InterfaceCollector.php +++ b/src/Core/Layer/Collector/InterfaceCollector.php @@ -1,14 +1,12 @@ > */ private array $resolved = []; - - public function __construct(private readonly LayerResolverInterface $resolver) {} - - public function satisfy(array $config, TokenReferenceInterface $reference): bool + public function __construct(private readonly LayerResolverInterface $resolver) + { + } + public function satisfy(array $config, TokenReferenceInterface $reference) : bool { if (!isset($config['value']) || !is_string($config['value'])) { throw InvalidCollectorDefinitionException::invalidCollectorConfiguration('LayerCollector needs the layer configuration.'); } $layer = $config['value']; - if (!$this->resolver->has($layer)) { throw InvalidCollectorDefinitionException::invalidCollectorConfiguration(sprintf('Unknown layer "%s" specified in collector.', $config['value'])); } $token = $reference->getToken()->toString(); - if (array_key_exists($token, $this->resolved) && array_key_exists($layer, $this->resolved[$token])) { if (null === $this->resolved[$token][$layer]) { throw InvalidLayerDefinitionException::circularTokenReference($token); } - return $this->resolved[$token][$layer]; } - // Set resolved for current token to null in case resolver comes back to it (circular reference) $this->resolved[$token][$layer] = null; - return $this->resolved[$token][$layer] = $this->resolver->isReferenceInLayer($config['value'], $reference); } - - public function resolvable(array $config): bool + public function resolvable(array $config) : bool { /** @var array{layer?: string, value: string} $config */ return $this->resolver->has($config['value']); diff --git a/src/Core/Layer/Collector/MethodCollector.php b/src/Core/Layer/Collector/MethodCollector.php index 492f818a3..393ef78e3 100644 --- a/src/Core/Layer/Collector/MethodCollector.php +++ b/src/Core/Layer/Collector/MethodCollector.php @@ -1,47 +1,39 @@ getValidatedPattern($config); - $classLike = $this->astParser->getNodeForClassLikeReference($reference); - if (null === $classLike) { - return false; + return \false; } - foreach ($classLike->getMethods() as $classMethod) { - if (1 === preg_match($pattern, (string) $classMethod->name)) { - return true; + if (1 === \preg_match($pattern, (string) $classMethod->name)) { + return \true; } } - - return false; + return \false; } - - protected function getPattern(array $config): string + protected function getPattern(array $config) : string { - if (!isset($config['value']) || !is_string($config['value'])) { + if (!isset($config['value']) || !\is_string($config['value'])) { throw InvalidCollectorDefinitionException::invalidCollectorConfiguration('MethodCollector needs the name configuration.'); } - - return '/'.$config['value'].'/i'; + return '/' . $config['value'] . '/i'; } } diff --git a/src/Core/Layer/Collector/PhpInternalCollector.php b/src/Core/Layer/Collector/PhpInternalCollector.php index 38b77ce49..0f4694068 100644 --- a/src/Core/Layer/Collector/PhpInternalCollector.php +++ b/src/Core/Layer/Collector/PhpInternalCollector.php @@ -1,10 +1,9 @@ getToken(); - - return $token->match($this->getPattern($config)) && array_key_exists( - $token->toString(), PhpStormStubsMap::CLASSES); + return $token->match($this->getPattern($config)) && \array_key_exists($token->toString(), PhpStormStubsMap::CLASSES); } - if ($reference instanceof FunctionReference) { $token = $reference->getToken(); - assert($token instanceof FunctionToken); - - return $token->match($this->getPattern($config)) && array_key_exists( - $token->functionName, PhpStormStubsMap::FUNCTIONS); + \assert($token instanceof FunctionToken); + return $token->match($this->getPattern($config)) && \array_key_exists($token->functionName, PhpStormStubsMap::FUNCTIONS); } - // future-proof catch all - return false; + return \false; } - /** * @param array> $config * * @throws InvalidCollectorDefinitionException */ - private function getPattern(array $config): string + private function getPattern(array $config) : string { - if (!isset($config['value']) || !is_string($config['value'])) { + if (!isset($config['value']) || !\is_string($config['value'])) { throw InvalidCollectorDefinitionException::invalidCollectorConfiguration('PhpInternalCollector needs configuration.'); } - - return '/'.$config['value'].'/i'; + return '/' . $config['value'] . '/i'; } } diff --git a/src/Core/Layer/Collector/RegexCollector.php b/src/Core/Layer/Collector/RegexCollector.php index 2d1bd45c5..e5aa68ce8 100644 --- a/src/Core/Layer/Collector/RegexCollector.php +++ b/src/Core/Layer/Collector/RegexCollector.php @@ -1,12 +1,10 @@ > $config * * @throws InvalidCollectorDefinitionException */ - protected function getValidatedPattern(array $config): string + protected function getValidatedPattern(array $config) : string { $pattern = $this->getPattern($config); - if (false !== @preg_match($pattern, '')) { + if (\false !== @\preg_match($pattern, '')) { return $pattern; } - throw InvalidCollectorDefinitionException::invalidCollectorConfiguration('Invalid regex pattern '.$pattern); + throw InvalidCollectorDefinitionException::invalidCollectorConfiguration('Invalid regex pattern ' . $pattern); } } diff --git a/src/Core/Layer/Collector/SuperglobalCollector.php b/src/Core/Layer/Collector/SuperglobalCollector.php index 9d94ff132..c4655eca7 100644 --- a/src/Core/Layer/Collector/SuperglobalCollector.php +++ b/src/Core/Layer/Collector/SuperglobalCollector.php @@ -1,25 +1,21 @@ getToken()->toString(), $this->getNames($config), true); + return \in_array($reference->getToken()->toString(), $this->getNames($config), \true); } - /** * @param array> $config * @@ -27,12 +23,11 @@ public function satisfy(array $config, TokenReferenceInterface $reference): bool * * @throws InvalidCollectorDefinitionException */ - private function getNames(array $config): array + private function getNames(array $config) : array { - if (!isset($config['value']) || !is_array($config['value'])) { + if (!isset($config['value']) || !\is_array($config['value'])) { throw InvalidCollectorDefinitionException::invalidCollectorConfiguration('SuperglobalCollector needs the names configuration.'); } - - return array_map(static fn ($name): string => '$'.$name, $config['value']); + return \array_map(static fn($name): string => '$' . $name, $config['value']); } } diff --git a/src/Core/Layer/Collector/TraitCollector.php b/src/Core/Layer/Collector/TraitCollector.php index f62feeec0..da4d075ec 100644 --- a/src/Core/Layer/Collector/TraitCollector.php +++ b/src/Core/Layer/Collector/TraitCollector.php @@ -1,14 +1,12 @@ astMap = $this->astMapExtractor->extract(); } - - public function satisfy(array $config, TokenReferenceInterface $reference): bool + public function satisfy(array $config, TokenReferenceInterface $reference) : bool { if (!$reference instanceof ClassLikeReference) { - return false; + return \false; } - $traitName = $this->getTraitName($config); - foreach ($this->astMap->getClassInherits($reference->getToken()) as $inherit) { if (AstInheritType::USES === $inherit->type && $inherit->classLikeName->equals($traitName)) { - return true; + return \true; } } - - return false; + return \false; } - /** * @param array> $config * * @throws InvalidCollectorDefinitionException */ - private function getTraitName(array $config): ClassLikeToken + private function getTraitName(array $config) : ClassLikeToken { - if (!isset($config['value']) || !is_string($config['value'])) { + if (!isset($config['value']) || !\is_string($config['value'])) { throw InvalidCollectorDefinitionException::invalidCollectorConfiguration('UsesCollector needs the trait name as a string.'); } - return ClassLikeToken::fromFQCN($config['value']); } } diff --git a/src/Core/Layer/LayerResolver.php b/src/Core/Layer/LayerResolver.php index a01654d6b..e84d5111c 100644 --- a/src/Core/Layer/LayerResolver.php +++ b/src/Core/Layer/LayerResolver.php @@ -1,7 +1,6 @@ */ private array $layers; - /** * @var array> */ private array $resolved = []; - /** * @param array>>}> $layers * @@ -33,95 +28,75 @@ public function __construct(private readonly CollectorResolverInterface $collect { $this->initializeLayers($layers); } - - public function getLayersForReference(TokenReferenceInterface $reference): array + public function getLayersForReference(TokenReferenceInterface $reference) : array { $tokenName = $reference->getToken()->toString(); if (array_key_exists($tokenName, $this->resolved)) { return $this->resolved[$tokenName]; } - $this->resolved[$tokenName] = []; - foreach ($this->layers as $layer => $collectables) { foreach ($collectables as $collectable) { $collector = $collectable->collector; $attributes = $collectable->attributes; - if ($collector instanceof ConditionalCollectorInterface - && !$collector->resolvable($attributes) - ) { + if ($collector instanceof ConditionalCollectorInterface && !$collector->resolvable($attributes)) { continue; } - if ($collectable->collector->satisfy($attributes, $reference)) { if (array_key_exists($layer, $this->resolved[$tokenName]) && $this->resolved[$tokenName][$layer]) { continue; } - if (array_key_exists('private', $attributes) && true === $attributes['private']) { - $this->resolved[$tokenName][$layer] = false; + if (array_key_exists('private', $attributes) && \true === $attributes['private']) { + $this->resolved[$tokenName][$layer] = \false; } else { - $this->resolved[$tokenName][$layer] = true; + $this->resolved[$tokenName][$layer] = \true; } } } } - return $this->resolved[$tokenName]; } - - public function isReferenceInLayer(string $layer, TokenReferenceInterface $reference): bool + public function isReferenceInLayer(string $layer, TokenReferenceInterface $reference) : bool { $tokenName = $reference->getToken()->toString(); if (array_key_exists($tokenName, $this->resolved) && [] !== $this->resolved[$tokenName]) { return array_key_exists($layer, $this->resolved[$tokenName]); } - if (!array_key_exists($layer, $this->layers)) { - return false; + return \false; } - $collectables = $this->layers[$layer]; - foreach ($collectables as $collectable) { $collector = $collectable->collector; - if ($collector instanceof ConditionalCollectorInterface - && !$collector->resolvable($collectable->attributes) - ) { + if ($collector instanceof ConditionalCollectorInterface && !$collector->resolvable($collectable->attributes)) { continue; } - if ($collector->satisfy($collectable->attributes, $reference)) { - return true; + return \true; } } - - return false; + return \false; } - - public function has(string $layer): bool + public function has(string $layer) : bool { return array_key_exists($layer, $this->layers); } - /** * @param array>>}> $layers * * @throws InvalidLayerDefinitionException */ - private function initializeLayers(array $layers): void + private function initializeLayers(array $layers) : void { $this->layers = []; foreach ($layers as $layer) { if (!array_key_exists('name', $layer)) { throw InvalidLayerDefinitionException::missingName(); } - $layerName = $layer['name']; - if (array_key_exists($layerName, $this->layers)) { throw InvalidLayerDefinitionException::duplicateName($layerName); } - $this->layers[$layerName] = []; foreach ($layer['collectors'] ?? [] as $config) { $this->layers[$layerName][] = $this->collectorResolver->resolve($config); @@ -130,7 +105,6 @@ private function initializeLayers(array $layers): void throw InvalidLayerDefinitionException::collectorRequired($layerName); } } - if ([] === $this->layers) { throw InvalidLayerDefinitionException::layerRequired(); } diff --git a/src/Core/Layer/LayerResolverInterface.php b/src/Core/Layer/LayerResolverInterface.php index 30132b945..a8fbaf85a 100644 --- a/src/Core/Layer/LayerResolverInterface.php +++ b/src/Core/Layer/LayerResolverInterface.php @@ -1,14 +1,12 @@ addOptions([ - new InputOption( - '--help', - '-h', - InputOption::VALUE_NONE, - 'Display help for the given command. When no command is given display help for the analyse command' - ), - new InputOption( - '--no-cache', - null, - InputOption::VALUE_NONE, - 'Disable caching mechanisms (wins over --cache-file)' - ), - new InputOption( - '--clear-cache', - null, - InputOption::VALUE_NONE, - 'Clears cache file before run' - ), - new InputOption( - '--cache-file', - null, - InputOption::VALUE_REQUIRED, - 'Location where cache file will be stored', - getcwd().DIRECTORY_SEPARATOR.'.deptrac.cache' - ), - new InputOption( - '--config-file', - '-c', - InputOption::VALUE_REQUIRED, - 'Location of Depfile containing the configuration', - getcwd().DIRECTORY_SEPARATOR.'deptrac.yaml' - ), - ]); - + $definition->addOptions([new InputOption('--help', '-h', InputOption::VALUE_NONE, 'Display help for the given command. When no command is given display help for the analyse command'), new InputOption('--no-cache', null, InputOption::VALUE_NONE, 'Disable caching mechanisms (wins over --cache-file)'), new InputOption('--clear-cache', null, InputOption::VALUE_NONE, 'Clears cache file before run'), new InputOption('--cache-file', null, InputOption::VALUE_REQUIRED, 'Location where cache file will be stored', getcwd() . DIRECTORY_SEPARATOR . '.deptrac.cache'), new InputOption('--config-file', '-c', InputOption::VALUE_REQUIRED, 'Location of Depfile containing the configuration', getcwd() . DIRECTORY_SEPARATOR . 'deptrac.yaml')]); return $definition; } - /** * @throws Throwable */ - public function doRun(InputInterface $input, OutputInterface $output): int + public function doRun(InputInterface $input, OutputInterface $output) : int { - if (false === ($currentWorkingDirectory = getcwd())) { - throw CannotGetCurrentWorkingDirectoryException::cannotGetCWD(); + if (\false === ($currentWorkingDirectory = getcwd())) { + throw \Qossmic\Deptrac\Supportive\Console\CannotGetCurrentWorkingDirectoryException::cannotGetCWD(); } - try { $input->bind($this->getDefinition()); } catch (ExceptionInterface) { // Errors must be ignored, full binding/validation happens later when the command is known. } - - if (null === $input->getArgument('command') && true === $input->getOption('version')) { + if (null === $input->getArgument('command') && \true === $input->getOption('version')) { return parent::doRun($input, $output); } - /** @var string|numeric|null $configFile */ $configFile = $input->getOption('config-file'); - $config = $input->hasOption('config-file') - ? (string) $configFile - : $currentWorkingDirectory.DIRECTORY_SEPARATOR.'deptrac.yaml'; - + $config = $input->hasOption('config-file') ? (string) $configFile : $currentWorkingDirectory . DIRECTORY_SEPARATOR . 'deptrac.yaml'; /** @var string|numeric|null $cacheFile */ - $cacheFile = $input->getParameterOption('--cache-file', $currentWorkingDirectory.DIRECTORY_SEPARATOR.'.deptrac.cache'); - $cache = $input->hasParameterOption('--cache-file') - ? (string) $cacheFile - : $currentWorkingDirectory.DIRECTORY_SEPARATOR.'.deptrac.cache'; - + $cacheFile = $input->getParameterOption('--cache-file', $currentWorkingDirectory . DIRECTORY_SEPARATOR . '.deptrac.cache'); + $cache = $input->hasParameterOption('--cache-file') ? (string) $cacheFile : $currentWorkingDirectory . DIRECTORY_SEPARATOR . '.deptrac.cache'; $factory = new ServiceContainerBuilder($currentWorkingDirectory); - if ($input->hasParameterOption('--clear-cache', true)) { + if ($input->hasParameterOption('--clear-cache', \true)) { $factory = $factory->clearCache($cache); } - if (!in_array($input->getArgument('command'), ['init', 'list', 'help', 'completion'], true)) { + if (!in_array($input->getArgument('command'), ['init', 'list', 'help', 'completion'], \true)) { $factory = $factory->withConfig($config); } - if (false === $input->hasParameterOption('--no-cache', true)) { + if (\false === $input->hasParameterOption('--no-cache', \true)) { $factory = $factory->withCache($cache); } - try { $container = $factory->build(); $commandLoader = $container->get('console.command_loader'); @@ -127,13 +75,11 @@ public function doRun(InputInterface $input, OutputInterface $output): int $this->setCommandLoader($commandLoader); $this->setDefaultCommand('analyse'); } catch (CannotLoadConfiguration $e) { - if (false === $input->hasParameterOption(['--help', '-h'], true)) { + if (\false === $input->hasParameterOption(['--help', '-h'], \true)) { throw $e; } - $this->setDefaultCommand('help'); } - return parent::doRun($input, $output); } } diff --git a/src/Supportive/Console/CannotGetCurrentWorkingDirectoryException.php b/src/Supportive/Console/CannotGetCurrentWorkingDirectoryException.php index 6665f24a8..1469f243c 100755 --- a/src/Supportive/Console/CannotGetCurrentWorkingDirectoryException.php +++ b/src/Supportive/Console/CannotGetCurrentWorkingDirectoryException.php @@ -1,20 +1,17 @@ addOption( - 'formatter', - 'f', - InputOption::VALUE_OPTIONAL, - sprintf( - 'Format in which to print the result of the analysis. Possible: ["%s"]', - implode('", "', $this->formatterProvider->getKnownFormatters()) - ) - ); + $this->addOption('formatter', 'f', InputOption::VALUE_OPTIONAL, \sprintf('Format in which to print the result of the analysis. Possible: ["%s"]', \implode('", "', $this->formatterProvider->getKnownFormatters()))); $this->addOption('output', 'o', InputOption::VALUE_OPTIONAL, 'Output file path for formatter (if applicable)'); $this->addOption('no-progress', null, InputOption::VALUE_NONE, 'Do not show progress bar'); $this->addOption(self::OPTION_FAIL_ON_UNCOVERED, null, InputOption::VALUE_NONE, 'Fails if any uncovered dependency is found'); $this->addOption(self::OPTION_REPORT_UNCOVERED, null, InputOption::VALUE_NONE, 'Report uncovered dependencies'); $this->addOption(self::OPTION_REPORT_SKIPPED, null, InputOption::VALUE_NONE, 'Report skipped violations'); } - - protected function execute(InputInterface $input, OutputInterface $output): int + protected function execute(InputInterface $input, OutputInterface $output) : int { - ini_set('memory_limit', '-1'); - + \ini_set('memory_limit', '-1'); $symfonyOutput = new SymfonyOutput($output, new Style(new SymfonyStyle($input, $output))); /** @var ?string $formatter */ $formatter = $input->getOption('formatter'); $formatter ??= self::getDefaultFormatter(); - /** @var string|numeric|null $output */ $output = $input->getOption('output'); - - $options = new AnalyseOptions( - (bool) $input->getOption('no-progress'), - $formatter, - null === $output ? null : (string) $output, - (bool) $input->getOption(self::OPTION_REPORT_SKIPPED), - (bool) $input->getOption(self::OPTION_REPORT_UNCOVERED), - (bool) $input->getOption(self::OPTION_FAIL_ON_UNCOVERED) - ); - + $options = new \Qossmic\Deptrac\Supportive\Console\Command\AnalyseOptions((bool) $input->getOption('no-progress'), $formatter, null === $output ? null : (string) $output, (bool) $input->getOption(self::OPTION_REPORT_SKIPPED), (bool) $input->getOption(self::OPTION_REPORT_UNCOVERED), (bool) $input->getOption(self::OPTION_FAIL_ON_UNCOVERED)); $this->dispatcher->addSubscriber(new ConsoleSubscriber($symfonyOutput, new Stopwatch())); if (!$options->noProgress) { $this->dispatcher->addSubscriber(new ProgressSubscriber($symfonyOutput)); } - try { $this->runner->run($options, $symfonyOutput); - } catch (CommandRunException) { + } catch (\Qossmic\Deptrac\Supportive\Console\Command\CommandRunException) { return self::FAILURE; } - return self::SUCCESS; } - - public static function getDefaultFormatter(): string + public static function getDefaultFormatter() : string { - return false !== (new Env())->get('GITHUB_ACTIONS') ? GithubActionsOutputFormatter::getName() : TableOutputFormatter::getName(); + return \false !== (new Env())->get('GITHUB_ACTIONS') ? GithubActionsOutputFormatter::getName() : TableOutputFormatter::getName(); } } diff --git a/src/Supportive/Console/Command/AnalyseOptions.php b/src/Supportive/Console/Command/AnalyseOptions.php index 68363bac9..2c279095d 100644 --- a/src/Supportive/Console/Command/AnalyseOptions.php +++ b/src/Supportive/Console/Command/AnalyseOptions.php @@ -4,12 +4,7 @@ class AnalyseOptions { - public function __construct( - public readonly bool $noProgress, - public readonly string $formatter, - public readonly ?string $output, - public readonly bool $reportSkipped, - public readonly bool $reportUncovered, - public readonly bool $failOnUncovered - ) {} + public function __construct(public readonly bool $noProgress, public readonly string $formatter, public readonly ?string $output, public readonly bool $reportSkipped, public readonly bool $reportUncovered, public readonly bool $failOnUncovered) + { + } } diff --git a/src/Supportive/Console/Command/AnalyseRunner.php b/src/Supportive/Console/Command/AnalyseRunner.php index 017a0dbd5..e2334e972 100644 --- a/src/Supportive/Console/Command/AnalyseRunner.php +++ b/src/Supportive/Console/Command/AnalyseRunner.php @@ -1,10 +1,9 @@ formatterProvider->get($options->formatter); } catch (ContainerExceptionInterface) { $this->printFormatterNotFoundException($output, $options->formatter); - - throw CommandRunException::invalidFormatter(); + throw \Qossmic\Deptrac\Supportive\Console\Command\CommandRunException::invalidFormatter(); } - - $formatterInput = new OutputFormatterInput( - $options->output, - $options->reportSkipped, - $options->reportUncovered, - $options->failOnUncovered, - ); - + $formatterInput = new OutputFormatterInput($options->output, $options->reportSkipped, $options->reportUncovered, $options->failOnUncovered); $this->printCollectViolations($output); - try { $result = OutputResult::fromAnalysisResult($this->analyser->analyse()); } catch (AnalyserException $e) { $this->printAnalysisException($output, $e); - throw CommandRunException::analyserException($e); + throw \Qossmic\Deptrac\Supportive\Console\Command\CommandRunException::analyserException($e); } - $this->printFormattingStart($output); - try { $formatter->finish($result, $output, $formatterInput); } catch (Throwable $error) { $this->printFormatterError($output, $formatter::getName(), $error); } - if ($options->failOnUncovered && $result->hasUncovered()) { - throw CommandRunException::finishedWithUncovered(); + throw \Qossmic\Deptrac\Supportive\Console\Command\CommandRunException::finishedWithUncovered(); } if ($result->hasViolations()) { - throw CommandRunException::finishedWithViolations(); + throw \Qossmic\Deptrac\Supportive\Console\Command\CommandRunException::finishedWithViolations(); } if ($result->hasErrors()) { - throw CommandRunException::failedWithErrors(); + throw \Qossmic\Deptrac\Supportive\Console\Command\CommandRunException::failedWithErrors(); } } - - private function printCollectViolations(OutputInterface $output): void + private function printCollectViolations(OutputInterface $output) : void { if ($output->isVerbose()) { $output->writeLineFormatted('collecting violations.'); } } - - private function printFormattingStart(OutputInterface $output): void + private function printFormattingStart(OutputInterface $output) : void { if ($output->isVerbose()) { $output->writeLineFormatted('formatting dependencies.'); } } - - private function printFormatterError(OutputInterface $output, string $formatterName, Throwable $error): void + private function printFormatterError(OutputInterface $output, string $formatterName, Throwable $error) : void { $output->writeLineFormatted(''); - $output->getStyle()->error([ - '', - sprintf('Output formatter %s threw an Exception:', $formatterName), - sprintf('Message: %s', $error->getMessage()), - '', - ]); + $output->getStyle()->error(['', sprintf('Output formatter %s threw an Exception:', $formatterName), sprintf('Message: %s', $error->getMessage()), '']); $output->writeLineFormatted(''); } - - private function printAnalysisException(OutputInterface $output, AnalyserException $exception): void + private function printAnalysisException(OutputInterface $output, AnalyserException $exception) : void { $exceptionMessageStack = [$exception->getMessage()]; $previous = $exception->getPrevious(); @@ -105,21 +82,13 @@ private function printAnalysisException(OutputInterface $output, AnalyserExcepti $exceptionMessageStack[] = $previous->getMessage(); $previous = $previous->getPrevious(); } - $message = ['Analysis finished with an Exception.', ...$exceptionMessageStack]; - $output->getStyle()->error($message); } - - private function printFormatterNotFoundException(OutputInterface $output, string $formatterName): void + private function printFormatterNotFoundException(OutputInterface $output, string $formatterName) : void { $output->writeLineFormatted(''); - $output->getStyle()->error([ - '', - sprintf('Output formatter %s not found.', $formatterName), - sprintf('Available formatters: ["%s"]', implode('", "', $this->formatterProvider->getKnownFormatters())), - '', - ]); + $output->getStyle()->error(['', sprintf('Output formatter %s not found.', $formatterName), sprintf('Available formatters: ["%s"]', implode('", "', $this->formatterProvider->getKnownFormatters())), '']); $output->writeLineFormatted(''); } } diff --git a/src/Supportive/Console/Command/CommandRunException.php b/src/Supportive/Console/Command/CommandRunException.php index 8596e69bc..da3c2a6fd 100755 --- a/src/Supportive/Console/Command/CommandRunException.php +++ b/src/Supportive/Console/Command/CommandRunException.php @@ -1,36 +1,30 @@ addArgument('layer', InputArgument::REQUIRED, 'Layer to debug'); /** @throws void */ - $this->addArgument( - 'targetLayer', - InputArgument::OPTIONAL, - 'Target layer to filter dependencies to only one layer' - ); + $this->addArgument('targetLayer', InputArgument::OPTIONAL, 'Target layer to filter dependencies to only one layer'); } - - protected function execute(InputInterface $input, OutputInterface $output): int + protected function execute(InputInterface $input, OutputInterface $output) : int { $outputStyle = new Style(new SymfonyStyle($input, $output)); $symfonyOutput = new SymfonyOutput($output, $outputStyle); - try { /** @var ?string $target */ $target = $input->getArgument('targetLayer'); - /** @var string $layer */ $layer = $input->getArgument('layer'); - $this->runner->run($symfonyOutput, $layer, $target); - } catch (CommandRunException $exception) { + } catch (\Qossmic\Deptrac\Supportive\Console\Command\CommandRunException $exception) { $outputStyle->error($exception->getMessage()); - return self::FAILURE; } - return self::SUCCESS; } } diff --git a/src/Supportive/Console/Command/DebugDependenciesRunner.php b/src/Supportive/Console/Command/DebugDependenciesRunner.php index ad508c018..bed0aff28 100644 --- a/src/Supportive/Console/Command/DebugDependenciesRunner.php +++ b/src/Supportive/Console/Command/DebugDependenciesRunner.php @@ -1,58 +1,43 @@ analyser->getDependencies($layer, $target); foreach ($dependencies as $targetLayer => $violations) { - $output->getStyle()->table( - [$targetLayer], - array_map(fn (Uncovered $violation): array => $this->formatRow($violation), $violations) - ); + $output->getStyle()->table([$targetLayer], \array_map(fn(Uncovered $violation): array => $this->formatRow($violation), $violations)); } } catch (AnalyserException $e) { - throw CommandRunException::analyserException($e); + throw \Qossmic\Deptrac\Supportive\Console\Command\CommandRunException::analyserException($e); } } - /** * @return array */ - private function formatRow(Uncovered $rule): array + private function formatRow(Uncovered $rule) : array { $dependency = $rule->getDependency(); - - $message = sprintf( - '%s depends on %s (%s)', - $dependency->getDepender() - ->toString(), - $dependency->getDependent() - ->toString(), - $rule->layer - ); - + $message = \sprintf('%s depends on %s (%s)', $dependency->getDepender()->toString(), $dependency->getDependent()->toString(), $rule->layer); $fileOccurrence = $dependency->getFileOccurrence(); - $message .= sprintf("\n%s:%d", $fileOccurrence->filepath, $fileOccurrence->line); - + $message .= \sprintf("\n%s:%d", $fileOccurrence->filepath, $fileOccurrence->line); return [$message]; } } diff --git a/src/Supportive/Console/Command/DebugLayerCommand.php b/src/Supportive/Console/Command/DebugLayerCommand.php index b9c6bd27f..317754d17 100644 --- a/src/Supportive/Console/Command/DebugLayerCommand.php +++ b/src/Supportive/Console/Command/DebugLayerCommand.php @@ -1,50 +1,40 @@ addArgument('layer', InputArgument::OPTIONAL, 'Layer to debug'); } - - protected function execute(InputInterface $input, OutputInterface $output): int + protected function execute(InputInterface $input, OutputInterface $output) : int { $outputStyle = new Style(new SymfonyStyle($input, $output)); $symfonyOutput = new SymfonyOutput($output, $outputStyle); - /** @var ?string $layer */ $layer = $input->getArgument('layer'); - try { $this->runner->run($layer, $symfonyOutput); - } catch (CommandRunException $exception) { + } catch (\Qossmic\Deptrac\Supportive\Console\Command\CommandRunException $exception) { $outputStyle->error($exception->getMessage()); - return self::FAILURE; } - return self::SUCCESS; } } diff --git a/src/Supportive/Console/Command/DebugLayerRunner.php b/src/Supportive/Console/Command/DebugLayerRunner.php index 8fe7229c1..dc9099124 100644 --- a/src/Supportive/Console/Command/DebugLayerRunner.php +++ b/src/Supportive/Console/Command/DebugLayerRunner.php @@ -1,15 +1,12 @@ >>}> $layers */ - public function __construct(private readonly TokenInLayerAnalyser $analyser, private readonly array $layers) {} - + public function __construct(private readonly TokenInLayerAnalyser $analyser, private readonly array $layers) + { + } /** * @throws CommandRunException */ - public function run(?string $layer, OutputInterface $output): void + public function run(?string $layer, OutputInterface $output) : void { - $debugLayers = $layer - ? [$layer] - : array_map(static fn (array $layer): string => $layer['name'], $this->layers); - + $debugLayers = $layer ? [$layer] : array_map(static fn(array $layer): string => $layer['name'], $this->layers); try { foreach ($debugLayers as $debugLayer) { - $matchedLayers = array_map( - static fn (string $token) => (array) $token, - $this->analyser->findTokensInLayer($debugLayer) - ); - + $matchedLayers = array_map(static fn(string $token) => (array) $token, $this->analyser->findTokensInLayer($debugLayer)); $output->getStyle()->table([$debugLayer], $matchedLayers); } } catch (AnalyserException $e) { - throw CommandRunException::analyserException($e); + throw \Qossmic\Deptrac\Supportive\Console\Command\CommandRunException::analyserException($e); } } } diff --git a/src/Supportive/Console/Command/DebugTokenCommand.php b/src/Supportive/Console/Command/DebugTokenCommand.php index e34467ff8..a809f1217 100644 --- a/src/Supportive/Console/Command/DebugTokenCommand.php +++ b/src/Supportive/Console/Command/DebugTokenCommand.php @@ -1,54 +1,44 @@ addArgument('token', InputArgument::REQUIRED, 'Full qualified token name to debug'); $this->addArgument('type', InputArgument::OPTIONAL, 'Token type (class-like, function, file)', 'class-like'); } - - protected function execute(InputInterface $input, OutputInterface $output): int + protected function execute(InputInterface $input, OutputInterface $output) : int { $outputStyle = new Style(new SymfonyStyle($input, $output)); $symfonyOutput = new SymfonyOutput($output, $outputStyle); - /** @var string $tokenName */ $tokenName = $input->getArgument('token'); /** @var string $tokenType */ $tokenType = $input->getArgument('type'); - try { $this->runner->run($tokenName, TokenType::from($tokenType), $symfonyOutput); - } catch (CommandRunException $exception) { + } catch (\Qossmic\Deptrac\Supportive\Console\Command\CommandRunException $exception) { $outputStyle->error($exception->getMessage()); - return self::FAILURE; } - return self::SUCCESS; } } diff --git a/src/Supportive/Console/Command/DebugTokenRunner.php b/src/Supportive/Console/Command/DebugTokenRunner.php index df8cf02ee..d9b4bae8d 100644 --- a/src/Supportive/Console/Command/DebugTokenRunner.php +++ b/src/Supportive/Console/Command/DebugTokenRunner.php @@ -1,47 +1,41 @@ analyser->findLayerForToken($tokenName, $tokenType); } catch (AnalyserException $e) { - throw CommandRunException::analyserException($e); + throw \Qossmic\Deptrac\Supportive\Console\Command\CommandRunException::analyserException($e); } - if ([] === $matches) { $output->writeLineFormatted(sprintf('Could not find a token matching "%s"', $tokenName)); - return; } - $headers = ['matching token', 'layers']; $rows = []; foreach ($matches as $token => $layers) { $rows[] = [$token, [] !== $layers ? implode(', ', $layers) : '---']; } - $output->getStyle()->table($headers, $rows); } } diff --git a/src/Supportive/Console/Command/DebugUnassignedCommand.php b/src/Supportive/Console/Command/DebugUnassignedCommand.php index ded59cf5d..dc77f0d6a 100644 --- a/src/Supportive/Console/Command/DebugUnassignedCommand.php +++ b/src/Supportive/Console/Command/DebugUnassignedCommand.php @@ -1,39 +1,32 @@ runner->run($symfonyOutput); - } catch (CommandRunException $exception) { + } catch (\Qossmic\Deptrac\Supportive\Console\Command\CommandRunException $exception) { $outputStyle->error($exception->getMessage()); - return self::FAILURE; } - return self::SUCCESS; } } diff --git a/src/Supportive/Console/Command/DebugUnassignedRunner.php b/src/Supportive/Console/Command/DebugUnassignedRunner.php index 963d05895..c3164785c 100644 --- a/src/Supportive/Console/Command/DebugUnassignedRunner.php +++ b/src/Supportive/Console/Command/DebugUnassignedRunner.php @@ -1,37 +1,33 @@ analyser->findUnassignedTokens(); } catch (AnalyserException $e) { - throw CommandRunException::analyserException($e); + throw \Qossmic\Deptrac\Supportive\Console\Command\CommandRunException::analyserException($e); } - if ([] === $unassignedTokens) { $output->writeLineFormatted('There are no unassigned tokens.'); - return; } - $output->writeLineFormatted($unassignedTokens); } } diff --git a/src/Supportive/Console/Command/DebugUnusedCommand.php b/src/Supportive/Console/Command/DebugUnusedCommand.php index 266a1ade0..e39a4561a 100644 --- a/src/Supportive/Console/Command/DebugUnusedCommand.php +++ b/src/Supportive/Console/Command/DebugUnusedCommand.php @@ -1,55 +1,40 @@ addOption( - 'limit', - 'l', - InputOption::VALUE_OPTIONAL, - 'How many times can it be used to be considered unused', - 0 - ); + $this->addOption('limit', 'l', InputOption::VALUE_OPTIONAL, 'How many times can it be used to be considered unused', 0); } - - protected function execute(InputInterface $input, OutputInterface $output): int + protected function execute(InputInterface $input, OutputInterface $output) : int { $outputStyle = new Style(new SymfonyStyle($input, $output)); $symfonyOutput = new SymfonyOutput($output, $outputStyle); - try { /** @var string $limit */ $limit = $input->getOption('limit'); $this->runner->run($symfonyOutput, (int) $limit); - } catch (CommandRunException $exception) { + } catch (\Qossmic\Deptrac\Supportive\Console\Command\CommandRunException $exception) { $outputStyle->error($exception->getMessage()); - return self::FAILURE; } - return self::SUCCESS; } } diff --git a/src/Supportive/Console/Command/DebugUnusedRunner.php b/src/Supportive/Console/Command/DebugUnusedRunner.php index d138ef928..81045a1e7 100644 --- a/src/Supportive/Console/Command/DebugUnusedRunner.php +++ b/src/Supportive/Console/Command/DebugUnusedRunner.php @@ -1,67 +1,51 @@ analyser->analyse(); - - $outputTable = $this->prepareOutputTable( - $rulesetUsages, - $limit - ); - + $outputTable = $this->prepareOutputTable($rulesetUsages, $limit); $output->getStyle()->table(['Unused'], $outputTable); } catch (AnalyserException $e) { - throw CommandRunException::analyserException($e); + throw \Qossmic\Deptrac\Supportive\Console\Command\CommandRunException::analyserException($e); } } - /** * @param array> $layerNames * * @return array */ - private function prepareOutputTable( - array $layerNames, - int $limit - ): array { + private function prepareOutputTable(array $layerNames, int $limit) : array + { $rows = []; foreach ($layerNames as $dependerLayerName => $dependentLayerNames) { foreach ($dependentLayerNames as $dependentLayerName => $numberOfDependencies) { if ($numberOfDependencies <= $limit) { if (0 === $numberOfDependencies) { - $rows[] = [ - "{$dependerLayerName} layer is not dependent on {$dependentLayerName}", - ]; + $rows[] = ["{$dependerLayerName} layer is not dependent on {$dependentLayerName}"]; } else { - $rows[] = [ - "{$dependerLayerName} layer is dependent {$dependentLayerName} layer {$numberOfDependencies} times", - ]; + $rows[] = ["{$dependerLayerName} layer is dependent {$dependentLayerName} layer {$numberOfDependencies} times"]; } } } } - return $rows; } } diff --git a/src/Supportive/Console/Command/InitCommand.php b/src/Supportive/Console/Command/InitCommand.php index 9d90ada73..88ca226c8 100644 --- a/src/Supportive/Console/Command/InitCommand.php +++ b/src/Supportive/Console/Command/InitCommand.php @@ -1,7 +1,6 @@ setName('init'); } - - protected function execute(InputInterface $input, OutputInterface $output): int + protected function execute(InputInterface $input, OutputInterface $output) : int { try { /** @var string $targetFile */ $targetFile = $input->getOption('config-file'); $this->dumper->dump($targetFile); $output->writeln('Depfile dumped.'); - return self::SUCCESS; } catch (FileNotWritableException|FileAlreadyExistsException|IOException|FileNotExistsException $fileException) { $output->writeln(sprintf('%s', $fileException->getMessage())); - return self::FAILURE; } } diff --git a/src/Supportive/Console/Env.php b/src/Supportive/Console/Env.php index 798e49916..f2858f8b7 100644 --- a/src/Supportive/Console/Env.php +++ b/src/Supportive/Console/Env.php @@ -1,7 +1,6 @@ */ - public static function getSubscribedEvents(): array + public static function getSubscribedEvents() : array { - return [ - PreCreateAstMapEvent::class => 'onPreCreateAstMapEvent', - PostCreateAstMapEvent::class => 'onPostCreateAstMapEvent', - AstFileAnalysedEvent::class => 'onAstFileAnalysedEvent', - AstFileSyntaxErrorEvent::class => 'onAstFileSyntaxErrorEvent', - PreEmitEvent::class => 'onPreDependencyEmit', - PostEmitEvent::class => 'onPostDependencyEmit', - PreFlattenEvent::class => 'onPreDependencyFlatten', - PostFlattenEvent::class => 'onPostDependencyFlatten', - ]; + return [PreCreateAstMapEvent::class => 'onPreCreateAstMapEvent', PostCreateAstMapEvent::class => 'onPostCreateAstMapEvent', AstFileAnalysedEvent::class => 'onAstFileAnalysedEvent', AstFileSyntaxErrorEvent::class => 'onAstFileSyntaxErrorEvent', PreEmitEvent::class => 'onPreDependencyEmit', PostEmitEvent::class => 'onPostDependencyEmit', PreFlattenEvent::class => 'onPreDependencyFlatten', PostFlattenEvent::class => 'onPostDependencyFlatten']; } - - public function onPreCreateAstMapEvent(PreCreateAstMapEvent $preCreateAstMapEvent): void + public function onPreCreateAstMapEvent(PreCreateAstMapEvent $preCreateAstMapEvent) : void { if ($this->output->isVerbose()) { $this->stopwatchStart('ast'); - - $this->output->writeLineFormatted( - sprintf( - 'Start to create an AstMap for %u Files.', - $preCreateAstMapEvent->expectedFileCount - ) - ); + $this->output->writeLineFormatted(sprintf('Start to create an AstMap for %u Files.', $preCreateAstMapEvent->expectedFileCount)); } } - - public function onPostCreateAstMapEvent(PostCreateAstMapEvent $postCreateAstMapEvent): void + public function onPostCreateAstMapEvent(PostCreateAstMapEvent $postCreateAstMapEvent) : void { if ($this->output->isVerbose()) { - $this->printMessageWithTime( - 'ast', - 'AstMap created in %01.2f sec.', - 'AstMap created.' - ); + $this->printMessageWithTime('ast', 'AstMap created in %01.2f sec.', 'AstMap created.'); } } - - public function onAstFileAnalysedEvent(AstFileAnalysedEvent $analysedEvent): void + public function onAstFileAnalysedEvent(AstFileAnalysedEvent $analysedEvent) : void { if ($this->output->isVerbose()) { $this->output->writeLineFormatted(sprintf('Parsing File %s', $analysedEvent->file)); } } - - public function onAstFileSyntaxErrorEvent(AstFileSyntaxErrorEvent $astFileSyntaxErrorEvent): void + public function onAstFileSyntaxErrorEvent(AstFileSyntaxErrorEvent $astFileSyntaxErrorEvent) : void { - $this->output->writeLineFormatted(sprintf( - "\nSyntax Error on File %s\n%s\n", - $astFileSyntaxErrorEvent->file, - $astFileSyntaxErrorEvent->syntaxError - )); + $this->output->writeLineFormatted(sprintf("\nSyntax Error on File %s\n%s\n", $astFileSyntaxErrorEvent->file, $astFileSyntaxErrorEvent->syntaxError)); } - - public function onPreDependencyEmit(PreEmitEvent $event): void + public function onPreDependencyEmit(PreEmitEvent $event) : void { if ($this->output->isVerbose()) { $this->stopwatchStart('deps'); - - $this->output->writeLineFormatted( - sprintf('start emitting dependencies "%s"', $event->emitterName) - ); + $this->output->writeLineFormatted(sprintf('start emitting dependencies "%s"', $event->emitterName)); } } - - public function onPostDependencyEmit(PostEmitEvent $event): void + public function onPostDependencyEmit(PostEmitEvent $event) : void { if ($this->output->isVerbose()) { - $this->printMessageWithTime( - 'deps', - 'Dependencies emitted in %01.f sec.', - 'Dependencies emitted.' - ); + $this->printMessageWithTime('deps', 'Dependencies emitted in %01.f sec.', 'Dependencies emitted.'); } } - - public function onPreDependencyFlatten(PreFlattenEvent $event): void + public function onPreDependencyFlatten(PreFlattenEvent $event) : void { if ($this->output->isVerbose()) { $this->stopwatchStart('flatten'); - $this->output->writeLineFormatted('start flatten dependencies'); } } - - public function onPostDependencyFlatten(PostFlattenEvent $event): void + public function onPostDependencyFlatten(PostFlattenEvent $event) : void { if ($this->output->isVerbose()) { - $this->printMessageWithTime( - 'flatten', - 'Dependencies flattened in %01.f sec.', - 'Dependencies flattened.' - ); + $this->printMessageWithTime('flatten', 'Dependencies flattened in %01.f sec.', 'Dependencies flattened.'); } } - /** * @param non-empty-string $event */ - private function stopwatchStart(string $event): void + private function stopwatchStart(string $event) : void { try { $this->stopwatch->start($event); } catch (StopwatchException) { } } - /** * @param non-empty-string $event * @param non-empty-string $messageWithTime * @param non-empty-string $messageWithoutTime */ - private function printMessageWithTime(string $event, string $messageWithTime, string $messageWithoutTime): void + private function printMessageWithTime(string $event, string $messageWithTime, string $messageWithoutTime) : void { try { $period = $this->stopwatch->stop($event); - $this->output->writeLineFormatted(sprintf($messageWithTime, $period->toSeconds())); } catch (StopwatchException) { $this->output->writeLineFormatted($messageWithoutTime); diff --git a/src/Supportive/Console/Subscriber/ProgressSubscriber.php b/src/Supportive/Console/Subscriber/ProgressSubscriber.php index 0e1159e47..7902da8a4 100644 --- a/src/Supportive/Console/Subscriber/ProgressSubscriber.php +++ b/src/Supportive/Console/Subscriber/ProgressSubscriber.php @@ -1,42 +1,34 @@ > */ - public static function getSubscribedEvents(): array + public static function getSubscribedEvents() : array { - return [ - PreCreateAstMapEvent::class => 'onPreCreateAstMapEvent', - PostCreateAstMapEvent::class => ['onPostCreateAstMapEvent', 1], - AstFileAnalysedEvent::class => 'onAstFileAnalysedEvent', - ]; + return [PreCreateAstMapEvent::class => 'onPreCreateAstMapEvent', PostCreateAstMapEvent::class => ['onPostCreateAstMapEvent', 1], AstFileAnalysedEvent::class => 'onAstFileAnalysedEvent']; } - - public function onPreCreateAstMapEvent(PreCreateAstMapEvent $preCreateAstMapEvent): void + public function onPreCreateAstMapEvent(PreCreateAstMapEvent $preCreateAstMapEvent) : void { $this->output->getStyle()->progressStart($preCreateAstMapEvent->expectedFileCount); } - - public function onPostCreateAstMapEvent(PostCreateAstMapEvent $postCreateAstMapEvent): void + public function onPostCreateAstMapEvent(PostCreateAstMapEvent $postCreateAstMapEvent) : void { $this->output->getStyle()->progressFinish(); } - - public function onAstFileAnalysedEvent(AstFileAnalysedEvent $analysedEvent): void + public function onAstFileAnalysedEvent(AstFileAnalysedEvent $analysedEvent) : void { $this->output->getStyle()->progressAdvance(); } diff --git a/src/Supportive/Console/Symfony/Style.php b/src/Supportive/Console/Symfony/Style.php index d60e2ef2b..95bb4b6ad 100644 --- a/src/Supportive/Console/Symfony/Style.php +++ b/src/Supportive/Console/Symfony/Style.php @@ -1,98 +1,85 @@ symfonyStyle->title($message); } - - public function section(string $message): void + public function section(string $message) : void { $this->symfonyStyle->section($message); } - /** * {@inheritdoc} */ - public function success($message): void + public function success($message) : void { $this->symfonyStyle->success($message); } - /** * {@inheritdoc} */ - public function error($message): void + public function error($message) : void { $this->symfonyStyle->error($message); } - /** * {@inheritdoc} */ - public function warning($message): void + public function warning($message) : void { $this->symfonyStyle->warning($message); } - /** * {@inheritdoc} */ - public function note($message): void + public function note($message) : void { $this->symfonyStyle->note($message); } - /** * {@inheritdoc} */ - public function caution($message): void + public function caution($message) : void { $this->symfonyStyle->caution($message); } - /** * {@inheritdoc} */ - public function definitionList(...$list): void + public function definitionList(...$list) : void { $this->symfonyStyle->definitionList(...$list); } - - public function table(array $headers, array $rows): void + public function table(array $headers, array $rows) : void { $this->symfonyStyle->table($headers, $rows); } - - public function newLine(int $count = 1): void + public function newLine(int $count = 1) : void { $this->symfonyStyle->newLine($count); } - - public function progressStart(int $max = 0): void + public function progressStart(int $max = 0) : void { $this->symfonyStyle->progressStart($max); } - - public function progressAdvance(int $step = 1): void + public function progressAdvance(int $step = 1) : void { $this->symfonyStyle->progressAdvance($step); } - - public function progressFinish(): void + public function progressFinish() : void { $this->symfonyStyle->progressFinish(); } diff --git a/src/Supportive/Console/Symfony/SymfonyOutput.php b/src/Supportive/Console/Symfony/SymfonyOutput.php index 1ed7ed864..e5ec08893 100644 --- a/src/Supportive/Console/Symfony/SymfonyOutput.php +++ b/src/Supportive/Console/Symfony/SymfonyOutput.php @@ -1,49 +1,43 @@ symfonyOutput->write($message, false, SymfonyOutputInterface::OUTPUT_NORMAL); } - + public function writeFormatted(string $message) : void + { + $this->symfonyOutput->write($message, \false, SymfonyOutputInterface::OUTPUT_NORMAL); + } /** * {@inheritdoc} */ - public function writeLineFormatted($message): void + public function writeLineFormatted($message) : void { $this->symfonyOutput->writeln($message, SymfonyOutputInterface::OUTPUT_NORMAL); } - - public function writeRaw(string $message): void + public function writeRaw(string $message) : void { - $this->symfonyOutput->write($message, false, SymfonyOutputInterface::OUTPUT_RAW); + $this->symfonyOutput->write($message, \false, SymfonyOutputInterface::OUTPUT_RAW); } - - public function getStyle(): OutputStyleInterface + public function getStyle() : OutputStyleInterface { return $this->style; } - - public function isVerbose(): bool + public function isVerbose() : bool { return $this->symfonyOutput->isVerbose(); } - - public function isDebug(): bool + public function isDebug() : bool { return $this->symfonyOutput->isDebug(); } diff --git a/src/Supportive/DependencyInjection/Configuration.php b/src/Supportive/DependencyInjection/Configuration.php index 05f5120fe..85690ea73 100644 --- a/src/Supportive/DependencyInjection/Configuration.php +++ b/src/Supportive/DependencyInjection/Configuration.php @@ -1,19 +1,16 @@ getRootNode(); - $this->appendAnalysedPaths($rootNode); $this->appendExcludePatterns($rootNode); $this->appendLayers($rootNode); @@ -36,202 +32,49 @@ public function getConfigTreeBuilder(): TreeBuilder $this->appendFormatters($rootNode); $this->appendEmitterTypes($rootNode); $this->appendIgnoreUncoveredInternalClasses($rootNode); - return $builder; } - - private function appendAnalysedPaths(ArrayNodeDefinition $node): void + private function appendAnalysedPaths(ArrayNodeDefinition $node) : void { - $node - ->fixXmlConfig('path') - ->children() - ->arrayNode('paths') - ->info('List of paths to search for PHP files to be analysed.') - ->addDefaultChildrenIfNoneSet() - ->requiresAtLeastOneElement() - ->scalarPrototype() - ->cannotBeEmpty() - ->defaultValue('src/') - ->end() - ->end() - ->end(); + $node->fixXmlConfig('path')->children()->arrayNode('paths')->info('List of paths to search for PHP files to be analysed.')->addDefaultChildrenIfNoneSet()->requiresAtLeastOneElement()->scalarPrototype()->cannotBeEmpty()->defaultValue('src/')->end()->end()->end(); } - - private function appendExcludePatterns(ArrayNodeDefinition $node): void + private function appendExcludePatterns(ArrayNodeDefinition $node) : void { - $node - ->fixXmlConfig('exclude_file') - ->children() - ->arrayNode('exclude_files') - ->info('List of regular expressions for excluding files or directories from being analysed') - ->example('#.*Test\.php$#') - ->scalarPrototype() - ->cannotBeEmpty() - ->end() - ->end() - ->end(); + $node->fixXmlConfig('exclude_file')->children()->arrayNode('exclude_files')->info('List of regular expressions for excluding files or directories from being analysed')->example('#.*Test\\.php$#')->scalarPrototype()->cannotBeEmpty()->end()->end()->end(); } - - private function appendLayers(ArrayNodeDefinition $node): void + private function appendLayers(ArrayNodeDefinition $node) : void { - $node - ->children() - ->arrayNode('layers') - ->useAttributeAsKey('name', false) - ->arrayPrototype() - ->children() - ->scalarNode('name') - ->isRequired() - ->cannotBeEmpty() - ->end() - ->arrayNode('collectors') - ->isRequired() - ->requiresAtLeastOneElement() - ->arrayPrototype() - ->ignoreExtraKeys(false) - ->children() - ->scalarNode('type')->isRequired()->end() - ->variableNode('value')->end() - ->booleanNode('private')->defaultFalse()->end() - ->arrayNode('attributes')->variablePrototype()->end() - ->end() - ->end() - ->end() - ->end() - ->arrayNode('attributes') - ->variablePrototype()->end() - ->end() - ->end() - ->end() - ->end() - ->end(); + $node->children()->arrayNode('layers')->useAttributeAsKey('name', \false)->arrayPrototype()->children()->scalarNode('name')->isRequired()->cannotBeEmpty()->end()->arrayNode('collectors')->isRequired()->requiresAtLeastOneElement()->arrayPrototype()->ignoreExtraKeys(\false)->children()->scalarNode('type')->isRequired()->end()->variableNode('value')->end()->booleanNode('private')->defaultFalse()->end()->arrayNode('attributes')->variablePrototype()->end()->end()->end()->end()->end()->arrayNode('attributes')->variablePrototype()->end()->end()->end()->end()->end()->end(); } - - private function appendRuleset(ArrayNodeDefinition $node): void + private function appendRuleset(ArrayNodeDefinition $node) : void { - $node - ->children() - ->arrayNode('ruleset') - ->useAttributeAsKey('name') - ->arrayPrototype() - ->scalarPrototype()->end() - ->end() - ->end() - ->end(); + $node->children()->arrayNode('ruleset')->useAttributeAsKey('name')->arrayPrototype()->scalarPrototype()->end()->end()->end()->end(); } - - private function appendSkippedViolations(ArrayNodeDefinition $node): void + private function appendSkippedViolations(ArrayNodeDefinition $node) : void { - $node - ->fixXmlConfig('skip_violation') - ->children() - ->arrayNode('skip_violations') - ->info('Skip violations matching a regular expressions') - ->useAttributeAsKey('name') - ->arrayPrototype() - ->scalarPrototype()->end() - ->end() - ->end() - ->end(); + $node->fixXmlConfig('skip_violation')->children()->arrayNode('skip_violations')->info('Skip violations matching a regular expressions')->useAttributeAsKey('name')->arrayPrototype()->scalarPrototype()->end()->end()->end()->end(); } - /** * @throws RuntimeException */ - private function appendFormatters(ArrayNodeDefinition $node): void + private function appendFormatters(ArrayNodeDefinition $node) : void { - $node - ->fixXmlConfig('formatter') - ->children() - ->arrayNode('formatters') - ->addDefaultsIfNotSet() - ->children() - ->arrayNode('graphviz') - ->info('Configure Graphviz output formatters') - ->addDefaultsIfNotSet() - ->children() - ->arrayNode('hidden_layers') - ->info('Specify any layer name, that you wish to exclude from the output') - ->scalarPrototype()->end() - ->end() - ->arrayNode('groups') - ->info('Combine multiple layers to a group') - ->useAttributeAsKey('name') - ->arrayPrototype() - ->scalarPrototype()->end() - ->end() - ->end() - ->booleanNode('point_to_groups') - ->info('When a layer is part of a group, should edges point towards the group or the layer?') - ->defaultFalse() - ->end() - ->end() - ->beforeNormalization() - ->ifTrue(static fn ($v) => is_array($v) && array_key_exists('pointToGroups', $v)) - ->then(static function ($v) { - $v['point_to_groups'] = $v['pointToGroups']; - unset($v['pointToGroups']); - - return $v; - }) - ->end() - ->end() - ->arrayNode('codeclimate') - ->addDefaultsIfNotSet() - ->info('Configure Codeclimate output formatters') - ->children() - ->arrayNode('severity') - ->info('Map how failures, skipped and uncovered dependencies map to severity in CodeClimate') - ->addDefaultsIfNotSet() - ->children() - ->enumNode('failure')->values(['info', 'minor', 'major', 'critical', 'blocker'])->defaultValue('major')->end() - ->enumNode('skipped')->values(['info', 'minor', 'major', 'critical', 'blocker'])->defaultValue('minor')->end() - ->enumNode('uncovered')->values(['info', 'minor', 'major', 'critical', 'blocker'])->defaultValue('info')->end() - ->end() - ->end() - ->end() - ->end() - ->end() - ->end() - ->end(); + $node->fixXmlConfig('formatter')->children()->arrayNode('formatters')->addDefaultsIfNotSet()->children()->arrayNode('graphviz')->info('Configure Graphviz output formatters')->addDefaultsIfNotSet()->children()->arrayNode('hidden_layers')->info('Specify any layer name, that you wish to exclude from the output')->scalarPrototype()->end()->end()->arrayNode('groups')->info('Combine multiple layers to a group')->useAttributeAsKey('name')->arrayPrototype()->scalarPrototype()->end()->end()->end()->booleanNode('point_to_groups')->info('When a layer is part of a group, should edges point towards the group or the layer?')->defaultFalse()->end()->end()->beforeNormalization()->ifTrue(static fn($v) => is_array($v) && array_key_exists('pointToGroups', $v))->then(static function ($v) { + $v['point_to_groups'] = $v['pointToGroups']; + unset($v['pointToGroups']); + return $v; + })->end()->end()->arrayNode('codeclimate')->addDefaultsIfNotSet()->info('Configure Codeclimate output formatters')->children()->arrayNode('severity')->info('Map how failures, skipped and uncovered dependencies map to severity in CodeClimate')->addDefaultsIfNotSet()->children()->enumNode('failure')->values(['info', 'minor', 'major', 'critical', 'blocker'])->defaultValue('major')->end()->enumNode('skipped')->values(['info', 'minor', 'major', 'critical', 'blocker'])->defaultValue('minor')->end()->enumNode('uncovered')->values(['info', 'minor', 'major', 'critical', 'blocker'])->defaultValue('info')->end()->end()->end()->end()->end()->end()->end()->end(); } - /** * @throws InvalidArgumentException * @throws RuntimeException */ - private function appendEmitterTypes(ArrayNodeDefinition $node): void + private function appendEmitterTypes(ArrayNodeDefinition $node) : void { - $node - ->children() - ->arrayNode('analyser') - ->addDefaultsIfNotSet() - ->children() - ->arrayNode('types') - ->isRequired() - ->defaultValue([ - EmitterType::CLASS_TOKEN->value, - EmitterType::FUNCTION_TOKEN->value, - ]) - ->scalarPrototype() - ->beforeNormalization() - ->ifNotInArray(EmitterType::values()) - ->thenInvalid('Invalid type %s') - ->end() - ->end() - ->end() - ->end() - ->end() - ->end(); + $node->children()->arrayNode('analyser')->addDefaultsIfNotSet()->children()->arrayNode('types')->isRequired()->defaultValue([EmitterType::CLASS_TOKEN->value, EmitterType::FUNCTION_TOKEN->value])->scalarPrototype()->beforeNormalization()->ifNotInArray(EmitterType::values())->thenInvalid('Invalid type %s')->end()->end()->end()->end()->end()->end(); } - - private function appendIgnoreUncoveredInternalClasses(ArrayNodeDefinition $node): void + private function appendIgnoreUncoveredInternalClasses(ArrayNodeDefinition $node) : void { - $node - ->children() - ->booleanNode('ignore_uncovered_internal_classes') - ->defaultTrue() - ->end() - ->end(); + $node->children()->booleanNode('ignore_uncovered_internal_classes')->defaultTrue()->end()->end(); } } diff --git a/src/Supportive/DependencyInjection/DeptracExtension.php b/src/Supportive/DependencyInjection/DeptracExtension.php index 64a2efce4..0ffcfdc00 100644 --- a/src/Supportive/DependencyInjection/DeptracExtension.php +++ b/src/Supportive/DependencyInjection/DeptracExtension.php @@ -1,27 +1,23 @@ processConfiguration($configuration, $configs); - $container->setParameter('paths', $configs['paths']); $container->setParameter('exclude_files', $configs['exclude_files']); $container->setParameter('layers', $configs['layers']); @@ -31,8 +27,7 @@ public function load(array $configs, ContainerBuilder $container): void $container->setParameter('analyser', $configs['analyser']); $container->setParameter('ignore_uncovered_internal_classes', $configs['ignore_uncovered_internal_classes']); } - - public function prepend(ContainerBuilder $container): void + public function prepend(ContainerBuilder $container) : void { if (!$container->hasParameter('projectDirectory')) { $container->setParameter('projectDirectory', getcwd()); @@ -59,7 +54,7 @@ public function prepend(ContainerBuilder $container): void $container->setParameter('analyser', ['types' => [EmitterType::CLASS_TOKEN->value, EmitterType::FUNCTION_TOKEN->value]]); } if (!$container->hasParameter('ignore_uncovered_internal_classes')) { - $container->setParameter('ignore_uncovered_internal_classes', true); + $container->setParameter('ignore_uncovered_internal_classes', \true); } } } diff --git a/src/Supportive/DependencyInjection/Exception/CacheFileException.php b/src/Supportive/DependencyInjection/Exception/CacheFileException.php index 5191dd93d..192ddcb7e 100644 --- a/src/Supportive/DependencyInjection/Exception/CacheFileException.php +++ b/src/Supportive/DependencyInjection/Exception/CacheFileException.php @@ -1,17 +1,15 @@ getPathname())); + return new self(\sprintf('Cache file "%s" is not writable.', $cacheFile->getPathname())); } } diff --git a/src/Supportive/DependencyInjection/Exception/CannotLoadConfiguration.php b/src/Supportive/DependencyInjection/Exception/CannotLoadConfiguration.php index d38e90b2d..877e28062 100644 --- a/src/Supportive/DependencyInjection/Exception/CannotLoadConfiguration.php +++ b/src/Supportive/DependencyInjection/Exception/CannotLoadConfiguration.php @@ -1,26 +1,22 @@ workingDirectory); } - $builder->configFile = new SplFileInfo($configFile); - return $builder; } - - public function withCache(?string $cacheFile): self + public function withCache(?string $cacheFile) : self { if (null === $cacheFile) { return $this; } - $builder = clone $this; - if (Path::isRelative($cacheFile)) { /** @throws void */ $cacheFile = Path::makeAbsolute($cacheFile, $this->workingDirectory); } - $builder->cacheFile = new SplFileInfo($cacheFile); - return $builder; } - - public function clearCache(?string $cacheFile): self + public function clearCache(?string $cacheFile) : self { if (null === $cacheFile) { return $this; } - $builder = clone $this; - if (Path::isRelative($cacheFile)) { /** @throws void */ $cacheFile = Path::makeAbsolute($cacheFile, $this->workingDirectory); } - - unlink($cacheFile); - + \unlink($cacheFile); return $builder; } - /** * @throws CacheFileException * @throws CannotLoadConfiguration */ - public function build(): ContainerBuilder + public function build() : ContainerBuilder { $container = new ContainerBuilder(); - $container->setParameter('currentWorkingDirectory', $this->workingDirectory); - self::registerCompilerPasses($container); self::loadServices($container, $this->cacheFile); - - $container->registerExtension(new DeptracExtension()); - + $container->registerExtension(new \Qossmic\Deptrac\Supportive\DependencyInjection\DeptracExtension()); $container->setParameter('projectDirectory', $this->workingDirectory); if (null !== $this->configFile) { self::loadConfiguration($container, $this->configFile); } - - $container->compile(true); - + $container->compile(\true); return $container; } - - private static function registerCompilerPasses(ContainerBuilder $container): void + private static function registerCompilerPasses(ContainerBuilder $container) : void { $container->addCompilerPass(new AddConsoleCommandPass()); $container->addCompilerPass(new RegisterListenersPass()); } - /** * @throws CacheFileException * @throws CannotLoadConfiguration */ - private static function loadServices(ContainerBuilder $container, ?SplFileInfo $cacheFile): void + private static function loadServices(ContainerBuilder $container, ?SplFileInfo $cacheFile) : void { - $loader = new PhpFileLoader($container, new FileLocator([__DIR__.'/../../../config'])); - + $loader = new PhpFileLoader($container, new FileLocator([__DIR__ . '/../../../config'])); try { $loader->load('services.php'); } catch (Exception $exception) { throw CannotLoadConfiguration::fromServices('services.php', $exception->getMessage()); } - if (!$cacheFile instanceof SplFileInfo) { return; } - - if (!file_exists($cacheFile->getPathname())) { + if (!\file_exists($cacheFile->getPathname())) { $dirname = $cacheFile->getPath() ?: '.'; - - if (!is_dir($dirname) - && mkdir($dirname.'/', 0777, true) - && !is_dir($dirname) - ) { + if (!\is_dir($dirname) && \mkdir($dirname . '/', 0777, \true) && !\is_dir($dirname)) { throw CacheFileException::notWritable($cacheFile); } - - if (!touch($cacheFile->getPathname()) - && !is_writable($cacheFile->getPathname()) - ) { + if (!\touch($cacheFile->getPathname()) && !\is_writable($cacheFile->getPathname())) { throw CacheFileException::notWritable($cacheFile); } } - $container->setParameter('deptrac.cache_file', $cacheFile->getPathname()); try { $loader->load('cache.php'); @@ -153,25 +117,18 @@ private static function loadServices(ContainerBuilder $container, ?SplFileInfo $ throw CannotLoadConfiguration::fromCache('cache.php', $exception->getMessage()); } } - /** * @throws CannotLoadConfiguration */ - private static function loadConfiguration(ContainerBuilder $container, SplFileInfo $configFile): void + private static function loadConfiguration(ContainerBuilder $container, SplFileInfo $configFile) : void { $configPathInfo = $configFile->getPathInfo(); /** @phpstan-ignore-next-line false positive */ if (null === $configPathInfo) { throw CannotLoadConfiguration::fromConfig($configFile->getFilename(), 'Unable to load config: Invalid or missing path.'); } - $container->setParameter('projectDirectory', $configPathInfo->getPathname()); - - $loader = new DelegatingLoader(new LoaderResolver([ - new YamlFileLoader($container, new FileLocator([$configPathInfo->getPathname()])), - new PhpFileLoader($container, new FileLocator([$configPathInfo->getPathname()]), generator: new ConfigBuilderGenerator('.')), - ])); - + $loader = new DelegatingLoader(new LoaderResolver([new YamlFileLoader($container, new FileLocator([$configPathInfo->getPathname()])), new PhpFileLoader($container, new FileLocator([$configPathInfo->getPathname()]), generator: new ConfigBuilderGenerator('.'))])); try { $loader->load($configFile->getFilename()); } catch (Exception $exception) { diff --git a/src/Supportive/File/Dumper.php b/src/Supportive/File/Dumper.php index c8ca62941..17efb0f97 100644 --- a/src/Supportive/File/Dumper.php +++ b/src/Supportive/File/Dumper.php @@ -1,7 +1,6 @@ templateFile = new SplFileInfo($templateFile); } - /** * @throws FileAlreadyExistsException * @throws FileNotWritableException * @throws FileNotExistsException * @throws IOException */ - public function dump(string $file): void + public function dump(string $file) : void { $filesystem = new Filesystem(); $target = new SplFileInfo($file); - if ($filesystem->exists($target->getPathname())) { throw FileAlreadyExistsException::alreadyExists($target); } if (!is_writable($target->getPath())) { throw FileNotWritableException::notWritable($target); } - try { $filesystem->copy($this->templateFile->getPathname(), $target->getPathname()); } catch (FileNotFoundException) { diff --git a/src/Supportive/File/Exception/CouldNotReadFileException.php b/src/Supportive/File/Exception/CouldNotReadFileException.php index 67325beeb..04a155863 100644 --- a/src/Supportive/File/Exception/CouldNotReadFileException.php +++ b/src/Supportive/File/Exception/CouldNotReadFileException.php @@ -1,19 +1,14 @@ getPathname()))); } diff --git a/src/Supportive/File/Exception/FileCannotBeParsedAsYamlException.php b/src/Supportive/File/Exception/FileCannotBeParsedAsYamlException.php index 2881b0431..543eeb68f 100644 --- a/src/Supportive/File/Exception/FileCannotBeParsedAsYamlException.php +++ b/src/Supportive/File/Exception/FileCannotBeParsedAsYamlException.php @@ -1,24 +1,18 @@ getMessage() - )); + return new self(\sprintf('File "%s" cannot be parsed as YAML: %s', $filename, $exception->getMessage())); } } diff --git a/src/Supportive/File/Exception/FileNotExistsException.php b/src/Supportive/File/Exception/FileNotExistsException.php index 171cc39ff..c14fb0ef5 100644 --- a/src/Supportive/File/Exception/FileNotExistsException.php +++ b/src/Supportive/File/Exception/FileNotExistsException.php @@ -1,16 +1,14 @@ getPathname()))); } diff --git a/src/Supportive/File/Exception/IOException.php b/src/Supportive/File/Exception/IOException.php index 55187ab41..d43d28794 100644 --- a/src/Supportive/File/Exception/IOException.php +++ b/src/Supportive/File/Exception/IOException.php @@ -1,15 +1,13 @@ getPathname()))); } diff --git a/src/Supportive/File/Exception/ParsedYamlIsNotAnArrayException.php b/src/Supportive/File/Exception/ParsedYamlIsNotAnArrayException.php index a7a70a137..633b4a540 100644 --- a/src/Supportive/File/Exception/ParsedYamlIsNotAnArrayException.php +++ b/src/Supportive/File/Exception/ParsedYamlIsNotAnArrayException.php @@ -1,22 +1,17 @@ , services: array, imports?: array} $data */ return $data; } diff --git a/src/Supportive/OutputFormatter/BaselineOutputFormatter.php b/src/Supportive/OutputFormatter/BaselineOutputFormatter.php index e031d6c07..0e5a56a53 100644 --- a/src/Supportive/OutputFormatter/BaselineOutputFormatter.php +++ b/src/Supportive/OutputFormatter/BaselineOutputFormatter.php @@ -1,7 +1,6 @@ collectViolations($result); - foreach ($groupedViolations as &$violations) { sort($violations); } - ksort($groupedViolations); $baselineFile = $outputFormatterInput->outputPath ?? self::DEFAULT_PATH; - $dirname = dirname($baselineFile); - if (!is_dir($dirname) && mkdir($dirname.'/', 0777, true) && !is_dir($dirname)) { - $output->writeLineFormatted('Unable to create '.realpath($baselineFile).''); - + $dirname = \dirname($baselineFile); + if (!\is_dir($dirname) && \mkdir($dirname . '/', 0777, \true) && !\is_dir($dirname)) { + $output->writeLineFormatted('Unable to create ' . \realpath($baselineFile) . ''); return; } - file_put_contents( - $baselineFile, - Yaml::dump( - [ - 'deptrac' => [ - 'skip_violations' => $groupedViolations, - ], - ], - 4, - 2 - ) - ); - $output->writeLineFormatted('Baseline dumped to '.realpath($baselineFile).''); + \file_put_contents($baselineFile, Yaml::dump(['deptrac' => ['skip_violations' => $groupedViolations]], 4, 2)); + $output->writeLineFormatted('Baseline dumped to ' . \realpath($baselineFile) . ''); } - /** * @return array> */ - private function collectViolations(OutputResult $result): array + private function collectViolations(OutputResult $result) : array { $violations = []; foreach ([...$result->allOf(Violation::class), ...$result->allOf(SkippedViolation::class)] as $rule) { $dependency = $rule->getDependency(); $dependerClass = $dependency->getDepender()->toString(); $dependentClass = $dependency->getDependent()->toString(); - - if (!array_key_exists($dependerClass, $violations)) { + if (!\array_key_exists($dependerClass, $violations)) { $violations[$dependerClass] = []; } - $violations[$dependerClass][$dependentClass] = $dependentClass; } - - return array_map( - static fn (array $dependencies): array => array_values($dependencies), - $violations - ); + return \array_map(static fn(array $dependencies): array => array_values($dependencies), $violations); } } diff --git a/src/Supportive/OutputFormatter/CodeclimateOutputFormatter.php b/src/Supportive/OutputFormatter/CodeclimateOutputFormatter.php index d2fb0b2be..d0d004b5c 100644 --- a/src/Supportive/OutputFormatter/CodeclimateOutputFormatter.php +++ b/src/Supportive/OutputFormatter/CodeclimateOutputFormatter.php @@ -1,7 +1,6 @@ getConfigFor('codeclimate'); $this->config = $extractedConfig; } - - public static function getName(): string + public static function getName() : string { return 'codeclimate'; } - /** * {@inheritdoc} * * @throws Exception */ - public function finish( - OutputResult $result, - OutputInterface $output, - OutputFormatterInput $outputFormatterInput - ): void { + public function finish(OutputResult $result, OutputInterface $output, OutputFormatterInput $outputFormatterInput) : void + { $formatterConfig = ConfigurationCodeclimate::fromArray($this->config); - $violations = []; - if ($outputFormatterInput->reportSkipped) { foreach ($result->allOf(SkippedViolation::class) as $rule) { $this->addSkipped($violations, $rule, $formatterConfig); @@ -71,140 +59,75 @@ public function finish( foreach ($result->allOf(Violation::class) as $rule) { $this->addFailure($violations, $rule, $formatterConfig); } - $json = json_encode($violations, JSON_PRETTY_PRINT); - - if (false === $json) { + if (\false === $json) { throw new Exception(sprintf('Unable to render codeclimate output. %s', $this->jsonLastError())); } - $dumpJsonPath = $outputFormatterInput->outputPath; if (null !== $dumpJsonPath) { - file_put_contents($dumpJsonPath, $json); - $output->writeLineFormatted('Codeclimate Report dumped to '.realpath($dumpJsonPath).''); - + \file_put_contents($dumpJsonPath, $json); + $output->writeLineFormatted('Codeclimate Report dumped to ' . \realpath($dumpJsonPath) . ''); return; } - $output->writeRaw($json); } - /** * @param array, severity: string, location: array{path: string, lines: array{begin: int}}}> $violationsArray */ - private function addFailure(array &$violationsArray, Violation $violation, ConfigurationCodeclimate $config): void + private function addFailure(array &$violationsArray, Violation $violation, ConfigurationCodeclimate $config) : void { - $violationsArray[] = $this->buildRuleArray( - $violation, - $this->getFailureMessage($violation), - $config->getSeverity('failure') ?? 'major' - ); + $violationsArray[] = $this->buildRuleArray($violation, $this->getFailureMessage($violation), $config->getSeverity('failure') ?? 'major'); } - - private function getFailureMessage(Violation $violation): string + private function getFailureMessage(Violation $violation) : string { $dependency = $violation->getDependency(); - - return sprintf( - '%s must not depend on %s (%s on %s)', - $dependency->getDepender()->toString(), - $dependency->getDependent()->toString(), - $violation->getDependerLayer(), - $violation->getDependentLayer() - ); + return sprintf('%s must not depend on %s (%s on %s)', $dependency->getDepender()->toString(), $dependency->getDependent()->toString(), $violation->getDependerLayer(), $violation->getDependentLayer()); } - /** * @param array, severity: string, location: array{path: string, lines: array{begin: int}}}> $violationsArray */ - private function addSkipped(array &$violationsArray, SkippedViolation $violation, ConfigurationCodeclimate $config): void + private function addSkipped(array &$violationsArray, SkippedViolation $violation, ConfigurationCodeclimate $config) : void { - $violationsArray[] = $this->buildRuleArray( - $violation, - $this->getWarningMessage($violation), - $config->getSeverity('skipped') ?? 'minor' - ); + $violationsArray[] = $this->buildRuleArray($violation, $this->getWarningMessage($violation), $config->getSeverity('skipped') ?? 'minor'); } - - private function getWarningMessage(SkippedViolation $violation): string + private function getWarningMessage(SkippedViolation $violation) : string { $dependency = $violation->getDependency(); - - return sprintf( - '%s should not depend on %s (%s on %s)', - $dependency->getDepender()->toString(), - $dependency->getDependent()->toString(), - $violation->getDependerLayer(), - $violation->getDependentLayer() - ); + return sprintf('%s should not depend on %s (%s on %s)', $dependency->getDepender()->toString(), $dependency->getDependent()->toString(), $violation->getDependerLayer(), $violation->getDependentLayer()); } - /** * @param array, severity: string, location: array{path: string, lines: array{begin: int}}}> $violationsArray */ - private function addUncovered(array &$violationsArray, Uncovered $violation, ConfigurationCodeclimate $config): void + private function addUncovered(array &$violationsArray, Uncovered $violation, ConfigurationCodeclimate $config) : void { - $violationsArray[] = $this->buildRuleArray( - $violation, - $this->getUncoveredMessage($violation), - $config->getSeverity('uncovered') ?? 'info' - ); + $violationsArray[] = $this->buildRuleArray($violation, $this->getUncoveredMessage($violation), $config->getSeverity('uncovered') ?? 'info'); } - - private function getUncoveredMessage(Uncovered $violation): string + private function getUncoveredMessage(Uncovered $violation) : string { $dependency = $violation->getDependency(); - - return sprintf( - '%s has uncovered dependency on %s (%s)', - $dependency->getDepender()->toString(), - $dependency->getDependent()->toString(), - $violation->layer - ); + return sprintf('%s has uncovered dependency on %s (%s)', $dependency->getDepender()->toString(), $dependency->getDependent()->toString(), $violation->layer); } - - private function jsonLastError(): string + private function jsonLastError() : string { return match (json_last_error()) { - JSON_ERROR_NONE => 'No errors', - JSON_ERROR_DEPTH => 'Maximum stack depth exceeded', - JSON_ERROR_STATE_MISMATCH => 'Underflow or the modes mismatch', - JSON_ERROR_CTRL_CHAR => 'Unexpected control character found', - JSON_ERROR_SYNTAX => 'Syntax error, malformed JSON', - JSON_ERROR_UTF8 => 'Malformed UTF-8 characters, possibly incorrectly encoded', + \JSON_ERROR_NONE => 'No errors', + \JSON_ERROR_DEPTH => 'Maximum stack depth exceeded', + \JSON_ERROR_STATE_MISMATCH => 'Underflow or the modes mismatch', + \JSON_ERROR_CTRL_CHAR => 'Unexpected control character found', + \JSON_ERROR_SYNTAX => 'Syntax error, malformed JSON', + \JSON_ERROR_UTF8 => 'Malformed UTF-8 characters, possibly incorrectly encoded', default => 'Unknown error', }; } - /** * @return array{type: string, check_name: string, fingerprint: string, description: string, categories: array, severity: string, location: array{path: string, lines: array{begin: int}}} */ - private function buildRuleArray(RuleInterface $rule, string $message, string $severity): array + private function buildRuleArray(RuleInterface $rule, string $message, string $severity) : array { - return [ - 'type' => 'issue', - 'check_name' => 'Dependency violation', - 'fingerprint' => $this->buildFingerprint($rule), - 'description' => $message, - 'categories' => ['Style', 'Complexity'], - 'severity' => $severity, - 'location' => [ - 'path' => $rule->getDependency()->getFileOccurrence()->filepath, - 'lines' => [ - 'begin' => $rule->getDependency()->getFileOccurrence()->line, - ], - ], - ]; + return ['type' => 'issue', 'check_name' => 'Dependency violation', 'fingerprint' => $this->buildFingerprint($rule), 'description' => $message, 'categories' => ['Style', 'Complexity'], 'severity' => $severity, 'location' => ['path' => $rule->getDependency()->getFileOccurrence()->filepath, 'lines' => ['begin' => $rule->getDependency()->getFileOccurrence()->line]]]; } - - private function buildFingerprint(RuleInterface $rule): string + private function buildFingerprint(RuleInterface $rule) : string { - return sha1(implode(',', [ - $rule::class, - $rule->getDependency()->getDepender()->toString(), - $rule->getDependency()->getDependent()->toString(), - $rule->getDependency()->getFileOccurrence()->filepath, - $rule->getDependency()->getFileOccurrence()->line, - ])); + return \sha1(\implode(',', [$rule::class, $rule->getDependency()->getDepender()->toString(), $rule->getDependency()->getDependent()->toString(), $rule->getDependency()->getFileOccurrence()->filepath, $rule->getDependency()->getFileOccurrence()->line])); } } diff --git a/src/Supportive/OutputFormatter/Configuration/ConfigurationCodeclimate.php b/src/Supportive/OutputFormatter/Configuration/ConfigurationCodeclimate.php index fda31cade..cbdc7e028 100644 --- a/src/Supportive/OutputFormatter/Configuration/ConfigurationCodeclimate.php +++ b/src/Supportive/OutputFormatter/Configuration/ConfigurationCodeclimate.php @@ -1,7 +1,6 @@ severityMap[$key] ?? null; } diff --git a/src/Supportive/OutputFormatter/Configuration/ConfigurationGraphViz.php b/src/Supportive/OutputFormatter/Configuration/ConfigurationGraphViz.php index 5b914c193..9bdcba9b3 100644 --- a/src/Supportive/OutputFormatter/Configuration/ConfigurationGraphViz.php +++ b/src/Supportive/OutputFormatter/Configuration/ConfigurationGraphViz.php @@ -1,7 +1,6 @@ , point_to_groups?: bool} $arr */ - public static function fromArray(array $arr): self + public static function fromArray(array $arr) : self { - return new self($arr['hidden_layers'] ?? [], $arr['groups'] ?? [], $arr['point_to_groups'] ?? false); + return new self($arr['hidden_layers'] ?? [], $arr['groups'] ?? [], $arr['point_to_groups'] ?? \false); } - /** * @param string[] $hiddenLayers * @param array $groupsLayerMap */ - private function __construct( - public readonly array $hiddenLayers, - public readonly array $groupsLayerMap, - public readonly bool $pointToGroups - ) {} + private function __construct(public readonly array $hiddenLayers, public readonly array $groupsLayerMap, public readonly bool $pointToGroups) + { + } } diff --git a/src/Supportive/OutputFormatter/Configuration/FormatterConfiguration.php b/src/Supportive/OutputFormatter/Configuration/FormatterConfiguration.php index 9a334000c..229b79ff5 100644 --- a/src/Supportive/OutputFormatter/Configuration/FormatterConfiguration.php +++ b/src/Supportive/OutputFormatter/Configuration/FormatterConfiguration.php @@ -1,7 +1,6 @@ > $config */ - public function __construct(private readonly array $config) {} - + public function __construct(private readonly array $config) + { + } /** * @return array */ - public function getConfigFor(string $area): array + public function getConfigFor(string $area) : array { return $this->config[$area] ?? []; } diff --git a/src/Supportive/OutputFormatter/ConsoleOutputFormatter.php b/src/Supportive/OutputFormatter/ConsoleOutputFormatter.php index 46276d251..13c9eaefa 100644 --- a/src/Supportive/OutputFormatter/ConsoleOutputFormatter.php +++ b/src/Supportive/OutputFormatter/ConsoleOutputFormatter.php @@ -1,7 +1,6 @@ allOf(Violation::class) as $rule) { $this->printViolation($rule, $output); } - if ($outputFormatterInput->reportSkipped) { foreach ($result->allOf(SkippedViolation::class) as $rule) { $this->printViolation($rule, $output); } } - if ($outputFormatterInput->reportUncovered) { $this->printUncovered($result, $output); } - if ($result->hasErrors()) { $this->printErrors($result, $output); } - if ($result->hasWarnings()) { $this->printWarnings($result, $output); } - $this->printSummary($result, $output); } - - private function printViolation(Violation|SkippedViolation $rule, OutputInterface $output): void + private function printViolation(Violation|SkippedViolation $rule, OutputInterface $output) : void { $dependency = $rule->getDependency(); - - $output->writeLineFormatted( - sprintf( - '%s%s must not depend on %s (%s on %s)', - $rule instanceof SkippedViolation ? '[SKIPPED] ' : '', - $dependency->getDepender() - ->toString(), - $dependency->getDependent() - ->toString(), - $rule->getDependerLayer(), - $rule->getDependentLayer() - ) - ); + $output->writeLineFormatted(\sprintf('%s%s must not depend on %s (%s on %s)', $rule instanceof SkippedViolation ? '[SKIPPED] ' : '', $dependency->getDepender()->toString(), $dependency->getDependent()->toString(), $rule->getDependerLayer(), $rule->getDependentLayer())); $this->printFileOccurrence($output, $dependency->getFileOccurrence()); - if (count($dependency->serialize()) > 1) { $this->printMultilinePath($output, $dependency); } } - - private function printMultilinePath(OutputInterface $output, DependencyInterface $dep): void + private function printMultilinePath(OutputInterface $output, DependencyInterface $dep) : void { - $buffer = implode( - " -> \n", - array_map( - static fn (array $dependency): string => sprintf("\t%s::%d", $dependency['name'], $dependency['line']), - $dep->serialize() - ) - ); - + $buffer = \implode(" -> \n", \array_map(static fn(array $dependency): string => \sprintf("\t%s::%d", $dependency['name'], $dependency['line']), $dep->serialize())); $output->writeLineFormatted($buffer); } - - private function printSummary(OutputResult $result, OutputInterface $output): void + private function printSummary(OutputResult $result, OutputInterface $output) : void { $violationCount = count($result->violations()); $skippedViolationCount = count($result->skippedViolations()); @@ -99,93 +64,47 @@ private function printSummary(OutputResult $result, OutputInterface $output): vo $allowedCount = count($result->allowed()); $warningsCount = count($result->warnings); $errorsCount = count($result->errors); - $output->writeLineFormatted(''); $output->writeLineFormatted('Report:'); - $output->writeLineFormatted( - sprintf( - 'Violations: %d', - $violationCount > 0 ? 'red' : 'default', - $violationCount - ) - ); - $output->writeLineFormatted( - sprintf( - 'Skipped violations: %d', - $skippedViolationCount > 0 ? 'yellow' : 'default', - $skippedViolationCount - ) - ); - $output->writeLineFormatted( - sprintf( - 'Uncovered: %d', - $uncoveredCount > 0 ? 'yellow' : 'default', - $uncoveredCount - ) - ); - $output->writeLineFormatted(sprintf('Allowed: %d', $allowedCount)); - $output->writeLineFormatted( - sprintf( - 'Warnings: %d', - $warningsCount > 0 ? 'yellow' : 'default', - $warningsCount - ) - ); - $output->writeLineFormatted( - sprintf( - 'Errors: %d', - $errorsCount > 0 ? 'red' : 'default', - $errorsCount - ) - ); + $output->writeLineFormatted(\sprintf('Violations: %d', $violationCount > 0 ? 'red' : 'default', $violationCount)); + $output->writeLineFormatted(\sprintf('Skipped violations: %d', $skippedViolationCount > 0 ? 'yellow' : 'default', $skippedViolationCount)); + $output->writeLineFormatted(\sprintf('Uncovered: %d', $uncoveredCount > 0 ? 'yellow' : 'default', $uncoveredCount)); + $output->writeLineFormatted(\sprintf('Allowed: %d', $allowedCount)); + $output->writeLineFormatted(\sprintf('Warnings: %d', $warningsCount > 0 ? 'yellow' : 'default', $warningsCount)); + $output->writeLineFormatted(\sprintf('Errors: %d', $errorsCount > 0 ? 'red' : 'default', $errorsCount)); } - - private function printUncovered(OutputResult $result, OutputInterface $output): void + private function printUncovered(OutputResult $result, OutputInterface $output) : void { $uncovered = $result->uncovered(); if ([] === $uncovered) { return; } - $output->writeLineFormatted('Uncovered dependencies:'); foreach ($uncovered as $u) { $dependency = $u->getDependency(); - $output->writeLineFormatted( - sprintf( - '%s has uncovered dependency on %s (%s)', - $dependency->getDepender() - ->toString(), - $dependency->getDependent() - ->toString(), - $u->layer - ) - ); + $output->writeLineFormatted(\sprintf('%s has uncovered dependency on %s (%s)', $dependency->getDepender()->toString(), $dependency->getDependent()->toString(), $u->layer)); $this->printFileOccurrence($output, $dependency->getFileOccurrence()); - if (count($dependency->serialize()) > 1) { $this->printMultilinePath($output, $dependency); } } } - - private function printFileOccurrence(OutputInterface $output, FileOccurrence $fileOccurrence): void + private function printFileOccurrence(OutputInterface $output, FileOccurrence $fileOccurrence) : void { - $output->writeLineFormatted($fileOccurrence->filepath.'::'.$fileOccurrence->line); + $output->writeLineFormatted($fileOccurrence->filepath . '::' . $fileOccurrence->line); } - - private function printErrors(OutputResult $result, OutputInterface $output): void + private function printErrors(OutputResult $result, OutputInterface $output) : void { $output->writeLineFormatted(''); foreach ($result->errors as $error) { - $output->writeLineFormatted(sprintf('[ERROR] %s', (string) $error)); + $output->writeLineFormatted(\sprintf('[ERROR] %s', (string) $error)); } } - - private function printWarnings(OutputResult $result, OutputInterface $output): void + private function printWarnings(OutputResult $result, OutputInterface $output) : void { $output->writeLineFormatted(''); foreach ($result->warnings as $warning) { - $output->writeLineFormatted(sprintf('[WARNING] %s', (string) $warning)); + $output->writeLineFormatted(\sprintf('[WARNING] %s', (string) $warning)); } } } diff --git a/src/Supportive/OutputFormatter/FormatterProvider.php b/src/Supportive/OutputFormatter/FormatterProvider.php index 363ad7118..7b450f15b 100644 --- a/src/Supportive/OutputFormatter/FormatterProvider.php +++ b/src/Supportive/OutputFormatter/FormatterProvider.php @@ -1,48 +1,40 @@ $formatterLocator */ - public function __construct( - private readonly ServiceLocator $formatterLocator - ) {} - - public function get(string $id): OutputFormatterInterface + public function __construct(private readonly ServiceLocator $formatterLocator) + { + } + public function get(string $id) : OutputFormatterInterface { $service = $this->formatterLocator->get($id); - if (!$service instanceof OutputFormatterInterface) { throw InvalidServiceInLocatorException::invalidType($id, OutputFormatterInterface::class, get_debug_type($service)); } - return $service; } - - public function has(string $id): bool + public function has(string $id) : bool { return $this->formatterLocator->has($id); } - /** * @psalm-suppress MixedReturnTypeCoercion * * @return string[] */ - public function getKnownFormatters(): array + public function getKnownFormatters() : array { return array_keys($this->formatterLocator->getProvidedServices()); } diff --git a/src/Supportive/OutputFormatter/GithubActionsOutputFormatter.php b/src/Supportive/OutputFormatter/GithubActionsOutputFormatter.php index 1d982add8..d9f7b84ed 100644 --- a/src/Supportive/OutputFormatter/GithubActionsOutputFormatter.php +++ b/src/Supportive/OutputFormatter/GithubActionsOutputFormatter.php @@ -10,46 +10,39 @@ use Qossmic\Deptrac\Contract\Result\RuleInterface; use Qossmic\Deptrac\Contract\Result\SkippedViolation; use Qossmic\Deptrac\Contract\Result\Violation; - final class GithubActionsOutputFormatter implements OutputFormatterInterface { /** * {@inheritdoc} */ - public static function getName(): string + public static function getName() : string { return 'github-actions'; } - /** * {@inheritdoc} */ - public function finish(OutputResult $result, OutputInterface $output, OutputFormatterInput $outputFormatterInput): void + public function finish(OutputResult $result, OutputInterface $output, OutputFormatterInput $outputFormatterInput) : void { foreach ($result->allOf(Violation::class) as $rule) { $this->printViolation($rule, $output); } - if ($outputFormatterInput->reportSkipped) { foreach ($result->allOf(SkippedViolation::class) as $rule) { $this->printViolation($rule, $output); } } - if ($outputFormatterInput->reportUncovered) { $this->printUncovered($result, $output, $outputFormatterInput->failOnUncovered); } - if ($result->hasErrors()) { $this->printErrors($result, $output); } - if ($result->hasWarnings()) { $this->printWarnings($result, $output); } } - - private function determineLogLevel(RuleInterface $rule): string + private function determineLogLevel(RuleInterface $rule) : string { return match ($rule::class) { Violation::class => 'error', @@ -57,77 +50,36 @@ private function determineLogLevel(RuleInterface $rule): string default => 'debug', }; } - - private function printUncovered(OutputResult $result, OutputInterface $output, bool $reportAsError): void + private function printUncovered(OutputResult $result, OutputInterface $output, bool $reportAsError) : void { foreach ($result->uncovered() as $u) { $dependency = $u->getDependency(); - $output->writeLineFormatted( - sprintf( - '::%s file=%s,line=%s::%s has uncovered dependency on %s (%s)', - $reportAsError ? 'error' : 'warning', - $dependency->getFileOccurrence()->filepath, - $dependency->getFileOccurrence()->line, - $dependency->getDepender()->toString(), - $dependency->getDependent()->toString(), - $u->layer - ) - ); + $output->writeLineFormatted(\sprintf('::%s file=%s,line=%s::%s has uncovered dependency on %s (%s)', $reportAsError ? 'error' : 'warning', $dependency->getFileOccurrence()->filepath, $dependency->getFileOccurrence()->line, $dependency->getDepender()->toString(), $dependency->getDependent()->toString(), $u->layer)); } } - - private function multilinePathMessage(DependencyInterface $dep): string + private function multilinePathMessage(DependencyInterface $dep) : string { - return implode( - ' ->%0A', - array_map( - static fn (array $dependency): string => sprintf('%s::%d', $dependency['name'], $dependency['line']), - $dep->serialize() - ) - ); + return \implode(' ->%0A', \array_map(static fn(array $dependency): string => \sprintf('%s::%d', $dependency['name'], $dependency['line']), $dep->serialize())); } - - private function printErrors(OutputResult $result, OutputInterface $output): void + private function printErrors(OutputResult $result, OutputInterface $output) : void { foreach ($result->errors as $error) { - $output->writeLineFormatted('::error ::'.(string) $error); + $output->writeLineFormatted('::error ::' . (string) $error); } } - - private function printWarnings(OutputResult $result, OutputInterface $output): void + private function printWarnings(OutputResult $result, OutputInterface $output) : void { foreach ($result->warnings as $warning) { - $output->writeLineFormatted('::warning ::'.(string) $warning); + $output->writeLineFormatted('::warning ::' . (string) $warning); } } - - private function printViolation(Violation|SkippedViolation $rule, OutputInterface $output): void + private function printViolation(Violation|SkippedViolation $rule, OutputInterface $output) : void { $dependency = $rule->getDependency(); - - $message = sprintf( - '%s%s must not depend on %s (%s on %s)', - $rule instanceof SkippedViolation ? '[SKIPPED] ' : '', - $dependency->getDepender() - ->toString(), - $dependency->getDependent() - ->toString(), - $rule->getDependerLayer(), - $rule->getDependentLayer() - ); - - if (count($dependency->serialize()) > 1) { - $message .= '%0A'.$this->multilinePathMessage($dependency); + $message = \sprintf('%s%s must not depend on %s (%s on %s)', $rule instanceof SkippedViolation ? '[SKIPPED] ' : '', $dependency->getDepender()->toString(), $dependency->getDependent()->toString(), $rule->getDependerLayer(), $rule->getDependentLayer()); + if (\count($dependency->serialize()) > 1) { + $message .= '%0A' . $this->multilinePathMessage($dependency); } - - $output->writeLineFormatted( - sprintf( - '::%s file=%s,line=%s::%s', - $this->determineLogLevel($rule), - $dependency->getFileOccurrence()->filepath, - $dependency->getFileOccurrence()->line, - $message - ) - ); + $output->writeLineFormatted(\sprintf('::%s file=%s,line=%s::%s', $this->determineLogLevel($rule), $dependency->getFileOccurrence()->filepath, $dependency->getFileOccurrence()->line, $message)); } } diff --git a/src/Supportive/OutputFormatter/GraphVizOutputDisplayFormatter.php b/src/Supportive/OutputFormatter/GraphVizOutputDisplayFormatter.php index ee727d00a..c9abe38a6 100644 --- a/src/Supportive/OutputFormatter/GraphVizOutputDisplayFormatter.php +++ b/src/Supportive/OutputFormatter/GraphVizOutputDisplayFormatter.php @@ -1,47 +1,42 @@ getTempImage($graph); static $next = 0; - if ($next > microtime(true)) { - sleep(self::DELAY_OPEN); + if ($next > \microtime(\true)) { + \sleep(self::DELAY_OPEN); } - - if ('WIN' === strtoupper(substr(PHP_OS, 0, 3))) { - exec('start "" '.escapeshellarg($filename).' >NUL'); - } elseif ('DARWIN' === strtoupper(PHP_OS)) { - exec('open '.escapeshellarg($filename).' > /dev/null 2>&1 &'); + if ('WIN' === \strtoupper(\substr(\PHP_OS, 0, 3))) { + \exec('start "" ' . \escapeshellarg($filename) . ' >NUL'); + } elseif ('DARWIN' === \strtoupper(\PHP_OS)) { + \exec('open ' . \escapeshellarg($filename) . ' > /dev/null 2>&1 &'); } else { - exec('xdg-open '.escapeshellarg($filename).' > /dev/null 2>&1 &'); + \exec('xdg-open ' . \escapeshellarg($filename) . ' > /dev/null 2>&1 &'); } - $next = microtime(true) + (float) self::DELAY_OPEN; + $next = \microtime(\true) + (float) self::DELAY_OPEN; } catch (Exception $exception) { - throw OutputException::withMessage('Unable to display output: '.$exception->getMessage()); + throw OutputException::withMessage('Unable to display output: ' . $exception->getMessage()); } } } diff --git a/src/Supportive/OutputFormatter/GraphVizOutputDotFormatter.php b/src/Supportive/OutputFormatter/GraphVizOutputDotFormatter.php index 4e8031b46..fdd077ebb 100644 --- a/src/Supportive/OutputFormatter/GraphVizOutputDotFormatter.php +++ b/src/Supportive/OutputFormatter/GraphVizOutputDotFormatter.php @@ -1,32 +1,28 @@ outputPath; if (null === $dumpDotPath) { throw OutputException::withMessage("No '--output' defined for GraphViz formatter"); } - - file_put_contents($dumpDotPath, (string) $graph); - $output->writeLineFormatted('Script dumped to '.realpath($dumpDotPath).''); + \file_put_contents($dumpDotPath, (string) $graph); + $output->writeLineFormatted('Script dumped to ' . \realpath($dumpDotPath) . ''); } } diff --git a/src/Supportive/OutputFormatter/GraphVizOutputFormatter.php b/src/Supportive/OutputFormatter/GraphVizOutputFormatter.php index 36b18c6ac..088257615 100644 --- a/src/Supportive/OutputFormatter/GraphVizOutputFormatter.php +++ b/src/Supportive/OutputFormatter/GraphVizOutputFormatter.php @@ -1,13 +1,12 @@ , point_to_groups?: bool} */ private readonly array $config; - public function __construct(FormatterConfiguration $config) { /** @var array{hidden_layers?: string[], groups?: array, point_to_groups?: bool} $extractedConfig */ $extractedConfig = $config->getConfigFor('graphviz'); $this->config = $extractedConfig; } - - public function finish( - OutputResult $result, - OutputInterface $output, - OutputFormatterInput $outputFormatterInput - ): void { + public function finish(OutputResult $result, OutputInterface $output, OutputFormatterInput $outputFormatterInput) : void + { $layerViolations = $this->calculateViolations($result->violations()); $layersDependOnLayers = $this->calculateLayerDependencies($result->allRules()); - $outputConfig = ConfigurationGraphViz::fromArray($this->config); - $graph = Graph::create(''); if ($outputConfig->pointToGroups) { $graph->setAttribute('compound', 'true'); @@ -56,53 +46,45 @@ public function finish( $this->connectEdges($graph, $nodes, $outputConfig, $layersDependOnLayers, $layerViolations); $this->output($graph, $output, $outputFormatterInput); } - /** * @param Violation[] $violations * * @return array> */ - private function calculateViolations(array $violations): array + private function calculateViolations(array $violations) : array { $layerViolations = []; foreach ($violations as $violation) { if (!isset($layerViolations[$violation->getDependerLayer()])) { $layerViolations[$violation->getDependerLayer()] = []; } - if (!isset($layerViolations[$violation->getDependerLayer()][$violation->getDependentLayer()])) { $layerViolations[$violation->getDependerLayer()][$violation->getDependentLayer()] = 1; } else { ++$layerViolations[$violation->getDependerLayer()][$violation->getDependentLayer()]; } } - return $layerViolations; } - /** * @param RuleInterface[] $rules * * @return array> */ - private function calculateLayerDependencies(array $rules): array + private function calculateLayerDependencies(array $rules) : array { $layersDependOnLayers = []; - foreach ($rules as $rule) { if ($rule instanceof CoveredRuleInterface) { $layerA = $rule->getDependerLayer(); $layerB = $rule->getDependentLayer(); - if (!isset($layersDependOnLayers[$layerA])) { $layersDependOnLayers[$layerA] = []; } - if (!isset($layersDependOnLayers[$layerA][$layerB])) { $layersDependOnLayers[$layerA][$layerB] = 1; continue; } - ++$layersDependOnLayers[$layerA][$layerB]; } elseif ($rule instanceof Uncovered) { if (!isset($layersDependOnLayers[$rule->layer])) { @@ -110,28 +92,25 @@ private function calculateLayerDependencies(array $rules): array } } } - return $layersDependOnLayers; } - /** * @param array> $layersDependOnLayers * * @return Node[] */ - private function createNodes(ConfigurationGraphViz $outputConfig, array $layersDependOnLayers): array + private function createNodes(ConfigurationGraphViz $outputConfig, array $layersDependOnLayers) : array { $nodes = []; foreach ($layersDependOnLayers as $layer => $layersDependOn) { - if (in_array($layer, $outputConfig->hiddenLayers, true)) { + if (\in_array($layer, $outputConfig->hiddenLayers, \true)) { continue; } if (!isset($nodes[$layer])) { $nodes[$layer] = new Node($layer); } - foreach ($layersDependOn as $layerDependOn => $_) { - if (in_array($layerDependOn, $outputConfig->hiddenLayers, true)) { + if (\in_array($layerDependOn, $outputConfig->hiddenLayers, \true)) { continue; } if (!isset($nodes[$layerDependOn])) { @@ -139,28 +118,21 @@ private function createNodes(ConfigurationGraphViz $outputConfig, array $layersD } } } - return $nodes; } - /** * @param Node[] $nodes * @param array> $layersDependOnLayers * @param array> $layerViolations */ - private function connectEdges( - Graph $graph, - array $nodes, - ConfigurationGraphViz $outputConfig, - array $layersDependOnLayers, - array $layerViolations - ): void { + private function connectEdges(Graph $graph, array $nodes, ConfigurationGraphViz $outputConfig, array $layersDependOnLayers, array $layerViolations) : void + { foreach ($layersDependOnLayers as $layer => $layersDependOn) { - if (in_array($layer, $outputConfig->hiddenLayers, true)) { + if (\in_array($layer, $outputConfig->hiddenLayers, \true)) { continue; } foreach ($layersDependOn as $layerDependOn => $layerDependOnCount) { - if (in_array($layerDependOn, $outputConfig->hiddenLayers, true)) { + if (\in_array($layerDependOn, $outputConfig->hiddenLayers, \true)) { continue; } $edge = new Edge($nodes[$layer], $nodes[$layerDependOn]); @@ -177,54 +149,46 @@ private function connectEdges( } } } - /** * @param Node[] $nodes */ - private function addNodesToGraph(Graph $graph, array $nodes, ConfigurationGraphViz $outputConfig): void + private function addNodesToGraph(Graph $graph, array $nodes, ConfigurationGraphViz $outputConfig) : void { foreach ($outputConfig->groupsLayerMap as $groupName => $groupLayerNames) { - $subgraph = Graph::create($this->getSubgraphName($groupName)) - ->setAttribute('label', $groupName); + $subgraph = Graph::create($this->getSubgraphName($groupName))->setAttribute('label', $groupName); $graph->addGraph($subgraph); - foreach ($groupLayerNames as $groupLayerName) { - if (array_key_exists($groupLayerName, $nodes)) { + if (\array_key_exists($groupLayerName, $nodes)) { $subgraph->setNode($nodes[$groupLayerName]); $nodes[$groupLayerName]->setAttribute('group', $groupName); unset($nodes[$groupLayerName]); } } } - foreach ($nodes as $node) { $graph->setNode($node); } } - /** * @throws Exception * @throws OutputException */ - protected function getTempImage(Graph $graph): string + protected function getTempImage(Graph $graph) : string { $filename = tempnam(sys_get_temp_dir(), 'deptrac'); - if (false === $filename) { + if (\false === $filename) { throw OutputException::withMessage('Unable to create temp file for output.'); } $filename .= '.png'; $graph->export('png', $filename); - return $filename; } - - private function getSubgraphName(string $groupName): string + private function getSubgraphName(string $groupName) : string { - return 'cluster_'.$groupName; + return 'cluster_' . $groupName; } - /** * @throws OutputException */ - abstract protected function output(Graph $graph, OutputInterface $output, OutputFormatterInput $outputFormatterInput): void; + protected abstract function output(Graph $graph, OutputInterface $output, OutputFormatterInput $outputFormatterInput) : void; } diff --git a/src/Supportive/OutputFormatter/GraphVizOutputHtmlFormatter.php b/src/Supportive/OutputFormatter/GraphVizOutputHtmlFormatter.php index 11ca1d8ca..e222856d4 100644 --- a/src/Supportive/OutputFormatter/GraphVizOutputHtmlFormatter.php +++ b/src/Supportive/OutputFormatter/GraphVizOutputHtmlFormatter.php @@ -1,51 +1,43 @@ outputPath; if (null === $dumpHtmlPath) { throw OutputException::withMessage("No '--output' defined for GraphViz formatter"); } - try { $filename = $this->getTempImage($graph); $imageData = file_get_contents($filename); - if (false === $imageData) { + if (\false === $imageData) { throw OutputException::withMessage('Unable to create temp file for output.'); } - file_put_contents( - $dumpHtmlPath, - '' - ); - $output->writeLineFormatted('HTML dumped to '.realpath($dumpHtmlPath).''); + \file_put_contents($dumpHtmlPath, ''); + $output->writeLineFormatted('HTML dumped to ' . \realpath($dumpHtmlPath) . ''); } catch (Exception $exception) { - throw OutputException::withMessage('Unable to generate HTML file: '.$exception->getMessage()); + throw OutputException::withMessage('Unable to generate HTML file: ' . $exception->getMessage()); } finally { if (isset($filename)) { - unlink($filename); + \unlink($filename); } } } diff --git a/src/Supportive/OutputFormatter/GraphVizOutputImageFormatter.php b/src/Supportive/OutputFormatter/GraphVizOutputImageFormatter.php index 9fdec32ce..add80814c 100644 --- a/src/Supportive/OutputFormatter/GraphVizOutputImageFormatter.php +++ b/src/Supportive/OutputFormatter/GraphVizOutputImageFormatter.php @@ -1,34 +1,30 @@ outputPath; if (null === $dumpImagePath) { throw OutputException::withMessage("No '--output' defined for GraphViz formatter"); } - $imageFile = new SplFileInfo($dumpImagePath); $imagePathInfo = $imageFile->getPathInfo(); /** @phpstan-ignore-next-line false positive */ @@ -36,13 +32,13 @@ protected function output(Graph $graph, OutputInterface $output, OutputFormatter throw OutputException::withMessage('Unable to dump image: Invalid or missing path.'); } if (!$imagePathInfo->isWritable()) { - throw OutputException::withMessage(sprintf('Unable to dump image: Path "%s" does not exist or is not writable.', Path::canonicalize($imagePathInfo->getPathname()))); + throw OutputException::withMessage(\sprintf('Unable to dump image: Path "%s" does not exist or is not writable.', Path::canonicalize($imagePathInfo->getPathname()))); } try { $graph->export($imageFile->getExtension() ?: 'png', $imageFile->getPathname()); - $output->writeLineFormatted('Image dumped to '.$imageFile->getPathname().''); + $output->writeLineFormatted('Image dumped to ' . $imageFile->getPathname() . ''); } catch (Exception $exception) { - throw OutputException::withMessage('Unable to display output: '.$exception->getMessage()); + throw OutputException::withMessage('Unable to display output: ' . $exception->getMessage()); } } } diff --git a/src/Supportive/OutputFormatter/JUnitOutputFormatter.php b/src/Supportive/OutputFormatter/JUnitOutputFormatter.php index 7cccd3af7..1e9452df7 100644 --- a/src/Supportive/OutputFormatter/JUnitOutputFormatter.php +++ b/src/Supportive/OutputFormatter/JUnitOutputFormatter.php @@ -1,7 +1,6 @@ createXml($result); - $dumpXmlPath = $outputFormatterInput->outputPath ?? self::DEFAULT_PATH; - file_put_contents($dumpXmlPath, $xml); - $output->writeLineFormatted('JUnit Report dumped to '.realpath($dumpXmlPath).''); + \file_put_contents($dumpXmlPath, $xml); + $output->writeLineFormatted('JUnit Report dumped to ' . \realpath($dumpXmlPath) . ''); } - /** * @throws Exception */ - private function createXml(OutputResult $result): string + private function createXml(OutputResult $result) : string { - if (!class_exists(DOMDocument::class)) { + if (!\class_exists(DOMDocument::class)) { throw new Exception('Unable to create xml file (php-xml needs to be installed)'); } - $xmlDoc = new DOMDocument('1.0', 'UTF-8'); - $xmlDoc->formatOutput = true; - + $xmlDoc->formatOutput = \true; $this->addTestSuites($result, $xmlDoc); - return (string) $xmlDoc->saveXML(); } - - private function addTestSuites(OutputResult $result, DOMDocument $xmlDoc): void + private function addTestSuites(OutputResult $result, DOMDocument $xmlDoc) : void { /** @throws void */ $testSuites = $xmlDoc->createElement('testsuites'); - $xmlDoc->appendChild($testSuites); - if ($result->hasErrors()) { /** @throws void */ $testSuite = $xmlDoc->createElement('testsuite'); @@ -89,7 +74,7 @@ private function addTestSuites(OutputResult $result, DOMDocument $xmlDoc): void /** @throws void */ $testSuite->appendChild(new DOMAttr('skipped', '0')); /** @throws void */ - $testSuite->appendChild(new DOMAttr('errors', (string) count($result->errors))); + $testSuite->appendChild(new DOMAttr('errors', (string) \count($result->errors))); /** @throws void */ $testSuite->appendChild(new DOMAttr('time', '0')); foreach ($result->errors as $message) { @@ -101,14 +86,11 @@ private function addTestSuites(OutputResult $result, DOMDocument $xmlDoc): void $error->appendChild(new DOMAttr('type', 'WARNING')); $testSuite->appendChild($error); } - $testSuites->appendChild($testSuite); } - $this->addTestSuite($result, $xmlDoc, $testSuites); } - - private function addTestSuite(OutputResult $result, DOMDocument $xmlDoc, DOMElement $testSuites): void + private function addTestSuite(OutputResult $result, DOMDocument $xmlDoc, DOMElement $testSuites) : void { /** @var array> $layers */ $layers = []; @@ -119,18 +101,14 @@ private function addTestSuite(OutputResult $result, DOMDocument $xmlDoc, DOMElem $layers[$rule->layer][] = $rule; } } - $layerIndex = 0; foreach ($layers as $layer => $rules) { - $violationsByLayer = array_filter($rules, static fn (RuleInterface $rule) => $rule instanceof Violation); - - $skippedViolationsByLayer = array_filter($rules, static fn (RuleInterface $rule) => $rule instanceof SkippedViolation); - + $violationsByLayer = \array_filter($rules, static fn(RuleInterface $rule) => $rule instanceof Violation); + $skippedViolationsByLayer = \array_filter($rules, static fn(RuleInterface $rule) => $rule instanceof SkippedViolation); $rulesByClassName = []; foreach ($rules as $rule) { $rulesByClassName[$rule->getDependency()->getDepender()->toString()][] = $rule; } - /** @throws void */ $testSuite = $xmlDoc->createElement('testsuite'); /** @throws void */ @@ -142,37 +120,33 @@ private function addTestSuite(OutputResult $result, DOMDocument $xmlDoc, DOMElem /** @throws void */ $testSuite->appendChild(new DOMAttr('hostname', 'localhost')); /** @throws void */ - $testSuite->appendChild(new DOMAttr('tests', (string) count($rulesByClassName))); + $testSuite->appendChild(new DOMAttr('tests', (string) \count($rulesByClassName))); /** @throws void */ - $testSuite->appendChild(new DOMAttr('failures', (string) count($violationsByLayer))); + $testSuite->appendChild(new DOMAttr('failures', (string) \count($violationsByLayer))); /** @throws void */ - $testSuite->appendChild(new DOMAttr('skipped', (string) count($skippedViolationsByLayer))); + $testSuite->appendChild(new DOMAttr('skipped', (string) \count($skippedViolationsByLayer))); /** @throws void */ $testSuite->appendChild(new DOMAttr('errors', '0')); /** @throws void */ $testSuite->appendChild(new DOMAttr('time', '0')); - $testSuites->appendChild($testSuite); - $this->addTestCase($layer, $rulesByClassName, $xmlDoc, $testSuite); } } - /** * @param array $rulesByClassName */ - private function addTestCase(string $layer, array $rulesByClassName, DOMDocument $xmlDoc, DOMElement $testSuite): void + private function addTestCase(string $layer, array $rulesByClassName, DOMDocument $xmlDoc, DOMElement $testSuite) : void { foreach ($rulesByClassName as $className => $rules) { /** @throws void */ $testCase = $xmlDoc->createElement('testcase'); /** @throws void */ - $testCase->appendChild(new DOMAttr('name', $layer.' - '.$className)); + $testCase->appendChild(new DOMAttr('name', $layer . ' - ' . $className)); /** @throws void */ $testCase->appendChild(new DOMAttr('classname', $className)); /** @throws void */ $testCase->appendChild(new DOMAttr('time', '0')); - foreach ($rules as $rule) { if ($rule instanceof SkippedViolation) { $this->addSkipped($xmlDoc, $testCase); @@ -182,60 +156,37 @@ private function addTestCase(string $layer, array $rulesByClassName, DOMDocument $this->addWarning($rule, $xmlDoc, $testCase); } } - $testSuite->appendChild($testCase); } } - - private function addFailure(Violation $violation, DOMDocument $xmlDoc, DOMElement $testCase): void + private function addFailure(Violation $violation, DOMDocument $xmlDoc, DOMElement $testCase) : void { $dependency = $violation->getDependency(); - - $message = sprintf( - '%s:%d must not depend on %s (%s on %s)', - $dependency->getDepender()->toString(), - $dependency->getFileOccurrence()->line, - $dependency->getDependent()->toString(), - $violation->getDependerLayer(), - $violation->getDependentLayer() - ); - + $message = \sprintf('%s:%d must not depend on %s (%s on %s)', $dependency->getDepender()->toString(), $dependency->getFileOccurrence()->line, $dependency->getDependent()->toString(), $violation->getDependerLayer(), $violation->getDependentLayer()); /** @throws void */ $error = $xmlDoc->createElement('failure'); /** @throws void */ $error->appendChild(new DOMAttr('message', $message)); /** @throws void */ $error->appendChild(new DOMAttr('type', 'WARNING')); - $testCase->appendChild($error); } - - private function addSkipped(DOMDocument $xmlDoc, DOMElement $testCase): void + private function addSkipped(DOMDocument $xmlDoc, DOMElement $testCase) : void { /** @throws void */ $skipped = $xmlDoc->createElement('skipped'); $testCase->appendChild($skipped); } - - private function addWarning(Uncovered $rule, DOMDocument $xmlDoc, DOMElement $testCase): void + private function addWarning(Uncovered $rule, DOMDocument $xmlDoc, DOMElement $testCase) : void { $dependency = $rule->getDependency(); - - $message = sprintf( - '%s:%d has uncovered dependency on %s (%s)', - $dependency->getDepender()->toString(), - $dependency->getFileOccurrence()->line, - $dependency->getDependent()->toString(), - $rule->layer - ); - + $message = \sprintf('%s:%d has uncovered dependency on %s (%s)', $dependency->getDepender()->toString(), $dependency->getFileOccurrence()->line, $dependency->getDependent()->toString(), $rule->layer); /** @throws void */ $error = $xmlDoc->createElement('warning'); /** @throws void */ $error->appendChild(new DOMAttr('message', $message)); /** @throws void */ $error->appendChild(new DOMAttr('type', 'WARNING')); - $testCase->appendChild($error); } } diff --git a/src/Supportive/OutputFormatter/JsonOutputFormatter.php b/src/Supportive/OutputFormatter/JsonOutputFormatter.php index 149754b20..117970502 100644 --- a/src/Supportive/OutputFormatter/JsonOutputFormatter.php +++ b/src/Supportive/OutputFormatter/JsonOutputFormatter.php @@ -1,7 +1,6 @@ reportSkipped) { foreach ($result->allOf(SkippedViolation::class) as $rule) { $this->addSkipped($violations, $rule); @@ -55,127 +46,71 @@ public function finish( foreach ($result->allOf(Violation::class) as $rule) { $this->addFailure($violations, $rule); } - - $jsonArray['Report'] = [ - 'Violations' => count($result->violations()), - 'Skipped violations' => count($result->skippedViolations()), - 'Uncovered' => count($result->uncovered()), - 'Allowed' => count($result->allowed()), - 'Warnings' => count($result->warnings), - 'Errors' => count($result->errors), - ]; - + $jsonArray['Report'] = ['Violations' => \count($result->violations()), 'Skipped violations' => \count($result->skippedViolations()), 'Uncovered' => \count($result->uncovered()), 'Allowed' => \count($result->allowed()), 'Warnings' => \count($result->warnings), 'Errors' => \count($result->errors)]; foreach ($violations as &$value) { - $value['violations'] = count($value['messages']); + $value['violations'] = \count($value['messages']); } - $jsonArray['files'] = $violations; $json = json_encode($jsonArray, JSON_PRETTY_PRINT); - - if (false === $json) { + if (\false === $json) { throw new Exception(sprintf('Unable to render json output. %s', $this->jsonLastError())); } - $dumpJsonPath = $outputFormatterInput->outputPath; if (null !== $dumpJsonPath) { - file_put_contents($dumpJsonPath, $json); - $output->writeLineFormatted('JSON Report dumped to '.realpath($dumpJsonPath).''); - + \file_put_contents($dumpJsonPath, $json); + $output->writeLineFormatted('JSON Report dumped to ' . \realpath($dumpJsonPath) . ''); return; } - $output->writeRaw($json); } - /** * @param array}> $violationsArray */ - private function addFailure(array &$violationsArray, Violation $violation): void + private function addFailure(array &$violationsArray, Violation $violation) : void { $className = $violation->getDependency()->getFileOccurrence()->filepath; - - $violationsArray[$className]['messages'][] = [ - 'message' => $this->getFailureMessage($violation), - 'line' => $violation->getDependency()->getFileOccurrence()->line, - 'type' => 'error', - ]; + $violationsArray[$className]['messages'][] = ['message' => $this->getFailureMessage($violation), 'line' => $violation->getDependency()->getFileOccurrence()->line, 'type' => 'error']; } - - private function getFailureMessage(Violation $violation): string + private function getFailureMessage(Violation $violation) : string { $dependency = $violation->getDependency(); - - return sprintf( - '%s must not depend on %s (%s on %s)', - $dependency->getDepender()->toString(), - $dependency->getDependent()->toString(), - $violation->getDependerLayer(), - $violation->getDependentLayer() - ); + return sprintf('%s must not depend on %s (%s on %s)', $dependency->getDepender()->toString(), $dependency->getDependent()->toString(), $violation->getDependerLayer(), $violation->getDependentLayer()); } - /** * @param array}> $violationsArray */ - private function addSkipped(array &$violationsArray, SkippedViolation $violation): void + private function addSkipped(array &$violationsArray, SkippedViolation $violation) : void { $className = $violation->getDependency()->getFileOccurrence()->filepath; - - $violationsArray[$className]['messages'][] = [ - 'message' => $this->getWarningMessage($violation), - 'line' => $violation->getDependency()->getFileOccurrence()->line, - 'type' => 'warning', - ]; + $violationsArray[$className]['messages'][] = ['message' => $this->getWarningMessage($violation), 'line' => $violation->getDependency()->getFileOccurrence()->line, 'type' => 'warning']; } - - private function getWarningMessage(SkippedViolation $violation): string + private function getWarningMessage(SkippedViolation $violation) : string { $dependency = $violation->getDependency(); - - return sprintf( - '%s should not depend on %s (%s on %s)', - $dependency->getDepender()->toString(), - $dependency->getDependent()->toString(), - $violation->getDependerLayer(), - $violation->getDependentLayer() - ); + return sprintf('%s should not depend on %s (%s on %s)', $dependency->getDepender()->toString(), $dependency->getDependent()->toString(), $violation->getDependerLayer(), $violation->getDependentLayer()); } - /** * @param array}> $violationsArray */ - private function addUncovered(array &$violationsArray, Uncovered $violation): void + private function addUncovered(array &$violationsArray, Uncovered $violation) : void { $className = $violation->getDependency()->getFileOccurrence()->filepath; - - $violationsArray[$className]['messages'][] = [ - 'message' => $this->getUncoveredMessage($violation), - 'line' => $violation->getDependency()->getFileOccurrence()->line, - 'type' => 'warning', - ]; + $violationsArray[$className]['messages'][] = ['message' => $this->getUncoveredMessage($violation), 'line' => $violation->getDependency()->getFileOccurrence()->line, 'type' => 'warning']; } - - private function getUncoveredMessage(Uncovered $violation): string + private function getUncoveredMessage(Uncovered $violation) : string { $dependency = $violation->getDependency(); - - return sprintf( - '%s has uncovered dependency on %s (%s)', - $dependency->getDepender()->toString(), - $dependency->getDependent()->toString(), - $violation->layer - ); + return sprintf('%s has uncovered dependency on %s (%s)', $dependency->getDepender()->toString(), $dependency->getDependent()->toString(), $violation->layer); } - - private function jsonLastError(): string + private function jsonLastError() : string { return match (json_last_error()) { - JSON_ERROR_NONE => 'No errors', - JSON_ERROR_DEPTH => 'Maximum stack depth exceeded', - JSON_ERROR_STATE_MISMATCH => 'Underflow or the modes mismatch', - JSON_ERROR_CTRL_CHAR => 'Unexpected control character found', - JSON_ERROR_SYNTAX => 'Syntax error, malformed JSON', - JSON_ERROR_UTF8 => 'Malformed UTF-8 characters, possibly incorrectly encoded', + \JSON_ERROR_NONE => 'No errors', + \JSON_ERROR_DEPTH => 'Maximum stack depth exceeded', + \JSON_ERROR_STATE_MISMATCH => 'Underflow or the modes mismatch', + \JSON_ERROR_CTRL_CHAR => 'Unexpected control character found', + \JSON_ERROR_SYNTAX => 'Syntax error, malformed JSON', + \JSON_ERROR_UTF8 => 'Malformed UTF-8 characters, possibly incorrectly encoded', default => 'Unknown error', }; } diff --git a/src/Supportive/OutputFormatter/TableOutputFormatter.php b/src/Supportive/OutputFormatter/TableOutputFormatter.php index ef85440d2..3072d50db 100644 --- a/src/Supportive/OutputFormatter/TableOutputFormatter.php +++ b/src/Supportive/OutputFormatter/TableOutputFormatter.php @@ -1,7 +1,6 @@ allOf(Violation::class) as $rule) { $groupedRules[$rule->getDependerLayer()][] = $rule; } - if ($outputFormatterInput->reportSkipped) { foreach ($result->allOf(SkippedViolation::class) as $rule) { $groupedRules[$rule->getDependerLayer()][] = $rule; } } - if ($outputFormatterInput->reportUncovered) { foreach ($result->allOf(Uncovered::class) as $rule) { $groupedRules[$rule->layer][] = $rule; } } - $style = $output->getStyle(); - foreach ($groupedRules as $layer => $rules) { $rows = []; foreach ($rules as $rule) { - $rows[] = match (true) { + $rows[] = match (\true) { $rule instanceof Uncovered => $this->uncoveredRow($rule, $outputFormatterInput->failOnUncovered), $rule instanceof Violation => $this->violationRow($rule), $rule instanceof SkippedViolation => $this->skippedViolationRow($rule), }; } - $style->table(['Reason', $layer], $rows); } - if ($result->hasErrors()) { $this->printErrors($result, $output); } - if ($result->hasWarnings()) { $this->printWarnings($result, $output); } - $this->printSummary($result, $output, $outputFormatterInput->failOnUncovered); } - /** * @return array{string, string} */ - private function skippedViolationRow(SkippedViolation $rule): array + private function skippedViolationRow(SkippedViolation $rule) : array { $dependency = $rule->getDependency(); - - $message = sprintf( - '%s must not depend on %s (%s)', - $dependency->getDepender()->toString(), - $dependency->getDependent()->toString(), - $rule->getDependentLayer() - ); - + $message = \sprintf('%s must not depend on %s (%s)', $dependency->getDepender()->toString(), $dependency->getDependent()->toString(), $rule->getDependentLayer()); if (count($dependency->serialize()) > 1) { - $message .= "\n".$this->formatMultilinePath($dependency); + $message .= "\n" . $this->formatMultilinePath($dependency); } - $fileOccurrence = $rule->getDependency()->getFileOccurrence(); - $message .= sprintf("\n%s:%d", $fileOccurrence->filepath, $fileOccurrence->line); - + $message .= \sprintf("\n%s:%d", $fileOccurrence->filepath, $fileOccurrence->line); return ['Skipped', $message]; } - /** * @return array{string, string} */ - private function violationRow(Violation $rule): array + private function violationRow(Violation $rule) : array { $dependency = $rule->getDependency(); - - $message = sprintf( - '%s must not depend on %s', - $dependency->getDepender()->toString(), - $dependency->getDependent()->toString(), - ); - $message .= sprintf("\n%s (%s)", $rule->ruleDescription(), $rule->getDependentLayer()); - + $message = \sprintf('%s must not depend on %s', $dependency->getDepender()->toString(), $dependency->getDependent()->toString()); + $message .= \sprintf("\n%s (%s)", $rule->ruleDescription(), $rule->getDependentLayer()); if (count($dependency->serialize()) > 1) { - $message .= "\n".$this->formatMultilinePath($dependency); + $message .= "\n" . $this->formatMultilinePath($dependency); } - $fileOccurrence = $rule->getDependency()->getFileOccurrence(); - $message .= sprintf("\n%s:%d", $fileOccurrence->filepath, $fileOccurrence->line); - - return [sprintf('%s', $rule->ruleName()), $message]; + $message .= \sprintf("\n%s:%d", $fileOccurrence->filepath, $fileOccurrence->line); + return [\sprintf('%s', $rule->ruleName()), $message]; } - - private function formatMultilinePath(DependencyInterface $dep): string + private function formatMultilinePath(DependencyInterface $dep) : string { - return implode( - " -> \n", - array_map( - static fn (array $dependency): string => sprintf('%s::%d', $dependency['name'], $dependency['line']), - $dep->serialize() - ) - ); + return \implode(" -> \n", \array_map(static fn(array $dependency): string => \sprintf('%s::%d', $dependency['name'], $dependency['line']), $dep->serialize())); } - - private function printSummary(OutputResult $result, OutputInterface $output, bool $reportUncoveredAsError): void + private function printSummary(OutputResult $result, OutputInterface $output, bool $reportUncoveredAsError) : void { $violationCount = count($result->violations()); $skippedViolationCount = count($result->skippedViolations()); @@ -141,68 +98,31 @@ private function printSummary(OutputResult $result, OutputInterface $output, boo $allowedCount = count($result->allowed()); $warningsCount = count($result->warnings); $errorsCount = count($result->errors); - $uncoveredFg = $reportUncoveredAsError ? 'red' : 'yellow'; - $style = $output->getStyle(); $style->newLine(); - $style->definitionList( - 'Report', - new TableSeparator(), - ['Violations' => sprintf('%d', $violationCount > 0 ? 'red' : 'default', $violationCount)], - ['Skipped violations' => sprintf('%d', $skippedViolationCount > 0 ? 'yellow' : 'default', $skippedViolationCount)], - ['Uncovered' => sprintf('%d', $uncoveredCount > 0 ? $uncoveredFg : 'default', $uncoveredCount)], - ['Allowed' => $allowedCount], - ['Warnings' => sprintf('%d', $warningsCount > 0 ? 'yellow' : 'default', $warningsCount)], - ['Errors' => sprintf('%d', $errorsCount > 0 ? 'red' : 'default', $errorsCount)] - ); + $style->definitionList('Report', new TableSeparator(), ['Violations' => \sprintf('%d', $violationCount > 0 ? 'red' : 'default', $violationCount)], ['Skipped violations' => \sprintf('%d', $skippedViolationCount > 0 ? 'yellow' : 'default', $skippedViolationCount)], ['Uncovered' => \sprintf('%d', $uncoveredCount > 0 ? $uncoveredFg : 'default', $uncoveredCount)], ['Allowed' => $allowedCount], ['Warnings' => \sprintf('%d', $warningsCount > 0 ? 'yellow' : 'default', $warningsCount)], ['Errors' => \sprintf('%d', $errorsCount > 0 ? 'red' : 'default', $errorsCount)]); } - /** * @return array{string, string} */ - private function uncoveredRow(Uncovered $rule, bool $reportAsError): array + private function uncoveredRow(Uncovered $rule, bool $reportAsError) : array { $dependency = $rule->getDependency(); - - $message = sprintf( - '%s has uncovered dependency on %s', - $dependency->getDepender()->toString(), - $dependency->getDependent()->toString() - ); - + $message = \sprintf('%s has uncovered dependency on %s', $dependency->getDepender()->toString(), $dependency->getDependent()->toString()); if (count($dependency->serialize()) > 1) { - $message .= "\n".$this->formatMultilinePath($dependency); + $message .= "\n" . $this->formatMultilinePath($dependency); } - $fileOccurrence = $rule->getDependency()->getFileOccurrence(); - $message .= sprintf("\n%s:%d", $fileOccurrence->filepath, $fileOccurrence->line); - - return [ - sprintf('Uncovered', $reportAsError ? 'red' : 'yellow'), - $message, - ]; + $message .= \sprintf("\n%s:%d", $fileOccurrence->filepath, $fileOccurrence->line); + return [\sprintf('Uncovered', $reportAsError ? 'red' : 'yellow'), $message]; } - - private function printErrors(OutputResult $result, OutputInterface $output): void + private function printErrors(OutputResult $result, OutputInterface $output) : void { - $output->getStyle()->table( - ['Errors'], - array_map( - static fn (Error $error) => [(string) $error], - $result->errors - ) - ); + $output->getStyle()->table(['Errors'], \array_map(static fn(Error $error) => [(string) $error], $result->errors)); } - - private function printWarnings(OutputResult $result, OutputInterface $output): void + private function printWarnings(OutputResult $result, OutputInterface $output) : void { - $output->getStyle()->table( - ['Warnings'], - array_map( - static fn (Warning $warning) => [(string) $warning], - $result->warnings - ) - ); + $output->getStyle()->table(['Warnings'], \array_map(static fn(Warning $warning) => [(string) $warning], $result->warnings)); } } diff --git a/src/Supportive/OutputFormatter/XMLOutputFormatter.php b/src/Supportive/OutputFormatter/XMLOutputFormatter.php index 9c6130ebc..c8a5fd668 100644 --- a/src/Supportive/OutputFormatter/XMLOutputFormatter.php +++ b/src/Supportive/OutputFormatter/XMLOutputFormatter.php @@ -1,7 +1,6 @@ createXml($result); - $dumpXmlPath = $outputFormatterInput->outputPath ?? self::DEFAULT_PATH; - file_put_contents($dumpXmlPath, $xml); - $output->writeLineFormatted('XML Report dumped to '.realpath($dumpXmlPath).''); + \file_put_contents($dumpXmlPath, $xml); + $output->writeLineFormatted('XML Report dumped to ' . \realpath($dumpXmlPath) . ''); } - /** * @throws Exception */ - private function createXml(OutputResult $dependencyContext): string + private function createXml(OutputResult $dependencyContext) : string { - if (!class_exists(DOMDocument::class)) { + if (!\class_exists(DOMDocument::class)) { throw new Exception('Unable to create xml file (php-xml needs to be installed)'); } - $xmlDoc = new DOMDocument('1.0', 'UTF-8'); - $xmlDoc->formatOutput = true; - + $xmlDoc->formatOutput = \true; $rootEntry = $xmlDoc->createElement('entries'); - foreach ($dependencyContext->violations() as $rule) { $this->addRule('violation', $rootEntry, $xmlDoc, $rule); } - foreach ($dependencyContext->skippedViolations() as $rule) { $this->addRule('skipped_violation', $rootEntry, $xmlDoc, $rule); } - $xmlDoc->appendChild($rootEntry); - return (string) $xmlDoc->saveXML(); } - - private function addRule(string $type, DOMElement $rootEntry, DOMDocument $xmlDoc, Violation|SkippedViolation $rule): void + private function addRule(string $type, DOMElement $rootEntry, DOMDocument $xmlDoc, Violation|SkippedViolation $rule) : void { /** @throws void */ $entry = $xmlDoc->createElement('entry'); /** @throws void */ $entry->appendChild(new DOMAttr('type', $type)); - /** @throws void */ $entry->appendChild($xmlDoc->createElement('LayerA', $rule->getDependerLayer())); /** @throws void */ $entry->appendChild($xmlDoc->createElement('LayerB', $rule->getDependentLayer())); - $dependency = $rule->getDependency(); /** @throws void */ $entry->appendChild($xmlDoc->createElement('ClassA', $dependency->getDepender()->toString())); /** @throws void */ $entry->appendChild($xmlDoc->createElement('ClassB', $dependency->getDependent()->toString())); - $fileOccurrence = $dependency->getFileOccurrence(); /** @throws void */ $occurrence = $xmlDoc->createElement('occurrence'); $occurrence->setAttribute('file', $fileOccurrence->filepath); $occurrence->setAttribute('line', (string) $fileOccurrence->line); $entry->appendChild($occurrence); - $rootEntry->appendChild($entry); } } diff --git a/src/Supportive/Time/Period.php b/src/Supportive/Time/Period.php index fbd4079cd..cae2aefba 100644 --- a/src/Supportive/Time/Period.php +++ b/src/Supportive/Time/Period.php @@ -1,36 +1,27 @@ startedAt, - hrtime(true), - ); + return new self($startedPeriod->startedAt, hrtime(\true)); } - - public function toSeconds(): float + public function toSeconds() : float { $duration = $this->endedAt - $this->startedAt; - - return $duration / 1e9; + return $duration / 1000000000.0; } } diff --git a/src/Supportive/Time/StartedPeriod.php b/src/Supportive/Time/StartedPeriod.php index 85fbcdba3..56d04a92a 100644 --- a/src/Supportive/Time/StartedPeriod.php +++ b/src/Supportive/Time/StartedPeriod.php @@ -1,7 +1,6 @@ */ private array $periods = []; - /** * @param non-empty-string $event * * @throws StopwatchException */ - public function start(string $event): void + public function start(string $event) : void { $this->assertPeriodNotStarted($event); - - $this->periods[$event] = StartedPeriod::start(); + $this->periods[$event] = \Qossmic\Deptrac\Supportive\Time\StartedPeriod::start(); } - /** * @param non-empty-string $event * * @throws StopwatchException */ - public function stop(string $event): Period + public function stop(string $event) : \Qossmic\Deptrac\Supportive\Time\Period { $this->assertPeriodStarted($event); - $period = $this->periods[$event]->stop(); - unset($this->periods[$event]); - return $period; } - /** * @param non-empty-string $event * * @throws StopwatchException */ - private function assertPeriodNotStarted(string $event): void + private function assertPeriodNotStarted(string $event) : void { if (array_key_exists($event, $this->periods)) { - throw StopwatchException::periodAlreadyStarted($event); + throw \Qossmic\Deptrac\Supportive\Time\StopwatchException::periodAlreadyStarted($event); } } - /** * @param non-empty-string $event * * @throws StopwatchException */ - private function assertPeriodStarted(string $event): void + private function assertPeriodStarted(string $event) : void { if (!array_key_exists($event, $this->periods)) { - throw StopwatchException::periodNotStarted($event); + throw \Qossmic\Deptrac\Supportive\Time\StopwatchException::periodNotStarted($event); } } } diff --git a/src/Supportive/Time/StopwatchException.php b/src/Supportive/Time/StopwatchException.php index 3c6cfd3c8..d0f463caf 100644 --- a/src/Supportive/Time/StopwatchException.php +++ b/src/Supportive/Time/StopwatchException.php @@ -1,33 +1,19 @@ [ - 'DependencyClass', - ], - 'ClassWithEmptyDeps' => [], - 'ClassWithMultipleDeps' => [ - 'DependencyClass1', - 'DependencyClass2', - 'DependencyClass2', - ], - ]; - $helper = new EventHelper($configuration, new LayerProvider([])); - - self::assertTrue( - $helper->shouldViolationBeSkipped( - ClassLikeToken::fromFQCN('ClassWithOneDep')->toString(), - ClassLikeToken::fromFQCN('DependencyClass')->toString() - ) - ); - // also skips multiple occurrences - self::assertTrue( - $helper->shouldViolationBeSkipped( - ClassLikeToken::fromFQCN('ClassWithOneDep')->toString(), - ClassLikeToken::fromFQCN('DependencyClass')->toString() - ) - ); - self::assertFalse( - $helper->shouldViolationBeSkipped( - ClassLikeToken::fromFQCN('ClassWithEmptyDeps')->toString(), - ClassLikeToken::fromFQCN('DependencyClass')->toString() - ) - ); - self::assertTrue( - $helper->shouldViolationBeSkipped( - ClassLikeToken::fromFQCN('ClassWithMultipleDeps')->toString(), - ClassLikeToken::fromFQCN('DependencyClass1')->toString() - ) - ); - self::assertTrue( - $helper->shouldViolationBeSkipped( - ClassLikeToken::fromFQCN('ClassWithMultipleDeps')->toString(), - ClassLikeToken::fromFQCN('DependencyClass2')->toString() - ) - ); - self::assertFalse( - $helper->shouldViolationBeSkipped( - ClassLikeToken::fromFQCN('DependencyClass')->toString(), - ClassLikeToken::fromFQCN('ClassWithOneDep')->toString() - ) - ); - } - - public function testUnmatchedSkippedViolations(): void - { - $configuration = [ - 'ClassWithOneDep' => [ - 'DependencyClass', - ], - 'ClassWithEmptyDeps' => [], - 'ClassWithMultipleDeps' => [ - 'DependencyClass1', - 'DependencyClass2', - 'DependencyClass2', - ], - ]; - $helper = new EventHelper($configuration, new LayerProvider([])); - - self::assertTrue( - $helper->shouldViolationBeSkipped( - ClassLikeToken::fromFQCN('ClassWithOneDep')->toString(), - ClassLikeToken::fromFQCN('DependencyClass')->toString() - ) - ); - // also skips multiple occurrences - self::assertTrue( - $helper->shouldViolationBeSkipped( - ClassLikeToken::fromFQCN('ClassWithOneDep')->toString(), - ClassLikeToken::fromFQCN('DependencyClass')->toString() - ) - ); - self::assertSame( - [ - 'ClassWithMultipleDeps' => [ - 'DependencyClass1', - 'DependencyClass2', - 'DependencyClass2', - ], - ], - $helper->unmatchedSkippedViolations() - ); - } -} diff --git a/tests/Core/Analyser/EventHandler/AllowDependencyHandlerTest.php b/tests/Core/Analyser/EventHandler/AllowDependencyHandlerTest.php deleted file mode 100644 index c491f5808..000000000 --- a/tests/Core/Analyser/EventHandler/AllowDependencyHandlerTest.php +++ /dev/null @@ -1,21 +0,0 @@ -assertSame('/path/to/file.php', $fileName->path); - $this->assertSame('/path/to/file.php', $fileName->toString()); - - $fileName = new FileToken('\\path\\to\\file.php'); - $this->assertSame('/path/to/file.php', $fileName->path); - $this->assertSame('/path/to/file.php', $fileName->toString()); - } -} diff --git a/tests/Core/Ast/AstMapFlattenGeneratorTest.php b/tests/Core/Ast/AstMapFlattenGeneratorTest.php deleted file mode 100644 index 86b24a8d2..000000000 --- a/tests/Core/Ast/AstMapFlattenGeneratorTest.php +++ /dev/null @@ -1,302 +0,0 @@ -eventDispatcher = new TraceableEventDispatcher( - new EventDispatcher(), - new Stopwatch() - ); - $this->astLoader = new AstLoader( - new NikicPhpParser( - (new ParserFactory())->create(ParserFactory::ONLY_PHP7, new Lexer()), - new AstFileReferenceInMemoryCache(), - new TypeResolver(), - [] - ), - $this->eventDispatcher - ); - } - - protected function tearDown(): void - { - parent::tearDown(); - - unset($this->astLoader); - unset($this->eventDispatcher); - } - - private function getAstMap(string $fixture): AstMap - { - return $this->astLoader->createAstMap([__DIR__.'/Fixtures/BasicInheritance/'.$fixture.'.php']); - } - - private function getInheritedInherits(string $class, AstMap $astMap): array - { - $inherits = []; - foreach ($astMap->getClassInherits(ClassLikeToken::fromFQCN($class)) as $v) { - if (count($v->getPath()) > 0) { - $inherits[] = (string) $v; - } - } - - return $inherits; - } - - public function testBasicInheritance(): void - { - $expectedEvents = [ - PreCreateAstMapEvent::class, - AstFileAnalysedEvent::class, - PostCreateAstMapEvent::class, - ]; - - $astMap = $this->getAstMap('FixtureBasicInheritance'); - - $dispatchedEvents = $this->eventDispatcher->getOrphanedEvents(); - self::assertSame($expectedEvents, $dispatchedEvents); - - self::assertArrayValuesEquals( - [], - $this->getInheritedInherits(FixtureBasicInheritanceA::class, $astMap) - ); - - self::assertArrayValuesEquals( - [], - $this->getInheritedInherits(FixtureBasicInheritanceB::class, $astMap) - ); - - self::assertArrayValuesEquals( - ['Tests\Qossmic\Deptrac\Core\Ast\Fixtures\FixtureBasicInheritanceA::6 (Extends) (path: Tests\Qossmic\Deptrac\Core\Ast\Fixtures\FixtureBasicInheritanceB::7 (Extends))'], - $this->getInheritedInherits(FixtureBasicInheritanceC::class, $astMap) - ); - - self::assertArrayValuesEquals( - [ - 'Tests\Qossmic\Deptrac\Core\Ast\Fixtures\FixtureBasicInheritanceA::6 (Extends) (path: Tests\Qossmic\Deptrac\Core\Ast\Fixtures\FixtureBasicInheritanceC::8 (Extends) -> Tests\Qossmic\Deptrac\Core\Ast\Fixtures\FixtureBasicInheritanceB::7 (Extends))', - 'Tests\Qossmic\Deptrac\Core\Ast\Fixtures\FixtureBasicInheritanceB::7 (Extends) (path: Tests\Qossmic\Deptrac\Core\Ast\Fixtures\FixtureBasicInheritanceC::8 (Extends))', - ], - $this->getInheritedInherits(FixtureBasicInheritanceD::class, $astMap) - ); - - self::assertArrayValuesEquals( - [ - 'Tests\Qossmic\Deptrac\Core\Ast\Fixtures\FixtureBasicInheritanceA::6 (Extends) (path: Tests\Qossmic\Deptrac\Core\Ast\Fixtures\FixtureBasicInheritanceD::9 (Extends) -> Tests\Qossmic\Deptrac\Core\Ast\Fixtures\FixtureBasicInheritanceC::8 (Extends) -> Tests\Qossmic\Deptrac\Core\Ast\Fixtures\FixtureBasicInheritanceB::7 (Extends))', - 'Tests\Qossmic\Deptrac\Core\Ast\Fixtures\FixtureBasicInheritanceB::7 (Extends) (path: Tests\Qossmic\Deptrac\Core\Ast\Fixtures\FixtureBasicInheritanceD::9 (Extends) -> Tests\Qossmic\Deptrac\Core\Ast\Fixtures\FixtureBasicInheritanceC::8 (Extends))', - 'Tests\Qossmic\Deptrac\Core\Ast\Fixtures\FixtureBasicInheritanceC::8 (Extends) (path: Tests\Qossmic\Deptrac\Core\Ast\Fixtures\FixtureBasicInheritanceD::9 (Extends))', - ], - $this->getInheritedInherits(FixtureBasicInheritanceE::class, $astMap) - ); - } - - public function testBasicInheritanceInterfaces(): void - { - $expectedEvents = [ - PreCreateAstMapEvent::class, - AstFileAnalysedEvent::class, - PostCreateAstMapEvent::class, - ]; - - $astMap = $this->getAstMap('FixtureBasicInheritanceInterfaces'); - - $dispatchedEvents = $this->eventDispatcher->getOrphanedEvents(); - self::assertSame($expectedEvents, $dispatchedEvents); - - self::assertArrayValuesEquals( - [], - $this->getInheritedInherits(FixtureBasicInheritanceInterfaceA::class, $astMap) - ); - - self::assertArrayValuesEquals( - [], - $this->getInheritedInherits(FixtureBasicInheritanceInterfaceB::class, $astMap) - ); - - self::assertArrayValuesEquals( - ['Tests\Qossmic\Deptrac\Core\Ast\Fixtures\FixtureBasicInheritanceInterfaceA::6 (Implements) (path: Tests\Qossmic\Deptrac\Core\Ast\Fixtures\FixtureBasicInheritanceInterfaceB::7 (Implements))'], - $this->getInheritedInherits(FixtureBasicInheritanceInterfaceC::class, $astMap) - ); - - self::assertArrayValuesEquals( - [ - 'Tests\Qossmic\Deptrac\Core\Ast\Fixtures\FixtureBasicInheritanceInterfaceA::6 (Implements) (path: Tests\Qossmic\Deptrac\Core\Ast\Fixtures\FixtureBasicInheritanceInterfaceC::8 (Implements) -> Tests\Qossmic\Deptrac\Core\Ast\Fixtures\FixtureBasicInheritanceInterfaceB::7 (Implements))', - 'Tests\Qossmic\Deptrac\Core\Ast\Fixtures\FixtureBasicInheritanceInterfaceB::7 (Implements) (path: Tests\Qossmic\Deptrac\Core\Ast\Fixtures\FixtureBasicInheritanceInterfaceC::8 (Implements))', - ], - $this->getInheritedInherits(FixtureBasicInheritanceInterfaceD::class, $astMap) - ); - - self::assertArrayValuesEquals( - [ - 'Tests\Qossmic\Deptrac\Core\Ast\Fixtures\FixtureBasicInheritanceInterfaceA::6 (Implements) (path: Tests\Qossmic\Deptrac\Core\Ast\Fixtures\FixtureBasicInheritanceInterfaceD::9 (Implements) -> Tests\Qossmic\Deptrac\Core\Ast\Fixtures\FixtureBasicInheritanceInterfaceC::8 (Implements) -> Tests\Qossmic\Deptrac\Core\Ast\Fixtures\FixtureBasicInheritanceInterfaceB::7 (Implements))', - 'Tests\Qossmic\Deptrac\Core\Ast\Fixtures\FixtureBasicInheritanceInterfaceB::7 (Implements) (path: Tests\Qossmic\Deptrac\Core\Ast\Fixtures\FixtureBasicInheritanceInterfaceD::9 (Implements) -> Tests\Qossmic\Deptrac\Core\Ast\Fixtures\FixtureBasicInheritanceInterfaceC::8 (Implements))', - 'Tests\Qossmic\Deptrac\Core\Ast\Fixtures\FixtureBasicInheritanceInterfaceC::8 (Implements) (path: Tests\Qossmic\Deptrac\Core\Ast\Fixtures\FixtureBasicInheritanceInterfaceD::9 (Implements))', - ], - $this->getInheritedInherits(FixtureBasicInheritanceInterfaceE::class, $astMap) - ); - } - - public function testBasicMultipleInheritanceInterfaces(): void - { - $expectedEvents = [ - PreCreateAstMapEvent::class, - AstFileAnalysedEvent::class, - PostCreateAstMapEvent::class, - ]; - - $astMap = $this->getAstMap('MultipleInheritanceInterfaces'); - - $dispatchedEvents = $this->eventDispatcher->getOrphanedEvents(); - self::assertSame($expectedEvents, $dispatchedEvents); - - self::assertArrayValuesEquals( - [], - $this->getInheritedInherits(MultipleInteritanceA1::class, $astMap) - ); - - self::assertArrayValuesEquals( - [], - $this->getInheritedInherits(MultipleInteritanceA2::class, $astMap) - ); - - self::assertArrayValuesEquals( - [], - $this->getInheritedInherits(MultipleInteritanceA::class, $astMap) - ); - - self::assertArrayValuesEquals( - [ - 'Tests\Qossmic\Deptrac\Core\Ast\Fixtures\MultipleInteritanceA1::7 (Implements) (path: Tests\Qossmic\Deptrac\Core\Ast\Fixtures\MultipleInteritanceA::8 (Implements))', - 'Tests\Qossmic\Deptrac\Core\Ast\Fixtures\MultipleInteritanceA2::7 (Implements) (path: Tests\Qossmic\Deptrac\Core\Ast\Fixtures\MultipleInteritanceA::8 (Implements))', - ], - $this->getInheritedInherits(MultipleInteritanceB::class, $astMap) - ); - - self::assertArrayValuesEquals( - [ - 'Tests\Qossmic\Deptrac\Core\Ast\Fixtures\MultipleInteritanceA1::7 (Implements) (path: Tests\Qossmic\Deptrac\Core\Ast\Fixtures\MultipleInteritanceB::9 (Implements) -> Tests\Qossmic\Deptrac\Core\Ast\Fixtures\MultipleInteritanceA::8 (Implements))', - 'Tests\Qossmic\Deptrac\Core\Ast\Fixtures\MultipleInteritanceA1::8 (Implements) (path: Tests\Qossmic\Deptrac\Core\Ast\Fixtures\MultipleInteritanceB::9 (Implements))', - 'Tests\Qossmic\Deptrac\Core\Ast\Fixtures\MultipleInteritanceA2::7 (Implements) (path: Tests\Qossmic\Deptrac\Core\Ast\Fixtures\MultipleInteritanceB::9 (Implements) -> Tests\Qossmic\Deptrac\Core\Ast\Fixtures\MultipleInteritanceA::8 (Implements))', - 'Tests\Qossmic\Deptrac\Core\Ast\Fixtures\MultipleInteritanceA::8 (Implements) (path: Tests\Qossmic\Deptrac\Core\Ast\Fixtures\MultipleInteritanceB::9 (Implements))', - ], - $this->getInheritedInherits(MultipleInteritanceC::class, $astMap) - ); - } - - public function testBasicMultipleInheritanceWithNoise(): void - { - $expectedEvents = [ - PreCreateAstMapEvent::class, - AstFileAnalysedEvent::class, - PostCreateAstMapEvent::class, - ]; - - $astMap = $this->getAstMap('FixtureBasicInheritanceWithNoise'); - - $dispatchedEvents = $this->eventDispatcher->getOrphanedEvents(); - self::assertSame($expectedEvents, $dispatchedEvents); - - self::assertArrayValuesEquals( - [], - $this->getInheritedInherits(FixtureBasicInheritanceWithNoiseA::class, $astMap) - ); - - self::assertArrayValuesEquals( - [], - $this->getInheritedInherits(FixtureBasicInheritanceWithNoiseB::class, $astMap) - ); - - self::assertArrayValuesEquals( - ['Tests\Qossmic\Deptrac\Core\Ast\Fixtures\BasicInheritance\FixtureBasicInheritanceWithNoiseA::18 (Extends) (path: Tests\Qossmic\Deptrac\Core\Ast\Fixtures\BasicInheritance\FixtureBasicInheritanceWithNoiseB::19 (Extends))'], - $this->getInheritedInherits(FixtureBasicInheritanceWithNoiseC::class, $astMap) - ); - } - - public function testSkipsErrorsAndDisptachesErrorEventAndReturnsEmptyAstMap(): void - { - $expectedEvents = [ - PreCreateAstMapEvent::class, - AstFileSyntaxErrorEvent::class, - PostCreateAstMapEvent::class, - ]; - $parser = $this->createMock(ParserInterface::class); - $astLoader = new AstLoader($parser, $this->eventDispatcher); - - $parser - ->expects(self::atLeastOnce()) - ->method('parseFile') - ->with(__DIR__.'/Fixtures/BasicInheritance/FixtureBasicInheritanceWithNoise.php') - ->willThrowException(new CouldNotParseFileException('Syntax Error')); - - $astLoader->createAstMap([__DIR__.'/Fixtures/BasicInheritance/FixtureBasicInheritanceWithNoise.php']); - - $dispatchedEvents = $this->eventDispatcher->getOrphanedEvents(); - self::assertSame($expectedEvents, $dispatchedEvents); - } - - public function testThrowsOtherExceptions(): void - { - $parser = $this->createMock(ParserInterface::class); - $astLoader = new AstLoader($parser, $this->eventDispatcher); - - $parser - ->expects(self::atLeastOnce()) - ->method('parseFile') - ->with(__DIR__.'/Fixtures/BasicInheritance/FixtureBasicInheritanceWithNoise.php') - ->willThrowException(new LogicException('Uncaught exception')); - - $this->expectException(LogicException::class); - $this->expectExceptionMessage('Uncaught exception'); - - $astLoader->createAstMap([__DIR__.'/Fixtures/BasicInheritance/FixtureBasicInheritanceWithNoise.php']); - } -} diff --git a/tests/Core/Ast/AstMapGeneratorTest.php b/tests/Core/Ast/AstMapGeneratorTest.php deleted file mode 100644 index 48124a7c1..000000000 --- a/tests/Core/Ast/AstMapGeneratorTest.php +++ /dev/null @@ -1,140 +0,0 @@ -create(ParserFactory::ONLY_PHP7, new Lexer()), - new AstFileReferenceInMemoryCache(), - $typeResolver, - [ - new AnnotationReferenceExtractor($typeResolver), - new AnonymousClassExtractor(), - new ClassConstantExtractor(), - new KeywordExtractor($typeResolver), - ] - ), - new EventDispatcher() - ); - - return $astRunner->createAstMap([$fixture]); - } - - public function testBasicDependencyClass(): void - { - $astMap = $this->getAstMap(__DIR__.'/Fixtures/BasicDependency/BasicDependencyClass.php'); - - self::assertArrayValuesEquals( - [ - 'Tests\Qossmic\Deptrac\Core\Ast\Fixtures\BasicDependency\BasicDependencyClassA::9 (Extends)', - 'Tests\Qossmic\Deptrac\Core\Ast\Fixtures\BasicDependency\BasicDependencyClassInterfaceA::9 (Implements)', - ], - $this->getInheritsAsString($astMap->getClassReferenceForToken(ClassLikeToken::fromFQCN(BasicDependencyClassB::class))) - ); - - self::assertArrayValuesEquals( - [ - 'Tests\Qossmic\Deptrac\Core\Ast\Fixtures\BasicDependency\BasicDependencyClassInterfaceA::13 (Implements)', - 'Tests\Qossmic\Deptrac\Core\Ast\Fixtures\BasicDependency\BasicDependencyClassInterfaceB::13 (Implements)', - ], - $this->getInheritsAsString($astMap->getClassReferenceForToken(ClassLikeToken::fromFQCN(BasicDependencyClassC::class))) - ); - } - - public function testBasicTraitsClass(): void - { - $astMap = $this->getAstMap(__DIR__.'/Fixtures/BasicDependency/BasicDependencyTraits.php'); - - self::assertArrayValuesEquals( - [], - $this->getInheritsAsString($astMap->getClassReferenceForToken(ClassLikeToken::fromFQCN(BasicDependencyTraitA::class))) - ); - - self::assertArrayValuesEquals( - [], - $this->getInheritsAsString($astMap->getClassReferenceForToken(ClassLikeToken::fromFQCN(BasicDependencyTraitB::class))) - ); - - self::assertArrayValuesEquals( - ['Tests\Qossmic\Deptrac\Core\Ast\Fixtures\BasicDependency\BasicDependencyTraitB::7 (Uses)'], - $this->getInheritsAsString($astMap->getClassReferenceForToken(ClassLikeToken::fromFQCN(BasicDependencyTraitC::class))) - ); - - self::assertArrayValuesEquals( - [ - 'Tests\Qossmic\Deptrac\Core\Ast\Fixtures\BasicDependency\BasicDependencyTraitA::10 (Uses)', - 'Tests\Qossmic\Deptrac\Core\Ast\Fixtures\BasicDependency\BasicDependencyTraitB::11 (Uses)', - ], - $this->getInheritsAsString($astMap->getClassReferenceForToken(ClassLikeToken::fromFQCN(BasicDependencyTraitD::class))) - ); - - self::assertArrayValuesEquals( - ['Tests\Qossmic\Deptrac\Core\Ast\Fixtures\BasicDependency\BasicDependencyTraitA::15 (Uses)'], - $this->getInheritsAsString($astMap->getClassReferenceForToken(ClassLikeToken::fromFQCN(BasicDependencyTraitClass::class))) - ); - } - - public function testIssue319(): void - { - $astMap = $this->getAstMap(__DIR__.'/Fixtures/Issue319.php'); - - self::assertSame( - [ - 'Foo\Exception', - 'Foo\RuntimeException', - 'LogicException', - ], - array_map( - static function (DependencyToken $dependency) { - return $dependency->token->toString(); - }, - $astMap->getFileReferences()[__DIR__.'/Fixtures/Issue319.php']->dependencies - ) - ); - } - - /** - * @return string[] - */ - private function getInheritsAsString(?ClassLikeReference $classReference): array - { - if (null === $classReference) { - return []; - } - - return array_map('strval', $classReference->inherits); - } -} diff --git a/tests/Core/Ast/Fixtures/BasicDependency/BasicDependencyClass.php b/tests/Core/Ast/Fixtures/BasicDependency/BasicDependencyClass.php deleted file mode 100644 index 35986de38..000000000 --- a/tests/Core/Ast/Fixtures/BasicDependency/BasicDependencyClass.php +++ /dev/null @@ -1,15 +0,0 @@ -create(ParserFactory::ONLY_PHP7, new Lexer()), - new AstFileReferenceInMemoryCache(), - new TypeResolver(), - [ - new AnnotationReferenceExtractor($typeResolver), - new KeywordExtractor($typeResolver), - ] - ); - - $filePath = __DIR__.'/Fixtures/AnnotationDependency.php'; - $astFileReference = $parser->parseFile($filePath); - - $astClassReferences = $astFileReference->classLikeReferences; - $annotationDependency = $astClassReferences[0]->dependencies; - - self::assertCount(2, $astClassReferences); - self::assertCount(9, $annotationDependency); - self::assertCount(0, $astClassReferences[1]->dependencies); - - self::assertSame( - 'Tests\Qossmic\Deptrac\Core\Ast\Parser\Fixtures\AnnotationDependencyChild', - $annotationDependency[0]->token->toString() - ); - self::assertSame($filePath, $annotationDependency[0]->fileOccurrence->filepath); - self::assertSame(9, $annotationDependency[0]->fileOccurrence->line); - self::assertSame('variable', $annotationDependency[0]->type->value); - - self::assertSame( - 'Tests\Qossmic\Deptrac\Core\Ast\Parser\Fixtures\AnnotationDependencyChild', - $annotationDependency[1]->token->toString() - ); - self::assertSame($filePath, $annotationDependency[1]->fileOccurrence->filepath); - self::assertSame(23, $annotationDependency[1]->fileOccurrence->line); - self::assertSame('variable', $annotationDependency[1]->type->value); - - self::assertSame( - 'Tests\Qossmic\Deptrac\Core\Ast\Parser\Fixtures\AnnotationDependencyChild', - $annotationDependency[2]->token->toString() - ); - self::assertSame($filePath, $annotationDependency[2]->fileOccurrence->filepath); - self::assertSame(26, $annotationDependency[2]->fileOccurrence->line); - self::assertSame('variable', $annotationDependency[2]->type->value); - - self::assertSame( - 'Symfony\Component\Console\Exception\RuntimeException', - $annotationDependency[3]->token->toString() - ); - self::assertSame($filePath, $annotationDependency[3]->fileOccurrence->filepath); - self::assertSame(29, $annotationDependency[3]->fileOccurrence->line); - self::assertSame('variable', $annotationDependency[3]->type->value); - - self::assertSame( - 'Symfony\Component\Finder\SplFileInfo', - $annotationDependency[4]->token->toString() - ); - self::assertSame($filePath, $annotationDependency[4]->fileOccurrence->filepath); - self::assertSame(14, $annotationDependency[4]->fileOccurrence->line); - self::assertSame('parameter', $annotationDependency[4]->type->value); - - self::assertSame( - 'Tests\Qossmic\Deptrac\Core\Ast\Parser\Fixtures\AnnotationDependencyChild', - $annotationDependency[5]->token->toString() - ); - self::assertSame($filePath, $annotationDependency[5]->fileOccurrence->filepath); - self::assertSame(14, $annotationDependency[5]->fileOccurrence->line); - self::assertSame('returntype', $annotationDependency[5]->type->value); - } -} diff --git a/tests/Core/Ast/Parser/AnonymousClassExtractorTest.php b/tests/Core/Ast/Parser/AnonymousClassExtractorTest.php deleted file mode 100644 index fbf6305e5..000000000 --- a/tests/Core/Ast/Parser/AnonymousClassExtractorTest.php +++ /dev/null @@ -1,56 +0,0 @@ -create(ParserFactory::ONLY_PHP7, new Lexer()), - new AstFileReferenceInMemoryCache(), - new TypeResolver(), - [ - new AnonymousClassExtractor(), - ] - ); - - $filePath = __DIR__.'/Fixtures/AnonymousClass.php'; - $astFileReference = $parser->parseFile($filePath); - - $astClassReferences = $astFileReference->classLikeReferences; - - self::assertCount(3, $astClassReferences); - self::assertCount(0, $astClassReferences[0]->dependencies); - self::assertCount(0, $astClassReferences[1]->dependencies); - self::assertCount(2, $astClassReferences[2]->dependencies); - - $dependencies = $astClassReferences[2]->dependencies; - - self::assertSame( - 'Tests\Qossmic\Deptrac\Core\Ast\Parser\Fixtures\ClassA', - $dependencies[0]->token->toString() - ); - self::assertSame($filePath, $dependencies[0]->fileOccurrence->filepath); - self::assertSame(19, $dependencies[0]->fileOccurrence->line); - self::assertSame('anonymous_class_extends', $dependencies[0]->type->value); - - self::assertSame( - 'Tests\Qossmic\Deptrac\Core\Ast\Parser\Fixtures\InterfaceC', - $dependencies[1]->token->toString() - ); - self::assertSame($filePath, $dependencies[1]->fileOccurrence->filepath); - self::assertSame(19, $dependencies[1]->fileOccurrence->line); - self::assertSame('anonymous_class_implements', $dependencies[1]->type->value); - } -} diff --git a/tests/Core/Ast/Parser/CacheableFileSubscriberTest.php b/tests/Core/Ast/Parser/CacheableFileSubscriberTest.php deleted file mode 100644 index b129c35e4..000000000 --- a/tests/Core/Ast/Parser/CacheableFileSubscriberTest.php +++ /dev/null @@ -1,41 +0,0 @@ - 'onPreCreateAstMapEvent', - PostCreateAstMapEvent::class => 'onPostCreateAstMapEvent', - ], - CacheableFileSubscriber::getSubscribedEvents() - ); - } - - public function testOnPreCreateAstMapEvent(): void - { - $cache = $this->createMock(AstFileReferenceFileCache::class); - $cache->expects(self::once())->method('load'); - - (new CacheableFileSubscriber($cache))->onPreCreateAstMapEvent(new PreCreateAstMapEvent(1)); - } - - public function testOnPostCreateAstMapEvent(): void - { - $cache = $this->createMock(AstFileReferenceFileCache::class); - $cache->expects(self::once())->method('write'); - - (new CacheableFileSubscriber($cache))->onPostCreateAstMapEvent(new PostCreateAstMapEvent()); - } -} diff --git a/tests/Core/Ast/Parser/ClassConstantExtractorTest.php b/tests/Core/Ast/Parser/ClassConstantExtractorTest.php deleted file mode 100644 index fde614f8a..000000000 --- a/tests/Core/Ast/Parser/ClassConstantExtractorTest.php +++ /dev/null @@ -1,46 +0,0 @@ -create(ParserFactory::ONLY_PHP7, new Lexer()), - new AstFileReferenceInMemoryCache(), - new TypeResolver(), - [ - new ClassConstantExtractor(), - ] - ); - - $filePath = __DIR__.'/Fixtures/ClassConst.php'; - $astFileReference = $parser->parseFile($filePath); - - $astClassReferences = $astFileReference->classLikeReferences; - - self::assertCount(2, $astClassReferences); - self::assertCount(0, $astClassReferences[0]->dependencies); - self::assertCount(1, $astClassReferences[1]->dependencies); - - $dependencies = $astClassReferences[1]->dependencies; - self::assertSame( - 'Tests\Qossmic\Deptrac\Core\Ast\Parser\Fixtures\ClassA', - $dependencies[0]->token->toString() - ); - self::assertSame($filePath, $dependencies[0]->fileOccurrence->filepath); - self::assertSame(15, $dependencies[0]->fileOccurrence->line); - self::assertSame('const', $dependencies[0]->type->value); - } -} diff --git a/tests/Core/Ast/Parser/ClassDocBlockExtractorTest.php b/tests/Core/Ast/Parser/ClassDocBlockExtractorTest.php deleted file mode 100644 index f09d36911..000000000 --- a/tests/Core/Ast/Parser/ClassDocBlockExtractorTest.php +++ /dev/null @@ -1,50 +0,0 @@ -create(ParserFactory::ONLY_PHP7, new Lexer()), - new AstFileReferenceInMemoryCache(), - $typeResolver, - [ - new KeywordExtractor($typeResolver), - ] - ); - - $filePath = __DIR__.'/Fixtures/ClassDocBlockDependency.php'; - $astFileReference = $parser->parseFile($filePath); - - $dependencies = $astFileReference->classLikeReferences[0]->dependencies; - - self::assertCount(5, $astFileReference->classLikeReferences[0]->dependencies); - - foreach ($dependencies as $key => $dependency) { - self::assertSame(self::EXPECTED[$key][0], $dependency->token->toString()); - self::assertSame(self::EXPECTED[$key][1], $dependency->type); - } - } -} diff --git a/tests/Core/Ast/Parser/Fixtures/AnnotationDependency.php b/tests/Core/Ast/Parser/Fixtures/AnnotationDependency.php deleted file mode 100644 index 09f750ada..000000000 --- a/tests/Core/Ast/Parser/Fixtures/AnnotationDependency.php +++ /dev/null @@ -1,65 +0,0 @@ - - */ - public function template($var) - { - return new AnnotationDependencyChild($var); - } -} - -/** - * @template T - */ -final class AnnotationDependencyChild -{ - /** - * @param T $var - */ - public function __construct($var) - { - } - - /** - * @return T - */ - public function get() - { - - } -} diff --git a/tests/Core/Ast/Parser/Fixtures/AnonymousClass.php b/tests/Core/Ast/Parser/Fixtures/AnonymousClass.php deleted file mode 100644 index 50250dcec..000000000 --- a/tests/Core/Ast/Parser/Fixtures/AnonymousClass.php +++ /dev/null @@ -1,22 +0,0 @@ - "value"])] -#[MyAttribute(100 + 200)] -class Thing -{ -} - -#[MyAttribute(1234), MyAttribute(5678)] -class AnotherThing -{ -} - -namespace Tests\Qossmic\Deptrac\AstRunner\AstParser\NikicPhpParser\Fixtures\Attribute; - -use Attribute; - -#[Attribute(Attribute::IS_REPEATABLE)] -class MyAttribute -{ - const VALUE = 'value'; - - private $value; - - public function __construct($value = null) - { - $this->value = $value; - } -} - diff --git a/tests/Core/Ast/Parser/NikicPhpParser/Fixtures/CountingUseStatements.php b/tests/Core/Ast/Parser/NikicPhpParser/Fixtures/CountingUseStatements.php deleted file mode 100644 index 9cf167e4d..000000000 --- a/tests/Core/Ast/Parser/NikicPhpParser/Fixtures/CountingUseStatements.php +++ /dev/null @@ -1,17 +0,0 @@ -parser = new NikicPhpParser( - $this->createMock(Parser::class), - new AstFileReferenceInMemoryCache(), - $this->createMock(TypeResolver::class), - [] - ); - } - - public function testParseWithInvalidData(): void - { - $this->expectException(TypeError::class); - $this->parser->parseFile(new stdClass()); - } - - public function testParseDoesNotIgnoreUsesByDefault(): void - { - $typeResolver = new TypeResolver(); - $parser = new NikicPhpParser( - (new ParserFactory())->create(ParserFactory::ONLY_PHP7, new Lexer()), - new AstFileReferenceInMemoryCache(), - $typeResolver, - [] - ); - - $filePath = __DIR__.'/Fixtures/CountingUseStatements.php'; - self::assertCount(1, $parser->parseFile($filePath)->dependencies); - } - - /** - * @requires PHP >= 8.0 - */ - public function testParseAttributes(): void - { - $typeResolver = new TypeResolver(); - $parser = new NikicPhpParser( - (new ParserFactory())->create(ParserFactory::ONLY_PHP7, new Lexer()), - new AstFileReferenceInMemoryCache(), - $typeResolver, - [] - ); - - $filePath = __DIR__.'/Fixtures/Attributes.php'; - $astFileReference = $parser->parseFile($filePath); - $astClassReferences = $astFileReference->classLikeReferences; - self::assertCount(7, $astClassReferences[0]->dependencies); - self::assertCount(2, $astClassReferences[1]->dependencies); - self::assertCount(1, $astClassReferences[2]->dependencies); - } - - public function testParseTemplateTypes(): void - { - $typeResolver = new TypeResolver(); - $parser = new NikicPhpParser( - (new ParserFactory())->create(ParserFactory::ONLY_PHP7, new Lexer()), - new AstFileReferenceInMemoryCache(), - $typeResolver, - [new AnnotationReferenceExtractor($typeResolver)] - ); - - $filePath = __DIR__.'/Fixtures/TemplateTypes.php'; - $astFileReference = $parser->parseFile($filePath); - $astClassReferences = $astFileReference->classLikeReferences; - self::assertCount(0, $astClassReferences[0]->dependencies); - } -} diff --git a/tests/Core/Ast/Parser/TypeResolverTest.php b/tests/Core/Ast/Parser/TypeResolverTest.php deleted file mode 100644 index 4422182ff..000000000 --- a/tests/Core/Ast/Parser/TypeResolverTest.php +++ /dev/null @@ -1,62 +0,0 @@ -lexer = new Lexer(); - $this->typeParser = new TypeParser(new ConstExprParser()); - } - - /** - * @dataProvider docBlockProvider - */ - public function testResolvePHPStanDocParserType(string $doc, array $types): void - { - $tokens = new TokenIterator($this->lexer->tokenize($doc)); - $typeNode = $this->typeParser->parse($tokens); - - $typeResolver = new TypeResolver(); - $resolvedTypes = $typeResolver->resolvePHPStanDocParserType($typeNode, new TypeScope('\\Test\\'), ['T']); - - self::assertSame($types, $resolvedTypes); - } - - public static function docBlockProvider(): iterable - { - yield ['doc' => 'array', 'types' => ['\\Test\\DataProviderTestSuite', '\\Test\\TestCase']]; - yield ['doc' => 'array>>', 'types' => []]; - yield ['doc' => 'callable(A&...$a=, B&...=, C): Foo', 'types' => ['\\Test\\Foo', '\\Test\\A', '\\Test\\B', '\\Test\\C']]; - yield ['doc' => 'Foo::FOO_CONSTANT', 'types' => ['\\Test\\Foo']]; - yield ['doc' => 'array{a: Foo}', 'types' => ['\\Test\\Foo']]; - yield ['doc' => 'array-key', 'types' => []]; - yield ['doc' => 'trait-string', 'types' => []]; - yield ['doc' => 'callable-string', 'types' => []]; - yield ['doc' => 'numeric-string', 'types' => []]; - yield ['doc' => 'positive-int', 'types' => []]; - yield ['doc' => 'non-empty-array', 'types' => []]; - yield ['doc' => 'callable-array', 'types' => []]; - yield ['doc' => 'list', 'types' => ['\\Test\\Foo']]; - yield ['doc' => 'T', 'types' => []]; - yield ['doc' => 'Foo', 'types' => ['\\Test\\Foo']]; - yield ['doc' => 'T', 'types' => ['\\Test\\Foo']]; - yield ['doc' => 'Bar', 'types' => ['\\Test\\Bar', '\\Test\\Foo']]; - } -} diff --git a/tests/Core/Dependency/DependencyListTest.php b/tests/Core/Dependency/DependencyListTest.php deleted file mode 100644 index 0fed798bc..000000000 --- a/tests/Core/Dependency/DependencyListTest.php +++ /dev/null @@ -1,51 +0,0 @@ -addDependency($dep1 = new Dependency($classA, $classB, new FileOccurrence('a.php', 12), DependencyType::PARAMETER)); - $dependencyResult->addDependency($dep2 = new Dependency($classB, $classC, new FileOccurrence('b.php', 12), DependencyType::PARAMETER)); - $dependencyResult->addDependency($dep3 = new Dependency($classA, $classC, new FileOccurrence('a.php', 12), DependencyType::PARAMETER)); - self::assertSame([$dep1, $dep3], $dependencyResult->getDependenciesByClass($classA)); - self::assertSame([$dep2], $dependencyResult->getDependenciesByClass($classB)); - self::assertSame([], $dependencyResult->getDependenciesByClass($classC)); - self::assertCount(3, $dependencyResult->getDependenciesAndInheritDependencies()); - } - - public function testGetDependenciesAndInheritDependencies(): void - { - $classA = ClassLikeToken::fromFQCN('A'); - $classB = ClassLikeToken::fromFQCN('B'); - - $dependencyResult = new DependencyList(); - $dependencyResult->addDependency($dep1 = new Dependency($classA, $classB, new FileOccurrence('a.php', 12), DependencyType::PARAMETER)); - $dependencyResult->addInheritDependency($dep2 = new InheritDependency($classA, $classB, $dep1, - new AstInherit( - $classB, - new FileOccurrence('a.php', 12), - AstInheritType::EXTENDS - ) - )); - self::assertSame([$dep1, $dep2], $dependencyResult->getDependenciesAndInheritDependencies()); - } -} diff --git a/tests/Core/Dependency/DependencyResolverTest.php b/tests/Core/Dependency/DependencyResolverTest.php deleted file mode 100644 index 673f3a914..000000000 --- a/tests/Core/Dependency/DependencyResolverTest.php +++ /dev/null @@ -1,117 +0,0 @@ -dispatcher = $this->createMock(EventDispatcherInterface::class); - - $this->flattener = $this->createMock(InheritanceFlattener::class); - - $this->container = new ContainerBuilder(); - $this->container->set(EmitterType::CLASS_TOKEN->value, new ClassDependencyEmitter()); - $this->container->set(EmitterType::CLASS_SUPERGLOBAL_TOKEN->value, new ClassSuperglobalDependencyEmitter()); - $this->container->set(EmitterType::FILE_TOKEN->value, new FileDependencyEmitter()); - $this->container->set(EmitterType::FUNCTION_TOKEN->value, new FunctionDependencyEmitter()); - $this->container->set(EmitterType::FUNCTION_SUPERGLOBAL_TOKEN->value, new FunctionSuperglobalDependencyEmitter()); - $this->container->set(EmitterType::USE_TOKEN->value, new UsesDependencyEmitter()); - } - - public function testResolveWithDefaultEmitters(): void - { - $astMap = new AstMap([]); - - $this->dispatcher->method('dispatch')->willReturnOnConsecutiveCalls( - new PreEmitEvent('ClassDependencyEmitter'), - new PostEmitEvent(), - new PreEmitEvent('UsesDependencyEmitter'), - new PostEmitEvent(), - new PreFlattenEvent(), - new PostFlattenEvent() - ); - $this->flattener->expects(self::once())->method('flattenDependencies'); - - $resolver = new DependencyResolver( - ['types' => [ - EmitterType::CLASS_TOKEN->value, - EmitterType::USE_TOKEN->value, - ]], - $this->flattener, - $this->container, - $this->dispatcher - ); - - $resolver->resolve($astMap); - } - - public function testResolveWithCustomEmitters(): void - { - $astMap = new AstMap([]); - - $this->dispatcher->method('dispatch')->willReturnOnConsecutiveCalls( - new PreEmitEvent('FunctionDependencyEmitter'), - new PostEmitEvent(), - new PreFlattenEvent(), - new PostFlattenEvent() - ); - $this->flattener->expects(self::once())->method('flattenDependencies'); - - $resolver = new DependencyResolver( - ['types' => [EmitterType::FUNCTION_TOKEN->value]], - $this->flattener, - $this->container, - $this->dispatcher - ); - - $resolver->resolve($astMap); - } - - public function testResolveWithInvalidEmitterType(): void - { - $astMap = new AstMap([]); - - $this->dispatcher->expects(self::never())->method('dispatch'); - $this->flattener->expects(self::never())->method('flattenDependencies'); - - $resolver = new DependencyResolver( - ['types' => ['invalid']], - $this->flattener, - $this->container, - $this->dispatcher - ); - - $this->expectException(InvalidEmitterConfigurationException::class); - - $resolver->resolve($astMap); - } -} diff --git a/tests/Core/Dependency/DependencyTest.php b/tests/Core/Dependency/DependencyTest.php deleted file mode 100644 index d655f70e8..000000000 --- a/tests/Core/Dependency/DependencyTest.php +++ /dev/null @@ -1,26 +0,0 @@ -getDepender()->toString()); - self::assertSame('/foo.php', $dependency->getFileOccurrence()->filepath); - self::assertSame(23, $dependency->getFileOccurrence()->line); - self::assertSame('b', $dependency->getDependent()->toString()); - } -} diff --git a/tests/Core/Dependency/Emitter/ClassDependencyEmitterTest.php b/tests/Core/Dependency/Emitter/ClassDependencyEmitterTest.php deleted file mode 100644 index 565e18ab8..000000000 --- a/tests/Core/Dependency/Emitter/ClassDependencyEmitterTest.php +++ /dev/null @@ -1,45 +0,0 @@ -getName()); - } - - public function testApplyDependencies(): void - { - $deps = $this->getEmittedDependencies( - new ClassDependencyEmitter(), - __DIR__.'/Fixtures/Foo.php' - ); - - self::assertCount(18, $deps); - self::assertContains('Foo\Bar:6 on Foo\BarExtends', $deps); - self::assertContains('Foo\Bar:6 on Foo\BarInterface1', $deps); - self::assertContains('Foo\Bar:6 on BarInterface2', $deps); - self::assertContains('Foo\Bar:8 on Foo\SomeTrait', $deps); - self::assertContains('Foo\Bar:10 on Foo\SomeParam', $deps); - self::assertContains('Foo\Bar:10 on Foo\SomeClass', $deps); - self::assertContains('Foo\Bar:12 on Foo\SomeClass', $deps); - self::assertContains('Foo\Bar:13 on SomeOtherClass', $deps); - self::assertContains('Foo\Bar:15 on Foo\SomeOtherParam', $deps); - self::assertContains('Foo\Bar:19 on Foo\SomeInstanceOf', $deps); - self::assertContains('Foo\Bar:21 on Foo\SomeClass', $deps); - self::assertContains('Foo\Bar:23 on Foo\SomeClass', $deps); - self::assertContains('Foo\Bar:26 on Some\NamespacedClass', $deps); - self::assertContains('Foo\Bar:30 on Foo\SomeClass', $deps); - self::assertContains('Foo\Bar:32 on Foo\SomeClass', $deps); - self::assertContains('Foo\Bar:36 on Foo\string2', $deps); - self::assertContains('Foo\Bar:42 on Foo\SomeClass', $deps); - } -} diff --git a/tests/Core/Dependency/Emitter/ClassSuperglobalDependencyEmitterTest.php b/tests/Core/Dependency/Emitter/ClassSuperglobalDependencyEmitterTest.php deleted file mode 100644 index 7b01e409e..000000000 --- a/tests/Core/Dependency/Emitter/ClassSuperglobalDependencyEmitterTest.php +++ /dev/null @@ -1,30 +0,0 @@ -getName()); - } - - public function testApplyDependencies(): void - { - $deps = $this->getEmittedDependencies( - new ClassSuperglobalDependencyEmitter(), - __DIR__.'/Fixtures/Foo.php' - ); - - self::assertCount(2, $deps); - self::assertContains('Foo\Bar:51 on $_SESSION', $deps); - self::assertContains('Foo\Bar:52 on $_POST', $deps); - } -} diff --git a/tests/Core/Dependency/Emitter/EmitterTrait.php b/tests/Core/Dependency/Emitter/EmitterTrait.php deleted file mode 100644 index d712e234a..000000000 --- a/tests/Core/Dependency/Emitter/EmitterTrait.php +++ /dev/null @@ -1,65 +0,0 @@ -create(ParserFactory::ONLY_PHP7, new Lexer()), - new AstFileReferenceInMemoryCache(), - $typeResolver, - [ - new AnonymousClassExtractor(), - new FunctionLikeExtractor($typeResolver), - new PropertyExtractor($typeResolver), - new KeywordExtractor($typeResolver), - new StaticExtractor($typeResolver), - new FunctionCallResolver($typeResolver), - new VariableExtractor(), - ] - ); - $astMap = (new AstLoader($parser, new EventDispatcher()))->createAstMap($files); - $result = new DependencyList(); - - $emitter->applyDependencies($astMap, $result); - - return array_map( - static function (DependencyInterface $d) { - return sprintf('%s:%d on %s', - $d->getDepender()->toString(), - $d->getFileOccurrence()->line, - $d->getDependent()->toString() - ); - }, - $result->getDependenciesAndInheritDependencies() - ); - } -} diff --git a/tests/Core/Dependency/Emitter/FQDNIndexNodeTest.php b/tests/Core/Dependency/Emitter/FQDNIndexNodeTest.php deleted file mode 100644 index 1c2894dc5..000000000 --- a/tests/Core/Dependency/Emitter/FQDNIndexNodeTest.php +++ /dev/null @@ -1,66 +0,0 @@ -isFQDN()); - } - - public function testSameClassReferenceIsFQDN(): void - { - $node = new FQDNIndexNode(); - $reference = FQDNIndexNode::class; - $path = explode('\\', $reference); - - $node->setNestedNode($path); - - static::assertFalse($node->isFQDN()); - - $comparedNode = $node->getNestedNode($path); - static::assertInstanceOf(FQDNIndexNode::class, $comparedNode); - static::assertNotSame($node, $comparedNode); - static::assertTrue($comparedNode->isFQDN()); - } - - public function testFullPathIsFQDNForSubPath(): void - { - $node = new FQDNIndexNode(); - $reference = FQDNIndexNode::class; - $fullPath = explode('\\', $reference); - $usedPath = array_slice($fullPath, 0, 2); - - $node->setNestedNode($usedPath); - - static::assertNull($node->getNestedNode($fullPath)); - } - - public function testSubPathIsNotFQDNForFullPath(): void - { - $node = new FQDNIndexNode(); - $reference = FQDNIndexNode::class; - $fullPath = explode('\\', $reference); - $usedPath = array_slice($fullPath, 0, 2); - - $node->setNestedNode($fullPath); - - static::assertFalse($node->isFQDN()); - - $comparedNode = $node->getNestedNode($usedPath); - static::assertInstanceOf(FQDNIndexNode::class, $comparedNode); - static::assertNotSame($node, $comparedNode); - static::assertFalse($comparedNode->isFQDN()); - } -} diff --git a/tests/Core/Dependency/Emitter/FileDependencyEmitterTest.php b/tests/Core/Dependency/Emitter/FileDependencyEmitterTest.php deleted file mode 100644 index 6e9db6555..000000000 --- a/tests/Core/Dependency/Emitter/FileDependencyEmitterTest.php +++ /dev/null @@ -1,59 +0,0 @@ -getName()); - } - - public function testApplyDependencies(): void - { - $deps = $this->getEmittedDependencies( - new FileDependencyEmitter(), - __DIR__.'/Fixtures/Baz.php' - ); - - self::assertCount(31, $deps); - self::assertContains('/tests/Core/Dependency/Emitter/Fixtures/Baz.php:7 on Foo\SomeClass', $deps); - self::assertContains('/tests/Core/Dependency/Emitter/Fixtures/Baz.php:8 on SomeOtherClass', $deps); - self::assertContains('/tests/Core/Dependency/Emitter/Fixtures/Baz.php:10 on Foo\SomeOtherParam', $deps); - self::assertContains('/tests/Core/Dependency/Emitter/Fixtures/Baz.php:13 on Foo\SomeInstanceOf', $deps); - self::assertContains('/tests/Core/Dependency/Emitter/Fixtures/Baz.php:15 on Foo\SomeClass', $deps); - self::assertContains('/tests/Core/Dependency/Emitter/Fixtures/Baz.php:17 on Foo\SomeClass', $deps); - self::assertContains('/tests/Core/Dependency/Emitter/Fixtures/Baz.php:20 on Foo\SomeClass', $deps); - self::assertContains('/tests/Core/Dependency/Emitter/Fixtures/Baz.php:25 on Foo\SomeClass', $deps); - self::assertContains('/tests/Core/Dependency/Emitter/Fixtures/Baz.php:33 on Foo\string2', $deps); - self::assertContains('/tests/Core/Dependency/Emitter/Fixtures/Baz.php:41 on Foo\SomeClass', $deps); - self::assertContains('/tests/Core/Dependency/Emitter/Fixtures/Baz.php:45 on $_SESSION', $deps); - self::assertContains('/tests/Core/Dependency/Emitter/Fixtures/Baz.php:46 on $_POST', $deps); - self::assertContains('/tests/Core/Dependency/Emitter/Fixtures/Baz.php:54 on Foo\SomeClass', $deps); - self::assertContains('/tests/Core/Dependency/Emitter/Fixtures/Baz.php:55 on SomeOtherClass', $deps); - self::assertContains('/tests/Core/Dependency/Emitter/Fixtures/Baz.php:57 on Foo\SomeOtherParam', $deps); - self::assertContains('/tests/Core/Dependency/Emitter/Fixtures/Baz.php:60 on Foo\SomeInstanceOf', $deps); - self::assertContains('/tests/Core/Dependency/Emitter/Fixtures/Baz.php:62 on Foo\SomeClass', $deps); - self::assertContains('/tests/Core/Dependency/Emitter/Fixtures/Baz.php:64 on Foo\SomeClass', $deps); - self::assertContains('/tests/Core/Dependency/Emitter/Fixtures/Baz.php:52 on Foo\SomeParam', $deps); - self::assertContains('/tests/Core/Dependency/Emitter/Fixtures/Baz.php:52 on Foo\SomeClass', $deps); - self::assertContains('/tests/Core/Dependency/Emitter/Fixtures/Baz.php:67 on Some\NamespacedClass', $deps); - self::assertContains('/tests/Core/Dependency/Emitter/Fixtures/Baz.php:74 on Foo\SomeClass', $deps); - self::assertContains('/tests/Core/Dependency/Emitter/Fixtures/Baz.php:79 on Foo\SomeClass', $deps); - self::assertContains('/tests/Core/Dependency/Emitter/Fixtures/Baz.php:87 on Foo\string2', $deps); - self::assertContains('/tests/Core/Dependency/Emitter/Fixtures/Baz.php:95 on Foo\SomeClass', $deps); - self::assertContains('/tests/Core/Dependency/Emitter/Fixtures/Baz.php:110 on $_SESSION', $deps); - self::assertContains('/tests/Core/Dependency/Emitter/Fixtures/Baz.php:111 on $_POST', $deps); - self::assertContains('/tests/Core/Dependency/Emitter/Fixtures/Baz.php:48 on Foo\BarExtends', $deps); - self::assertContains('/tests/Core/Dependency/Emitter/Fixtures/Baz.php:48 on Foo\BarInterface1', $deps); - self::assertContains('/tests/Core/Dependency/Emitter/Fixtures/Baz.php:48 on BarInterface2', $deps); - self::assertContains('/tests/Core/Dependency/Emitter/Fixtures/Baz.php:50 on Foo\SomeTrait', $deps); - } -} diff --git a/tests/Core/Dependency/Emitter/Fixtures/Bar.php b/tests/Core/Dependency/Emitter/Fixtures/Bar.php deleted file mode 100644 index f3000a215..000000000 --- a/tests/Core/Dependency/Emitter/Fixtures/Bar.php +++ /dev/null @@ -1,87 +0,0 @@ -getName()); - } - - public function testApplyDependencies(): void - { - $deps = $this->getEmittedDependencies( - new FunctionCallDependencyEmitter(), - __DIR__.'/Fixtures/Bar.php' - ); - - self::assertCount(1, $deps); - - self::assertContains('Foo\testAnonymousClass():86 on Foo\test()', $deps); - } -} diff --git a/tests/Core/Dependency/Emitter/FunctionDependencyEmitterTest.php b/tests/Core/Dependency/Emitter/FunctionDependencyEmitterTest.php deleted file mode 100644 index 34ad7a846..000000000 --- a/tests/Core/Dependency/Emitter/FunctionDependencyEmitterTest.php +++ /dev/null @@ -1,57 +0,0 @@ -getName()); - } - - public function testApplyDependencies(): void - { - $deps = $this->getEmittedDependencies( - new FunctionDependencyEmitter(), - __DIR__.'/Fixtures/Bar.php' - ); - - self::assertCount(29, $deps); - self::assertContains('Foo\test():6 on Foo\SomeParam', $deps); - self::assertContains('Foo\test():6 on Foo\SomeClass', $deps); - self::assertContains('Foo\test():8 on Foo\SomeClass', $deps); - self::assertContains('Foo\test():9 on SomeOtherClass', $deps); - self::assertContains('Foo\test():11 on Foo\SomeOtherParam', $deps); - self::assertContains('Foo\test():15 on Foo\SomeInstanceOf', $deps); - self::assertContains('Foo\test():17 on Foo\SomeClass', $deps); - self::assertContains('Foo\test():19 on Foo\SomeClass', $deps); - self::assertContains('Foo\test():21 on Foo\SomeClass', $deps); - self::assertContains('Foo\test():23 on Foo\SomeClass', $deps); - self::assertContains('Foo\test():27 on Foo\string2', $deps); - self::assertContains('Foo\test():31 on Foo\SomeClass', $deps); - self::assertContains('Foo\testAnonymousClass():38 on Foo\BarExtends', $deps); - self::assertContains('Foo\testAnonymousClass():38 on Foo\BarInterface1', $deps); - self::assertContains('Foo\testAnonymousClass():38 on BarInterface2', $deps); - self::assertContains('Foo\testAnonymousClass():40 on Foo\SomeTrait', $deps); - self::assertContains('Foo\testAnonymousClass():42 on Foo\SomeClass', $deps); - self::assertContains('Foo\testAnonymousClass():45 on SomeOtherClass', $deps); - self::assertContains('Foo\testAnonymousClass():47 on Foo\SomeOtherParam', $deps); - self::assertContains('Foo\testAnonymousClass():51 on Foo\SomeInstanceOf', $deps); - self::assertContains('Foo\testAnonymousClass():53 on Foo\SomeClass', $deps); - self::assertContains('Foo\testAnonymousClass():55 on Foo\SomeClass', $deps); - self::assertContains('Foo\testAnonymousClass():42 on Foo\SomeParam', $deps); - self::assertContains('Foo\testAnonymousClass():42 on Foo\SomeClass', $deps); - self::assertContains('Foo\testAnonymousClass():58 on Some\NamespacedClass', $deps); - self::assertContains('Foo\testAnonymousClass():62 on Foo\SomeClass', $deps); - self::assertContains('Foo\testAnonymousClass():64 on Foo\SomeClass', $deps); - self::assertContains('Foo\testAnonymousClass():68 on Foo\string2', $deps); - self::assertContains('Foo\testAnonymousClass():72 on Foo\SomeClass', $deps); - } -} diff --git a/tests/Core/Dependency/Emitter/FunctionSuperglobalDependencyEmitterTest.php b/tests/Core/Dependency/Emitter/FunctionSuperglobalDependencyEmitterTest.php deleted file mode 100644 index 3863fd235..000000000 --- a/tests/Core/Dependency/Emitter/FunctionSuperglobalDependencyEmitterTest.php +++ /dev/null @@ -1,32 +0,0 @@ -getName()); - } - - public function testApplyDependencies(): void - { - $deps = $this->getEmittedDependencies( - new FunctionSuperglobalDependencyEmitter(), - __DIR__.'/Fixtures/Bar.php' - ); - - self::assertCount(4, $deps); - self::assertContains('Foo\test():33 on $_SESSION', $deps); - self::assertContains('Foo\test():34 on $_POST', $deps); - self::assertContains('Foo\testAnonymousClass():81 on $_SESSION', $deps); - self::assertContains('Foo\testAnonymousClass():82 on $_POST', $deps); - } -} diff --git a/tests/Core/Dependency/Emitter/UsesDependencyEmitterTest.php b/tests/Core/Dependency/Emitter/UsesDependencyEmitterTest.php deleted file mode 100644 index 888bf39e0..000000000 --- a/tests/Core/Dependency/Emitter/UsesDependencyEmitterTest.php +++ /dev/null @@ -1,77 +0,0 @@ -getName()); - } - - public function testApplyDependencies(): void - { - $deps = $this->getEmittedDependencies( - new UsesDependencyEmitter(), - __DIR__.'/Fixtures/Foo.php' - ); - - self::assertCount(1, $deps); - self::assertContains('Foo\Bar:4 on SomeUse', $deps); - } - - public function testIgnoresNamespaces(): void - { - $deps = $this->getEmittedDependencies( - new UsesDependencyEmitter(), - [ - __DIR__.'/Fixtures/IgnoreNamespace/Deps/UsedWithFQDN.php', - __DIR__.'/Fixtures/IgnoreNamespace/Deps/UsedWithNamespace.php', - __DIR__.'/Fixtures/IgnoreNamespace/Deps/Functions.php', - __DIR__.'/Fixtures/IgnoreNamespace/Uses/Foo.php', - ] - ); - - self::assertCount(2, $deps); - self::assertNotContains('IgnoreNamespace\Uses\Foo:5 on IgnoreNamespace\Deps', $deps); - self::assertContains('IgnoreNamespace\Uses\Foo:6 on IgnoreNamespace\Deps\UsedWithFQDN', $deps); - self::assertContains('IgnoreNamespace\Uses\Foo:7 on IgnoreNamespace\Deps\Functions\functionUsedWithFQDN', $deps); - } - - public function testIncludesFQDNWhichIsAlsoANamespacePrefix(): void - { - $deps = $this->getEmittedDependencies( - new UsesDependencyEmitter(), - [ - __DIR__.'/Fixtures/FQDNNamespacePrefix/FQDN.php', - __DIR__.'/Fixtures/FQDNNamespacePrefix/FQDN/SomeClass.php', - __DIR__.'/Fixtures/FQDNNamespacePrefix/Uses/Foo.php', - ] - ); - - self::assertCount(1, $deps); - self::assertContains('FQDNNamespacePrefix\Uses\Foo:5 on FQDNNamespacePrefix\FQDN', $deps); - } - - public function testIncludesFQDNWhichIsDoesNotExistAndSubstringOfAnotherFQDN(): void - { - $deps = $this->getEmittedDependencies( - new UsesDependencyEmitter(), - [ - __DIR__.'/Fixtures/FQDNIsSubstring/FQDN/SomeClass.php', - __DIR__.'/Fixtures/FQDNIsSubstring/Foo.php', - ] - ); - - self::assertCount(2, $deps); - self::assertContains('FQDNIsSubstring\Foo:5 on FQDNIsSubstring\FQDN\Some', $deps); - self::assertContains('FQDNIsSubstring\Foo:6 on FQDNIsSubstring\FQDN\SomeClass', $deps); - } -} diff --git a/tests/Core/Dependency/InheritDependencyTest.php b/tests/Core/Dependency/InheritDependencyTest.php deleted file mode 100644 index a0a701d86..000000000 --- a/tests/Core/Dependency/InheritDependencyTest.php +++ /dev/null @@ -1,37 +0,0 @@ -getDepender()); - self::assertSame($classLikeNameB, $dependency->getDependent()); - self::assertSame(1, $dependency->getFileOccurrence()->line); - self::assertSame($dep, $dependency->originalDependency); - self::assertSame($astInherit, $dependency->inheritPath); - } -} diff --git a/tests/Core/Dependency/InheritanceFlattenerTest.php b/tests/Core/Dependency/InheritanceFlattenerTest.php deleted file mode 100644 index 0b13861ec..000000000 --- a/tests/Core/Dependency/InheritanceFlattenerTest.php +++ /dev/null @@ -1,97 +0,0 @@ -createMock(ClassLikeReference::class); - $astClass->method('getToken')->willReturn(ClassLikeToken::fromFQCN($className)); - - return $astClass; - } - - private function getDependency($className) - { - $dep = $this->createMock(Dependency::class); - $dep->method('getDepender')->willReturn(ClassLikeToken::fromFQCN($className)); - $dep->method('getDependent')->willReturn(ClassLikeToken::fromFQCN($className.'_b')); - - return $dep; - } - - public function testFlattenDependencies(): void - { - $astMap = $this->createMock(AstMap::class); - - $astMap->method('getClassLikeReferences')->willReturn([ - $this->getAstClassReference('classA'), - $this->getAstClassReference('classB'), - $this->getAstClassReference('classBaum'), - $this->getAstClassReference('classWeihnachtsbaum'), - $this->getAstClassReference('classGeschmückterWeihnachtsbaum'), - ]); - - $dependencyResult = new DependencyList(); - $dependencyResult->addDependency($this->getDependency('classA')); - $dependencyResult->addDependency($this->getDependency('classB')); - $dependencyResult->addDependency($this->getDependency('classBaum')); - $dependencyResult->addDependency($this->getDependency('classWeihnachtsbaumsA')); - - $astMap->method('getClassInherits')->willReturnOnConsecutiveCalls( - // classA - [], - // classB - [], - // classBaum, - [], - // classWeihnachtsbaum - [ - new AstInherit( - ClassLikeToken::fromFQCN('classBaum'), new FileOccurrence('classWeihnachtsbaum.php', 3), - AstInheritType::USES - ), - ], - // classGeschmückterWeihnachtsbaum - [ - (new AstInherit( - ClassLikeToken::fromFQCN('classBaum'), new FileOccurrence('classGeschmückterWeihnachtsbaum.php', 3), - AstInheritType::EXTENDS - )) - ->replacePath([ - new AstInherit( - ClassLikeToken::fromFQCN('classWeihnachtsbaum'), - new FileOccurrence('classBaum.php', 3), - AstInheritType::USES - ), - ]), - ] - ); - - (new InheritanceFlattener())->flattenDependencies($astMap, $dependencyResult); - - $inheritDeps = array_filter( - $dependencyResult->getDependenciesAndInheritDependencies(), - static function ($v) { - return $v instanceof InheritDependency; - } - ); - - self::assertCount(2, $inheritDeps); - } -} diff --git a/tests/Core/Dependency/TokenResolverTest.php b/tests/Core/Dependency/TokenResolverTest.php deleted file mode 100644 index 23c8ec414..000000000 --- a/tests/Core/Dependency/TokenResolverTest.php +++ /dev/null @@ -1,130 +0,0 @@ -resolver = new TokenResolver(); - } - - public function testResolvesClassLikeNotInAstMap(): void - { - $astMap = new AstMap([]); - $token = ClassLikeToken::fromFQCN('App\\Foo'); - - $resolved = $this->resolver->resolve($token, $astMap); - - self::assertInstanceOf(ClassLikeReference::class, $resolved); - self::assertSame($token->toString(), $resolved->getToken()->toString()); - } - - public function testResolvesClassLikeFromAstMap(): void - { - $token = ClassLikeToken::fromFQCN('App\\Foo'); - $classReference = new ClassLikeReference($token); - $fileReference = new FileReference( - 'path/to/file.php', - [ - $classReference, - ], - [], - [] - ); - $astMap = new AstMap([$fileReference]); - - $resolved = $this->resolver->resolve($token, $astMap); - - self::assertInstanceOf(ClassLikeReference::class, $resolved); - self::assertSame($token->toString(), $resolved->getToken()->toString()); - } - - public function testResolvesFunctionNotInAstMap(): void - { - $astMap = new AstMap([]); - $token = FunctionToken::fromFQCN('App\\Foo::foo'); - - $resolved = $this->resolver->resolve($token, $astMap); - - self::assertInstanceOf(FunctionReference::class, $resolved); - self::assertSame($token->toString(), $resolved->getToken()->toString()); - } - - public function testResolvesFunctionFromAstMap(): void - { - $token = FunctionToken::fromFQCN('App\\Foo::foo'); - $functionReference = new FunctionReference($token); - $fileReference = new FileReference( - 'path/to/file.php', - [], - [ - $functionReference, - ], - [] - ); - $astMap = new AstMap([$fileReference]); - - $resolved = $this->resolver->resolve($token, $astMap); - - self::assertInstanceOf(FunctionReference::class, $resolved); - self::assertSame($token->toString(), $resolved->getToken()->toString()); - } - - public function testResolvesSuperglobal(): void - { - $astMap = new AstMap([]); - $token = SuperGlobalToken::from('_POST'); - - $resolved = $this->resolver->resolve($token, $astMap); - - self::assertInstanceOf(VariableReference::class, $resolved); - self::assertSame($token->toString(), $resolved->getToken()->toString()); - } - - public function testResolvesFileNotInAstMap(): void - { - $astMap = new AstMap([]); - $token = new FileToken('path/to/file.php'); - - $resolved = $this->resolver->resolve($token, $astMap); - - self::assertInstanceOf(FileReference::class, $resolved); - self::assertSame($token->toString(), $resolved->getToken()->toString()); - } - - public function testResolvesFileFromAstMap(): void - { - $fileReference = new FileReference( - 'path/to/file.php', - [], - [], - [] - ); - $astMap = new AstMap([$fileReference]); - $token = new FileToken('path/to/file.php'); - - $resolved = $this->resolver->resolve($token, $astMap); - - self::assertInstanceOf(FileReference::class, $resolved); - self::assertSame($token->toString(), $resolved->getToken()->toString()); - } -} diff --git a/tests/Core/InputCollector/FileInputCollectorTest.php b/tests/Core/InputCollector/FileInputCollectorTest.php deleted file mode 100644 index ee6569bc9..000000000 --- a/tests/Core/InputCollector/FileInputCollectorTest.php +++ /dev/null @@ -1,48 +0,0 @@ -collect()); - - natcasesort($files); - - self::assertSame( - [Path::normalize(__DIR__.'/Fixtures/example.php')], - array_values($files) - ); - } - - public function testCollectsPhpFilesUsingRelativePath(): void - { - $collector = new FileInputCollector(['Fixtures'], [], __DIR__); - - $files = array_map(static function ($filePath) { - return Path::normalize($filePath); - }, $collector->collect()); - - natcasesort($files); - - self::assertSame( - [Path::normalize(__DIR__.'/Fixtures/example.php')], - array_values($files) - ); - } -} diff --git a/tests/Core/InputCollector/Fixtures/example.php b/tests/Core/InputCollector/Fixtures/example.php deleted file mode 100644 index 91da760c5..000000000 --- a/tests/Core/InputCollector/Fixtures/example.php +++ /dev/null @@ -1 +0,0 @@ -getPathname()); - }, - iterator_to_array($iterator, false) - ); - - sort($values); - sort($resultArray); - - self::assertSame($resultArray, $values); - } - - public static function getTestFilterData(): array - { - $inner = new ArrayIterator(); - - // PATH: A/B/C/abc.dat - $inner[] = new SplFileInfo( - 'A'.DIRECTORY_SEPARATOR.'B'.DIRECTORY_SEPARATOR.'C'.DIRECTORY_SEPARATOR.'abc.dat' - ); - - // PATH: A/B/ab.dat - $inner[] = new SplFileInfo('A'.DIRECTORY_SEPARATOR.'B'.DIRECTORY_SEPARATOR.'ab.dat'); - - // PATH: A/a.dat - $inner[] = new SplFileInfo('A'.DIRECTORY_SEPARATOR.'a.dat'); - - // PATH: copy/A/B/C/abc.dat.copy - $inner[] = new SplFileInfo( - 'copy'.DIRECTORY_SEPARATOR.'A'.DIRECTORY_SEPARATOR.'B'.DIRECTORY_SEPARATOR.'C'.DIRECTORY_SEPARATOR.'abc.dat.copy' - ); - - // PATH: copy/A/B/ab.dat.copy - $inner[] = new SplFileInfo( - 'copy'.DIRECTORY_SEPARATOR.'A'.DIRECTORY_SEPARATOR.'B'.DIRECTORY_SEPARATOR.'ab.dat.copy' - ); - - // PATH: copy/A/a.dat.copy - $inner[] = new SplFileInfo('copy'.DIRECTORY_SEPARATOR.'A'.DIRECTORY_SEPARATOR.'a.dat.copy'); - - return [ - [$inner, ['/^A/'], [], ['A/B/C/abc.dat', 'A/B/ab.dat', 'A/a.dat']], - [$inner, ['/^A\/B/'], [], ['A/B/C/abc.dat', 'A/B/ab.dat']], - [$inner, ['/^A\/B\/C/'], [], ['A/B/C/abc.dat']], - [$inner, ['/A\/B\/C/'], [], ['A/B/C/abc.dat', 'copy/A/B/C/abc.dat.copy']], - - [$inner, ['A'], [], ['A/B/C/abc.dat', 'A/B/ab.dat', 'A/a.dat', 'copy/A/B/C/abc.dat.copy', 'copy/A/B/ab.dat.copy', 'copy/A/a.dat.copy']], - [$inner, ['A/B'], [], ['A/B/C/abc.dat', 'A/B/ab.dat', 'copy/A/B/C/abc.dat.copy', 'copy/A/B/ab.dat.copy']], - [$inner, ['A/B/C'], [], ['A/B/C/abc.dat', 'copy/A/B/C/abc.dat.copy']], - - [$inner, ['copy/A'], [], ['copy/A/B/C/abc.dat.copy', 'copy/A/B/ab.dat.copy', 'copy/A/a.dat.copy']], - [$inner, ['copy/A/B'], [], ['copy/A/B/C/abc.dat.copy', 'copy/A/B/ab.dat.copy']], - [$inner, ['copy/A/B/C'], [], ['copy/A/B/C/abc.dat.copy']], - ]; - } -} diff --git a/tests/Core/Layer/Collector/AttributeCollectorTest.php b/tests/Core/Layer/Collector/AttributeCollectorTest.php deleted file mode 100644 index 3ddb44152..000000000 --- a/tests/Core/Layer/Collector/AttributeCollectorTest.php +++ /dev/null @@ -1,52 +0,0 @@ -collector = new AttributeCollector(); - } - - public static function dataProviderSatisfy(): iterable - { - yield 'matches usage of attribute with only partial name' => [ - ['value' => 'MyAttribute'], - true, - ]; - yield 'does not match unescaped fully qualified class name' => [ - ['value' => 'App\MyAttribute'], - true, - ]; - yield 'does not match other attributes' => [ - ['value' => 'OtherAttribute'], - false, - ]; - } - - /** - * @dataProvider dataProviderSatisfy - */ - public function testSatisfy(array $config, bool $expected): void - { - $classLikeReference = FileReferenceBuilder::create('Foo.php') - ->newClass('App\Foo', [], false) - ->attribute('App\MyAttribute', 2) - ->attribute('MyAttribute', 3) - ->build(); - $actual = $this->collector->satisfy($config, $classLikeReference); - - self::assertSame($expected, $actual); - } -} diff --git a/tests/Core/Layer/Collector/BoolCollectorTest.php b/tests/Core/Layer/Collector/BoolCollectorTest.php deleted file mode 100644 index 52ee75596..000000000 --- a/tests/Core/Layer/Collector/BoolCollectorTest.php +++ /dev/null @@ -1,394 +0,0 @@ -createMock(ConditionalCollectorInterface::class); - $collector - ->method('resolvable') - ->with($this->callback(static fn (array $config): bool => 'custom' === $config['type'])) - ->willReturnCallback(static fn (array $config): bool => (bool) $config['resolvable'] ?? false); - $collector - ->method('satisfy') - ->with($this->callback(static fn (array $config): bool => 'custom' === $config['type'])) - ->willReturnCallback(static fn (array $config): bool => (bool) $config['satisfy'] ?? false); - - $resolver = $this->createMock(CollectorResolverInterface::class); - $resolver - ->method('resolve') - ->with($this->callback(static fn (array $config): bool => 'custom' === $config['type'])) - ->willReturnCallback(static fn (array $config): Collectable => new Collectable($collector, $config)); - - $this->collector = new BoolCollector($resolver); - } - - public static function provideResolvableConfiguration(): iterable - { - yield 'must with resolvable collector' => [ - [ - 'must' => [ - [ - 'type' => 'custom', - 'resolvable' => true, - ], - ], - ], - true, - ]; - - yield 'must with unresolvable collector' => [ - [ - 'must' => [ - [ - 'type' => 'custom', - 'resolvable' => false, - ], - ], - ], - false, - ]; - - yield 'must_not with resolvable collector' => [ - [ - 'must_not' => [ - [ - 'type' => 'custom', - 'resolvable' => true, - ], - ], - ], - true, - ]; - - yield 'must_not with unresolvable collector' => [ - [ - 'must_not' => [ - [ - 'type' => 'custom', - 'resolvable' => false, - ], - ], - ], - false, - ]; - - yield 'must with multiple collectors, unresolvable' => [ - [ - 'must' => [ - [ - 'type' => 'custom', - 'resolvable' => true, - ], - [ - 'type' => 'custom', - 'resolvable' => false, - ], - [ - 'type' => 'custom', - 'resolvable' => true, - ], - ], - ], - false, - ]; - - yield 'must_not with multiple collectors, unresolvable' => [ - [ - 'must_not' => [ - [ - 'type' => 'custom', - 'resolvable' => true, - ], - [ - 'type' => 'custom', - 'resolvable' => true, - ], - [ - 'type' => 'custom', - 'resolvable' => false, - ], - ], - ], - false, - ]; - - yield 'mixed with must_not unresolvable' => [ - [ - 'must' => [ - [ - 'type' => 'custom', - 'resolvable' => true, - ], - ], - 'must_not' => [ - [ - 'type' => 'custom', - 'resolvable' => false, - ], - ], - ], - false, - ]; - - yield 'mixed with must unresolvable' => [ - [ - 'must' => [ - [ - 'type' => 'custom', - 'resolvable' => false, - ], - ], - 'must_not' => [ - [ - 'type' => 'custom', - 'resolvable' => true, - ], - ], - ], - false, - ]; - - yield 'mixed with all resolvable' => [ - [ - 'must' => [ - [ - 'type' => 'custom', - 'resolvable' => true, - ], - ], - 'must_not' => [ - [ - 'type' => 'custom', - 'resolvable' => true, - ], - [ - 'type' => 'custom', - 'resolvable' => true, - ], - ], - ], - true, - ]; - } - - /** - * @dataProvider provideResolvableConfiguration - */ - public function testResolvable(array $config, bool $expectedOutcome): void - { - $actualOutcome = $this->collector->resolvable($config); - - self::assertSame($expectedOutcome, $actualOutcome); - } - - public static function providesatisfiableConfiguration(): iterable - { - yield 'must with satisfiable collector' => [ - [ - 'must' => [ - [ - 'type' => 'custom', - 'satisfy' => true, - ], - ], - ], - true, - ]; - - yield 'must with unsatisfiable collector' => [ - [ - 'must' => [ - [ - 'type' => 'custom', - 'satisfy' => false, - ], - ], - ], - false, - ]; - - yield 'must_not with satisfiable collector' => [ - [ - 'must_not' => [ - [ - 'type' => 'custom', - 'satisfy' => true, - ], - ], - ], - false, - ]; - - yield 'must_not with unsatisfiable collector' => [ - [ - 'must_not' => [ - [ - 'type' => 'custom', - 'satisfy' => false, - ], - ], - ], - true, - ]; - - yield 'must with multiple collectors, unsatisfiable' => [ - [ - 'must' => [ - [ - 'type' => 'custom', - 'satisfy' => false, - ], - [ - 'type' => 'custom', - 'satisfy' => true, - ], - [ - 'type' => 'custom', - 'satisfy' => true, - ], - ], - ], - false, - ]; - - yield 'must_not with multiple collectors, unsatisfiable' => [ - [ - 'must_not' => [ - [ - 'type' => 'custom', - 'satisfy' => false, - ], - [ - 'type' => 'custom', - 'satisfy' => true, - ], - [ - 'type' => 'custom', - 'satisfy' => false, - ], - ], - ], - false, - ]; - - yield 'mixed with must_not unsatisfiable' => [ - [ - 'must' => [ - [ - 'type' => 'custom', - 'satisfy' => true, - ], - ], - 'must_not' => [ - [ - 'type' => 'custom', - 'satisfy' => true, - ], - ], - ], - false, - ]; - - yield 'mixed with must unsatisfiable' => [ - [ - 'must' => [ - [ - 'type' => 'custom', - 'satisfy' => false, - ], - ], - 'must_not' => [ - [ - 'type' => 'custom', - 'satisfy' => false, - ], - ], - ], - false, - ]; - - yield 'mixed with all satisfiable' => [ - [ - 'must' => [ - [ - 'type' => 'custom', - 'satisfy' => true, - ], - ], - 'must_not' => [ - [ - 'type' => 'custom', - 'satisfy' => false, - ], - [ - 'type' => 'custom', - 'satisfy' => false, - ], - ], - ], - true, - ]; - } - - /** - * @dataProvider provideSatisfiableConfiguration - */ - public function testSatisfy(array $config, bool $expectedOutcome): void - { - $reference = new ClassLikeReference(ClassLikeToken::fromFQCN('App\\Foo')); - $actualOutcome = $this->collector->satisfy($config, $reference); - - self::assertSame($expectedOutcome, $actualOutcome); - } - - public function testThrowsOnInvalidConfiguration(): void - { - $config = [ - [ - 'must' => [ - [ - 'type' => 'custom', - 'satisfy' => true, - ], - ], - 'must_not' => [ - [ - 'type' => 'custom', - 'satisfy' => false, - ], - ], - 'invalid' => [ - [ - 'type' => 'custom', - 'satisfy' => false, - ], - ], - ], - true, - ]; - $reference = new ClassLikeReference(ClassLikeToken::fromFQCN('App\\Foo')); - - $this->expectException(InvalidCollectorDefinitionException::class); - $this->expectExceptionMessage('"bool" collector must have a "must" or a "must_not" attribute.'); - - $this->collector->satisfy($config, $reference); - } -} diff --git a/tests/Core/Layer/Collector/ClassCollectorTest.php b/tests/Core/Layer/Collector/ClassCollectorTest.php deleted file mode 100644 index 329426ce6..000000000 --- a/tests/Core/Layer/Collector/ClassCollectorTest.php +++ /dev/null @@ -1,72 +0,0 @@ -sut = new ClassCollector(); - } - - public static function dataProviderSatisfy(): iterable - { - yield [['value' => '^Foo\\\\Bar$'], 'Foo\\Bar', true]; - yield [['value' => '^Foo\\\\Bar$'], 'Foo\\Baz', false]; - } - - /** - * @dataProvider dataProviderSatisfy - */ - public function testSatisfy(array $configuration, string $className, bool $expected): void - { - $stat = $this->sut->satisfy( - $configuration, - new ClassLikeReference(ClassLikeToken::fromFQCN($className), ClassLikeType::TYPE_CLASS), - ); - - self::assertSame($expected, $stat); - } - - public static function provideTypes(): iterable - { - yield 'classLike' => [ClassLikeType::TYPE_CLASSLIKE, false]; - yield 'class' => [ClassLikeType::TYPE_CLASS, true]; - yield 'interface' => [ClassLikeType::TYPE_INTERFACE, false]; - yield 'trait' => [ClassLikeType::TYPE_TRAIT, false]; - } - - /** - * @dataProvider provideTypes - */ - public function testSatisfyTypes(ClassLikeType $classLikeType, bool $matches): void - { - $stat = $this->sut->satisfy( - ['value' => '^Foo\\\\Bar$'], - new ClassLikeReference(ClassLikeToken::fromFQCN('Foo\\Bar'), $classLikeType), - ); - - self::assertSame($matches, $stat); - } - - public function testWrongRegexParam(): void - { - $this->expectException(InvalidCollectorDefinitionException::class); - - $this->sut->satisfy( - ['Foo' => 'a'], - new ClassLikeReference(ClassLikeToken::fromFQCN('Foo'), ClassLikeType::TYPE_CLASS), - ); - } -} diff --git a/tests/Core/Layer/Collector/ClassLikeCollectorTest.php b/tests/Core/Layer/Collector/ClassLikeCollectorTest.php deleted file mode 100644 index 5d5ccb793..000000000 --- a/tests/Core/Layer/Collector/ClassLikeCollectorTest.php +++ /dev/null @@ -1,72 +0,0 @@ -sut = new ClassLikeCollector(); - } - - public static function dataProviderSatisfy(): iterable - { - yield [['value' => '^Foo\\\\Bar$'], 'Foo\\Bar', true]; - yield [['value' => '^Foo\\\\Bar$'], 'Foo\\Baz', false]; - } - - /** - * @dataProvider dataProviderSatisfy - */ - public function testSatisfy(array $configuration, string $className, bool $expected): void - { - $stat = $this->sut->satisfy( - $configuration, - new ClassLikeReference(ClassLikeToken::fromFQCN($className), ClassLikeType::TYPE_CLASS), - ); - - self::assertSame($expected, $stat); - } - - public static function provideTypes(): iterable - { - yield 'classLike' => [ClassLikeType::TYPE_CLASSLIKE, true]; - yield 'class' => [ClassLikeType::TYPE_CLASS, true]; - yield 'interface' => [ClassLikeType::TYPE_INTERFACE, true]; - yield 'trait' => [ClassLikeType::TYPE_TRAIT, true]; - } - - /** - * @dataProvider provideTypes - */ - public function testSatisfyForTypes(ClassLikeType $classLikeType, bool $matches): void - { - $stat = $this->sut->satisfy( - ['value' => '^Foo\\\\Bar$'], - new ClassLikeReference(ClassLikeToken::fromFQCN('Foo\\Bar'), $classLikeType), - ); - - self::assertSame($matches, $stat); - } - - public function testWrongRegexParam(): void - { - $this->expectException(InvalidCollectorDefinitionException::class); - - $this->sut->satisfy( - ['Foo' => 'a'], - new ClassLikeReference(ClassLikeToken::fromFQCN('Foo'), ClassLikeType::TYPE_CLASS), - ); - } -} diff --git a/tests/Core/Layer/Collector/ClassNameRegexCollectorTest.php b/tests/Core/Layer/Collector/ClassNameRegexCollectorTest.php deleted file mode 100644 index 04f9d4288..000000000 --- a/tests/Core/Layer/Collector/ClassNameRegexCollectorTest.php +++ /dev/null @@ -1,62 +0,0 @@ -collector = new ClassNameRegexCollector(); - } - - public static function dataProviderSatisfy(): iterable - { - yield [['value' => '/^Foo\\\\Bar$/i'], 'Foo\\Bar', true]; - yield [['value' => '/^Foo\\\\Bar$/i'], 'Foo\\Baz', false]; - } - - /** - * @dataProvider dataProviderSatisfy - */ - public function testSatisfy(array $configuration, string $className, bool $expected): void - { - $actual = $this->collector->satisfy( - $configuration, - new ClassLikeReference(ClassLikeToken::fromFQCN($className)) - ); - - self::assertSame($expected, $actual); - } - - public function testWrongRegexParam(): void - { - $this->expectException(InvalidCollectorDefinitionException::class); - - $this->collector->satisfy( - ['Foo' => 'a'], - new ClassLikeReference(ClassLikeToken::fromFQCN('Foo')) - ); - } - - public function testInvalidRegexParam(): void - { - $this->expectException(InvalidCollectorDefinitionException::class); - - $this->collector->satisfy( - ['regex' => '/'], - new ClassLikeReference(ClassLikeToken::fromFQCN('Foo')), - ); - } -} diff --git a/tests/Core/Layer/Collector/ComposerCollectorTest.php b/tests/Core/Layer/Collector/ComposerCollectorTest.php deleted file mode 100644 index f343be441..000000000 --- a/tests/Core/Layer/Collector/ComposerCollectorTest.php +++ /dev/null @@ -1,71 +0,0 @@ -sut = new ComposerCollector(); - } - - public static function dataProviderSatisfy(): iterable - { - yield [ - [ - 'composerPath' => __DIR__.DIRECTORY_SEPARATOR.'data/composer.json', - 'composerLockPath' => __DIR__.DIRECTORY_SEPARATOR.'data/composer.lock', - 'packages' => ['phpstan/phpdoc-parser'], - ], - 'PHPStan\\PhpDocParser\\Ast\\Attribute', - true, - ]; - yield [ - [ - 'composerPath' => __DIR__.DIRECTORY_SEPARATOR.'data/composer.json', - 'composerLockPath' => __DIR__.DIRECTORY_SEPARATOR.'data/composer.lock', - 'packages' => ['phpstan/phpdoc-parser'], - ], - 'Completely\\Wrong\\Namespace\\Attribute', - false, - ]; - } - - /** - * @dataProvider dataProviderSatisfy - */ - public function testSatisfy(array $configuration, string $className, bool $expected): void - { - $stat = $this->sut->satisfy( - $configuration, - new ClassLikeReference(ClassLikeToken::fromFQCN($className), ClassLikeType::TYPE_CLASS), - ); - - self::assertSame($expected, $stat); - } - - public function testComposerPackageDoesNotExist(): void - { - $this->expectException(InvalidCollectorDefinitionException::class); - - $this->sut->satisfy( - [ - 'composerPath' => __DIR__.DIRECTORY_SEPARATOR.'data/composer.json', - 'composerLockPath' => __DIR__.DIRECTORY_SEPARATOR.'data/composer.lock', - 'packages' => ['fake_package'], - ], - new ClassLikeReference(ClassLikeToken::fromFQCN(''), ClassLikeType::TYPE_CLASS), - ); - } -} diff --git a/tests/Core/Layer/Collector/DirectoryCollectorTest.php b/tests/Core/Layer/Collector/DirectoryCollectorTest.php deleted file mode 100644 index 9b88db3f9..000000000 --- a/tests/Core/Layer/Collector/DirectoryCollectorTest.php +++ /dev/null @@ -1,76 +0,0 @@ -collector = new DirectoryCollector(); - } - - public static function dataProviderSatisfy(): iterable - { - yield [['value' => 'foo/layer1/.*'], 'foo/layer1/bar.php', true]; - yield [['value' => 'foo/layer1/.*'], 'foo/layer1/dir/bar.php', true]; - yield [['value' => 'foo/layer1/.*'], 'foo/layer2/bar.php', false]; - yield [['value' => 'foo/layer2/.*'], 'foo\\layer2\\bar.php', true]; - } - - /** - * @dataProvider dataProviderSatisfy - */ - public function testSatisfy(array $configuration, string $filePath, bool $expected): void - { - $fileReferenceBuilder = FileReferenceBuilder::create($filePath); - $fileReferenceBuilder->newClassLike('Test', [], false); - $fileReference = $fileReferenceBuilder->build(); - - $actual = $this->collector->satisfy( - $configuration, - $fileReference->classLikeReferences[0], - ); - - self::assertSame($expected, $actual); - } - - public function testMissingRegexThrowsException(): void - { - $fileReferenceBuilder = FileReferenceBuilder::create('/some/path/to/file.php'); - $fileReferenceBuilder->newClassLike('Test', [], false); - $fileReference = $fileReferenceBuilder->build(); - - $this->expectException(InvalidCollectorDefinitionException::class); - $this->expectExceptionMessage('DirectoryCollector needs the regex configuration.'); - - $this->collector->satisfy( - [], - $fileReference->classLikeReferences[0], - ); - } - - public function testInvalidRegexParam(): void - { - $fileReferenceBuilder = FileReferenceBuilder::create('/some/path/to/file.php'); - $fileReferenceBuilder->newClassLike('Test', [], false); - $fileReference = $fileReferenceBuilder->build(); - - $this->expectException(InvalidCollectorDefinitionException::class); - - $this->collector->satisfy( - ['value' => '\\'], - $fileReference->classLikeReferences[0], - ); - } -} diff --git a/tests/Core/Layer/Collector/ExtendsCollectorTest.php b/tests/Core/Layer/Collector/ExtendsCollectorTest.php deleted file mode 100644 index 5190175db..000000000 --- a/tests/Core/Layer/Collector/ExtendsCollectorTest.php +++ /dev/null @@ -1,70 +0,0 @@ - 'App\FizTrait'], false]; - yield [['value' => 'App\Bar'], false]; - yield [['value' => 'App\Baz'], false]; - yield [['value' => 'App\Foo'], true]; - yield [['value' => 'App\None'], false]; - } - - /** - * @dataProvider dataProviderSatisfy - */ - public function testSatisfy(array $configuration, bool $expected): void - { - $fooFileReferenceBuilder = FileReferenceBuilder::create('foo.php'); - $fooFileReferenceBuilder - ->newClassLike('App\Foo', [], false) - ->implements('App\Bar', 2); - $fooFileReference = $fooFileReferenceBuilder->build(); - - $barFileReferenceBuilder = FileReferenceBuilder::create('bar.php'); - $barFileReferenceBuilder - ->newClassLike('App\Bar', [], false) - ->implements('App\Baz', 2); - $barFileReference = $barFileReferenceBuilder->build(); - - $bazFileReferenceBuilder = FileReferenceBuilder::create('baz.php'); - $bazFileReferenceBuilder->newClassLike('App\Baz', [], false); - $bazFileReference = $bazFileReferenceBuilder->build(); - - $fizTraitFileReferenceBuilder = FileReferenceBuilder::create('fiztrait.php'); - $fizTraitFileReferenceBuilder - ->newClassLike('App\FizTrait', [], false); - $fizTraitFileReference = $fizTraitFileReferenceBuilder->build(); - - $fooBarFileReferenceBuilder = FileReferenceBuilder::create('foobar.php'); - $fooBarFileReferenceBuilder - ->newClassLike('App\FooBar', [], false) - ->extends('App\Foo', 2) - ->trait('App\FizTrait', 4); - $fooBarFileReference = $fooBarFileReferenceBuilder->build(); - - $astMap = new AstMap([$fooFileReference, $barFileReference, $bazFileReference, $fooBarFileReference, $fizTraitFileReference]); - $astMapExtractor = $this->createMock(AstMapExtractor::class); - $astMapExtractor->method('extract') - ->willReturn($astMap); - - $collector = new ExtendsCollector($astMapExtractor); - $actual = $collector->satisfy( - $configuration, - $fooBarFileReference->classLikeReferences[0] - ); - - self::assertSame($expected, $actual); - } -} diff --git a/tests/Core/Layer/Collector/FunctionNameCollectorTest.php b/tests/Core/Layer/Collector/FunctionNameCollectorTest.php deleted file mode 100644 index 96ce2fc39..000000000 --- a/tests/Core/Layer/Collector/FunctionNameCollectorTest.php +++ /dev/null @@ -1,52 +0,0 @@ -collector = new FunctionNameCollector(); - } - - public static function dataProviderSatisfy(): iterable - { - yield [['value' => 'a'], 'foo\bar', true]; - yield [['value' => 'a'], 'foo\bbr', false]; - } - - /** - * @dataProvider dataProviderSatisfy - */ - public function testSatisfy(array $configuration, string $functionName, bool $expected): void - { - $actual = $this->collector->satisfy( - $configuration, - new FunctionReference(FunctionToken::fromFQCN($functionName)), - ); - - self::assertSame($expected, $actual); - } - - public function testWrongRegexParam(): void - { - $this->expectException(InvalidCollectorDefinitionException::class); - - $this->collector->satisfy( - ['Foo' => 'a'], - new FunctionReference(FunctionToken::fromFQCN('Foo')), - ); - } -} diff --git a/tests/Core/Layer/Collector/GlobCollectorTest.php b/tests/Core/Layer/Collector/GlobCollectorTest.php deleted file mode 100644 index 710550369..000000000 --- a/tests/Core/Layer/Collector/GlobCollectorTest.php +++ /dev/null @@ -1,47 +0,0 @@ -collector = new GlobCollector(__DIR__); - } - - public static function dataProviderSatisfy(): iterable - { - yield [['value' => 'foo/layer1/*'], 'foo/layer1/bar.php', true]; - yield [['value' => 'foo/*/*.php'], 'foo/layer1/bar.php', true]; - yield [['value' => 'foo/**/*'], 'foo/layer1/dir/bar.php', true]; - yield [['value' => 'foo/layer1/*'], 'foo/layer2/bar.php', false]; - yield [['value' => 'foo/layer2/*'], 'foo\\layer2\\bar.php', true]; - } - - /** - * @dataProvider dataProviderSatisfy - */ - public function testSatisfy(array $configuration, string $filePath, bool $expected): void - { - $fileReferenceBuilder = FileReferenceBuilder::create($filePath); - $fileReferenceBuilder->newClassLike('Test', [], false); - $fileReference = $fileReferenceBuilder->build(); - - $actual = $this->collector->satisfy( - $configuration, - $fileReference->classLikeReferences[0], - ); - - self::assertSame($expected, $actual); - } -} diff --git a/tests/Core/Layer/Collector/ImplementsCollectorTest.php b/tests/Core/Layer/Collector/ImplementsCollectorTest.php deleted file mode 100644 index be63dcf21..000000000 --- a/tests/Core/Layer/Collector/ImplementsCollectorTest.php +++ /dev/null @@ -1,72 +0,0 @@ - 'App\FizTrait'], false]; - yield [['value' => 'App\Bar'], true]; - yield [['value' => 'App\Baz'], true]; - yield [['value' => 'App\Foo'], false]; - yield [['value' => 'App\None'], false]; - } - - /** - * @dataProvider dataProviderSatisfy - */ - public function testSatisfy(array $configuration, bool $expected): void - { - $fooFileReferenceBuilder = FileReferenceBuilder::create('foo.php'); - $fooFileReferenceBuilder - ->newClassLike('App\Foo', [], false) - ->implements('App\Bar', 2); - $fooFileReference = $fooFileReferenceBuilder->build(); - - $barFileReferenceBuilder = FileReferenceBuilder::create('bar.php'); - $barFileReferenceBuilder - ->newClassLike('App\Bar', [], false) - ->implements('App\Baz', 2); - $barFileReference = $barFileReferenceBuilder->build(); - - $bazFileReferenceBuilder = FileReferenceBuilder::create('baz.php'); - $bazFileReferenceBuilder->newClassLike('App\Baz', [], false); - $bazFileReference = $bazFileReferenceBuilder->build(); - - $fizTraitFileReferenceBuilder = FileReferenceBuilder::create('fiztrait.php'); - $fizTraitFileReferenceBuilder - ->newClassLike('App\FizTrait', [], false); - $fizTraitFileReference = $fizTraitFileReferenceBuilder->build(); - - $fooBarFileReferenceBuilder = FileReferenceBuilder::create('foobar.php'); - $fooBarFileReferenceBuilder - ->newClassLike('App\FooBar', [], false) - ->extends('App\Foo', 2) - ->trait('App\FizTrait', 4); - $fooBarFileReference = $fooBarFileReferenceBuilder->build(); - - $astMap = new AstMap( - [$fooFileReference, $barFileReference, $bazFileReference, $fooBarFileReference, $fizTraitFileReference] - ); - $astMapExtractor = $this->createMock(AstMapExtractor::class); - $astMapExtractor->method('extract') - ->willReturn($astMap); - - $collector = new ImplementsCollector($astMapExtractor); - $actual = $collector->satisfy( - $configuration, - $fooBarFileReference->classLikeReferences[0] - ); - - self::assertSame($expected, $actual); - } -} diff --git a/tests/Core/Layer/Collector/InheritanceLevelCollectorTest.php b/tests/Core/Layer/Collector/InheritanceLevelCollectorTest.php deleted file mode 100644 index 3b1f415d0..000000000 --- a/tests/Core/Layer/Collector/InheritanceLevelCollectorTest.php +++ /dev/null @@ -1,55 +0,0 @@ -createMock(AstInherit::class); - $classInherit->method('getPath') - ->willReturn(array_fill(0, $pathLevel, 1)); - - $astMap = $this->createMock(AstMap::class); - $astMap->method('getClassInherits') - ->with(ClassLikeToken::fromFQCN(AstInherit::class)) - ->willReturn([$classInherit]); - - $astMapExtractor = $this->createMock(AstMapExtractor::class); - $astMapExtractor->method('extract') - ->willReturn($astMap); - - $collector = new InheritanceLevelCollector($astMapExtractor); - $actual = $collector->satisfy( - ['value' => $levelConfig], - new ClassLikeReference(ClassLikeToken::fromFQCN(AstInherit::class)), - ); - - self::assertSame($expected, $actual); - } -} diff --git a/tests/Core/Layer/Collector/InheritsCollectorTest.php b/tests/Core/Layer/Collector/InheritsCollectorTest.php deleted file mode 100644 index e83cf3c1a..000000000 --- a/tests/Core/Layer/Collector/InheritsCollectorTest.php +++ /dev/null @@ -1,72 +0,0 @@ - 'App\FizTrait'], true]; - yield [['value' => 'App\Bar'], true]; - yield [['value' => 'App\Baz'], true]; - yield [['value' => 'App\Foo'], true]; - yield [['value' => 'App\None'], false]; - } - - /** - * @dataProvider dataProviderSatisfy - */ - public function testSatisfy(array $configuration, bool $expected): void - { - $fooFileReferenceBuilder = FileReferenceBuilder::create('foo.php'); - $fooFileReferenceBuilder - ->newClassLike('App\Foo', [], false) - ->implements('App\Bar', 2); - $fooFileReference = $fooFileReferenceBuilder->build(); - - $barFileReferenceBuilder = FileReferenceBuilder::create('bar.php'); - $barFileReferenceBuilder - ->newClassLike('App\Bar', [], false) - ->implements('App\Baz', 2); - $barFileReference = $barFileReferenceBuilder->build(); - - $bazFileReferenceBuilder = FileReferenceBuilder::create('baz.php'); - $bazFileReferenceBuilder->newClassLike('App\Baz', [], false); - $bazFileReference = $bazFileReferenceBuilder->build(); - - $fizTraitFileReferenceBuilder = FileReferenceBuilder::create('fiztrait.php'); - $fizTraitFileReferenceBuilder - ->newClassLike('App\FizTrait', [], false); - $fizTraitFileReference = $fizTraitFileReferenceBuilder->build(); - - $fooBarFileReferenceBuilder = FileReferenceBuilder::create('foobar.php'); - $fooBarFileReferenceBuilder - ->newClassLike('App\FooBar', [], false) - ->extends('App\Foo', 2) - ->trait('App\FizTrait', 4); - $fooBarFileReference = $fooBarFileReferenceBuilder->build(); - - $astMap = new AstMap( - [$fooFileReference, $barFileReference, $bazFileReference, $fooBarFileReference, $fizTraitFileReference] - ); - $astMapExtractor = $this->createMock(AstMapExtractor::class); - $astMapExtractor->method('extract') - ->willReturn($astMap); - - $collector = new InheritsCollector($astMapExtractor); - $actual = $collector->satisfy( - $configuration, - $fooBarFileReference->classLikeReferences[0] - ); - - self::assertSame($expected, $actual); - } -} diff --git a/tests/Core/Layer/Collector/InterfaceCollectorTest.php b/tests/Core/Layer/Collector/InterfaceCollectorTest.php deleted file mode 100644 index f61337e89..000000000 --- a/tests/Core/Layer/Collector/InterfaceCollectorTest.php +++ /dev/null @@ -1,72 +0,0 @@ -sut = new InterfaceCollector(); - } - - public static function dataProviderSatisfy(): iterable - { - yield [['value' => '^Foo\\\\Bar$'], 'Foo\\Bar', true]; - yield [['value' => '^Foo\\\\Bar$'], 'Foo\\Baz', false]; - } - - /** - * @dataProvider dataProviderSatisfy - */ - public function testSatisfy(array $configuration, string $className, bool $expected): void - { - $stat = $this->sut->satisfy( - $configuration, - new ClassLikeReference(ClassLikeToken::fromFQCN($className), ClassLikeType::TYPE_INTERFACE), - ); - - self::assertEquals($expected, $stat); - } - - public static function provideTypes(): iterable - { - yield 'classLike' => [ClassLikeType::TYPE_CLASSLIKE, false]; - yield 'class' => [ClassLikeType::TYPE_CLASS, false]; - yield 'interface' => [ClassLikeType::TYPE_INTERFACE, true]; - yield 'trait' => [ClassLikeType::TYPE_TRAIT, false]; - } - - /** - * @dataProvider provideTypes - */ - public function testSatisfyTypes(ClassLikeType $classLikeType, bool $matches): void - { - $stat = $this->sut->satisfy( - ['value' => '^Foo\\\\Bar$'], - new ClassLikeReference(ClassLikeToken::fromFQCN('Foo\\Bar'), $classLikeType), - ); - - self::assertSame($matches, $stat); - } - - public function testWrongRegexParam(): void - { - $this->expectException(InvalidCollectorDefinitionException::class); - - $this->sut->satisfy( - ['Foo' => 'a'], - new ClassLikeReference(ClassLikeToken::fromFQCN('Foo'), ClassLikeType::TYPE_INTERFACE), - ); - } -} diff --git a/tests/Core/Layer/Collector/LayerCollectorTest.php b/tests/Core/Layer/Collector/LayerCollectorTest.php deleted file mode 100644 index 78ea0db13..000000000 --- a/tests/Core/Layer/Collector/LayerCollectorTest.php +++ /dev/null @@ -1,145 +0,0 @@ -resolver = $this->createMock(LayerResolverInterface::class); - - $this->collector = new LayerCollector($this->resolver); - } - - public function testConfig(): void - { - $this->expectException(InvalidCollectorDefinitionException::class); - $this->expectExceptionMessage('LayerCollector needs the layer configuration'); - - $this->collector->satisfy( - [], - new ClassLikeReference(ClassLikeToken::fromFQCN('App\\Foo')), - ); - } - - public function testResolvable(): void - { - $this->resolver - ->expects($this->once()) - ->method('has') - ->with('test') - ->willReturn(true); - - $actual = $this->collector->resolvable(['value' => 'test']); - - self::assertSame(true, $actual); - } - - public function testUnrsolvable(): void - { - $this->resolver - ->expects($this->once()) - ->method('has') - ->with('test') - ->willReturn(false); - - $actual = $this->collector->resolvable(['value' => 'test']); - - self::assertSame(false, $actual); - } - - public function testSatisfyWithUnknownLayer(): void - { - $this->resolver - ->expects($this->once()) - ->method('has') - ->with('test') - ->willReturn(false); - - $this->expectException(InvalidCollectorDefinitionException::class); - $this->expectExceptionMessage('Unknown layer "test" specified in collector.'); - - $this->collector->satisfy( - ['value' => 'test'], - new ClassLikeReference(ClassLikeToken::fromFQCN('App\\Foo')), - ); - } - - public function testCircularReference(): void - { - $reference = new ClassLikeReference(ClassLikeToken::fromFQCN('App\\Foo')); - $this->resolver - ->method('has') - ->with('FooLayer') - ->willReturn(true); - $this->resolver - ->method('isReferenceInLayer') - ->with('FooLayer', $reference) - ->willReturnCallback(function (string $layerName, ClassLikeReference $reference) { - return $this->collector->satisfy(['value' => 'FooLayer'], $reference); - }); - - $this->expectException(InvalidLayerDefinitionException::class); - $this->expectExceptionMessage('Circular dependency between layers detected. Token "App\Foo" could not be resolved.'); - - $this->collector->satisfy( - ['value' => 'FooLayer'], - $reference, - ); - } - - public function testSatisfyWhenReferenceIsInLayer(): void - { - $reference = new ClassLikeReference(ClassLikeToken::fromFQCN('App\\Foo')); - $this->resolver - ->method('has') - ->with('AppLayer') - ->willReturn(true); - $this->resolver - ->method('isReferenceInLayer') - ->with('AppLayer', $reference) - ->willReturn(true); - - $actual = $this->collector->satisfy( - ['value' => 'AppLayer'], - $reference, - ); - - self::assertTrue($actual); - } - - public function testSatisfyWhenReferenceIsNotInLayer(): void - { - $reference = new ClassLikeReference(ClassLikeToken::fromFQCN('App\\Foo')); - $this->resolver - ->method('has') - ->with('AppLayer') - ->willReturn(true); - $this->resolver - ->method('isReferenceInLayer') - ->with('AppLayer', $reference) - ->willReturn(false); - - $actual = $this->collector->satisfy( - ['value' => 'AppLayer'], - $reference, - ); - - self::assertFalse($actual); - } -} diff --git a/tests/Core/Layer/Collector/MethodCollectorTest.php b/tests/Core/Layer/Collector/MethodCollectorTest.php deleted file mode 100644 index 5ae05c23f..000000000 --- a/tests/Core/Layer/Collector/MethodCollectorTest.php +++ /dev/null @@ -1,131 +0,0 @@ -astParser = $this->createMock(NikicPhpParser::class); - - $this->collector = new MethodCollector($this->astParser); - } - - public static function provideSatisfy(): iterable - { - yield [ - ['value' => 'abc'], - [ - self::getClassMethod('abc'), - self::getClassMethod('abcdef'), - self::getClassMethod('xyz'), - ], - true, - ]; - - yield [ - ['value' => 'abc'], - [ - self::getClassMethod('abc'), - self::getClassMethod('xyz'), - ], - true, - ]; - - yield [ - ['value' => 'abc'], - [ - self::getClassMethod('xyz'), - ], - false, - ]; - } - - /** - * @dataProvider provideSatisfy - */ - public function testSatisfy(array $configuration, array $methods, bool $expected): void - { - $astClassReference = new ClassLikeReference(ClassLikeToken::fromFQCN('foo')); - - $classLike = $this->createMock(Node\Stmt\ClassLike::class); - $classLike->method('getMethods')->willReturn($methods); - - $this->astParser - ->method('getNodeForClassLikeReference') - ->with($astClassReference) - ->willReturn($classLike); - - $actual = $this->collector->satisfy( - $configuration, - $astClassReference, - ); - - self::assertSame($expected, $actual); - } - - public function testClassLikeAstNotFoundDoesNotSatisfy(): void - { - $astClassReference = new ClassLikeReference(ClassLikeToken::fromFQCN('foo')); - $this->astParser - ->method('getNodeForClassLikeReference') - ->with($astClassReference) - ->willReturn(null); - - $actual = $this->collector->satisfy( - ['value' => 'abc'], - $astClassReference, - ); - - self::assertFalse($actual); - } - - public function testMissingNameThrowsException(): void - { - $astClassReference = new ClassLikeReference(ClassLikeToken::fromFQCN('foo')); - - $this->expectException(InvalidCollectorDefinitionException::class); - $this->expectExceptionMessage('MethodCollector needs the name configuration.'); - - $this->collector->satisfy( - [], - $astClassReference, - ); - } - - public function testInvalidRegexParam(): void - { - $astClassReference = new ClassLikeReference(ClassLikeToken::fromFQCN('foo')); - - $this->expectException(InvalidCollectorDefinitionException::class); - - $this->collector->satisfy( - ['value' => '/'], - $astClassReference, - ); - } - - private static function getClassMethod(string $name): stdClass - { - $classMethod = new stdClass(); - $classMethod->name = $name; - - return $classMethod; - } -} diff --git a/tests/Core/Layer/Collector/PHPInternalCollectorTest.php b/tests/Core/Layer/Collector/PHPInternalCollectorTest.php deleted file mode 100644 index 44dd42546..000000000 --- a/tests/Core/Layer/Collector/PHPInternalCollectorTest.php +++ /dev/null @@ -1,43 +0,0 @@ - - */ - public static function provideSatisfy(): iterable - { - yield [['value' => '^PDO'], new ClassLikeReference(ClassLikeToken::fromFQCN('PDOException')), true]; - yield [['value' => '^PFO'], new ClassLikeReference(ClassLikeToken::fromFQCN('PDOException')), false]; - yield [['value' => '.*'], new ClassLikeReference(ClassLikeToken::fromFQCN('PDOExceptionNonExistent')), false]; - yield [['value' => '^pdo'], new FunctionReference(FunctionToken::fromFQCN('pdo_drivers')), true]; - yield [['value' => '^pfo'], new FunctionReference(FunctionToken::fromFQCN('pdo_drivers')), false]; - yield [['value' => '.*'], new FunctionReference(FunctionToken::fromFQCN('pdo_drivers_non_existent')), false]; - } - - /** - * @dataProvider provideSatisfy - */ - public function testSatisfy(array $config, TokenReferenceInterface $reference, bool $expected): void - { - $collector = new PhpInternalCollector(); - $actual = $collector->satisfy( - $config, - $reference, - ); - - self::assertSame($expected, $actual); - } -} diff --git a/tests/Core/Layer/Collector/SuperglobalCollectorTest.php b/tests/Core/Layer/Collector/SuperglobalCollectorTest.php deleted file mode 100644 index 8631514e8..000000000 --- a/tests/Core/Layer/Collector/SuperglobalCollectorTest.php +++ /dev/null @@ -1,52 +0,0 @@ -collector = new SuperglobalCollector(); - } - - public static function provideSatisfy(): iterable - { - yield [['value' => ['_GET', '_SESSION']], '_GET', true]; - yield [['value' => ['_COOKIE']], '_POST', false]; - } - - /** - * @dataProvider provideSatisfy - */ - public function testSatisfy(array $configuration, string $name, bool $expected): void - { - $actual = $this->collector->satisfy( - $configuration, - new VariableReference(SuperGlobalToken::from($name)) - ); - - self::assertSame($expected, $actual); - } - - public function testWrongRegexParam(): void - { - $this->expectException(InvalidCollectorDefinitionException::class); - - $this->collector->satisfy( - ['Foo' => 'a'], - new VariableReference(SuperGlobalToken::from('_POST')) - ); - } -} diff --git a/tests/Core/Layer/Collector/TraitCollectorTest.php b/tests/Core/Layer/Collector/TraitCollectorTest.php deleted file mode 100644 index fee879818..000000000 --- a/tests/Core/Layer/Collector/TraitCollectorTest.php +++ /dev/null @@ -1,72 +0,0 @@ -sut = new TraitCollector(); - } - - public static function dataProviderSatisfy(): iterable - { - yield [['value' => '^Foo\\\\Bar$'], 'Foo\\Bar', true]; - yield [['value' => '^Foo\\\\Bar$'], 'Foo\\Baz', false]; - } - - /** - * @dataProvider dataProviderSatisfy - */ - public function testSatisfy(array $configuration, string $className, bool $expected): void - { - $stat = $this->sut->satisfy( - $configuration, - new ClassLikeReference(ClassLikeToken::fromFQCN($className), ClassLikeType::TYPE_TRAIT), - ); - - self::assertEquals($expected, $stat); - } - - public static function provideTypes(): iterable - { - yield 'classLike' => [ClassLikeType::TYPE_CLASSLIKE, false]; - yield 'class' => [ClassLikeType::TYPE_CLASS, false]; - yield 'interface' => [ClassLikeType::TYPE_INTERFACE, false]; - yield 'trait' => [ClassLikeType::TYPE_TRAIT, true]; - } - - /** - * @dataProvider provideTypes - */ - public function testSatisfyTypes(ClassLikeType $classLikeType, bool $matches): void - { - $stat = $this->sut->satisfy( - ['value' => '^Foo\\\\Bar$'], - new ClassLikeReference(ClassLikeToken::fromFQCN('Foo\\Bar'), $classLikeType), - ); - - self::assertSame($matches, $stat); - } - - public function testWrongRegexParam(): void - { - $this->expectException(InvalidCollectorDefinitionException::class); - - $this->sut->satisfy( - ['Foo' => 'a'], - new ClassLikeReference(ClassLikeToken::fromFQCN('Foo'), ClassLikeType::TYPE_TRAIT), - ); - } -} diff --git a/tests/Core/Layer/Collector/UsesCollectorTest.php b/tests/Core/Layer/Collector/UsesCollectorTest.php deleted file mode 100644 index f2374dcf0..000000000 --- a/tests/Core/Layer/Collector/UsesCollectorTest.php +++ /dev/null @@ -1,73 +0,0 @@ - 'App\FizTrait'], true]; - yield [['value' => 'App\Bar'], false]; - yield [['value' => 'App\Baz'], false]; - yield [['value' => 'App\Foo'], false]; - yield [['value' => 'App\None'], false]; - } - - /** - * @dataProvider dataProviderSatisfy - */ - public function testSatisfy(array $configuration, bool $expected): void - { - $fooFileReferenceBuilder = FileReferenceBuilder::create('foo.php'); - $fooFileReferenceBuilder - ->newClassLike('App\Foo', [], false) - ->implements('App\Bar', 2); - $fooFileReference = $fooFileReferenceBuilder->build(); - - $barFileReferenceBuilder = FileReferenceBuilder::create('bar.php'); - $barFileReferenceBuilder - ->newClassLike('App\Bar', [], false) - ->implements('App\Baz', 2); - $barFileReference = $barFileReferenceBuilder->build(); - - $bazFileReferenceBuilder = FileReferenceBuilder::create('baz.php'); - $bazFileReferenceBuilder->newClassLike('App\Baz', [], false); - $bazFileReference = $bazFileReferenceBuilder->build(); - - $fizTraitFileReferenceBuilder = FileReferenceBuilder::create('fiztrait.php'); - $fizTraitFileReferenceBuilder - ->newClassLike('App\FizTrait', [], false); - $fizTraitFileReference = $fizTraitFileReferenceBuilder->build(); - - $fooBarFileReferenceBuilder = FileReferenceBuilder::create('foobar.php'); - $fooBarFileReferenceBuilder - ->newClassLike('App\FooBar', [], false) - ->extends('App\Foo', 2) - ->trait('App\FizTrait', 4); - $fooBarFileReference = $fooBarFileReferenceBuilder->build(); - - $astMap = new AstMap( - [$fooFileReference, $barFileReference, $bazFileReference, $fooBarFileReference, $fizTraitFileReference] - ); - $astMapExtractor = $this->createMock(AstMapExtractor::class); - $astMapExtractor->method('extract') - ->willReturn($astMap); - - $collector = new UsesCollector($astMapExtractor); - - $stat = $collector->satisfy( - $configuration, - $fooBarFileReference->classLikeReferences[0] - ); - - self::assertSame($expected, $stat); - } -} diff --git a/tests/Core/Layer/Collector/data/composer.json b/tests/Core/Layer/Collector/data/composer.json deleted file mode 100644 index 2ab695940..000000000 --- a/tests/Core/Layer/Collector/data/composer.json +++ /dev/null @@ -1,70 +0,0 @@ -{ - "name": "qossmic/deptrac", - "description": "Deptrac is a static code analysis tool that helps to enforce rules for dependencies between software layers.", - "license": "MIT", - "authors": [ - { - "name": "Tim Glabisch" - }, - { - "name": "Simon Mönch", - "email": "simon.moench@qossmic.com" - }, - { - "name": "Denis Brumann", - "email": "denis.brumann@qossmic.com", - "role": "maintainer" - } - ], - "require": { - "php": "^8.1", - "ext-json": "*", - "composer/xdebug-handler": "^3.0", - "jetbrains/phpstorm-stubs": "^2022.2", - "nikic/php-parser": "^4.13", - "phpdocumentor/graphviz": "^2.1", - "phpdocumentor/type-resolver": "^1.6", - "phpstan/phpdoc-parser": "^1.5", - "symfony/config": "^6.0", - "symfony/console": "^6.0", - "symfony/dependency-injection": "^6.0", - "symfony/event-dispatcher": "^6.0", - "symfony/filesystem": "^6.0", - "symfony/finder": "^6.0", - "symfony/yaml": "^6.0" - }, - "suggest": { - "ext-dom": "For using the JUnit output formatter" - }, - "autoload": { - "psr-4": { - "Qossmic\\Deptrac\\": "src/" - } - }, - "autoload-dev": { - "psr-4": { - "Tests\\Qossmic\\Deptrac\\": "tests/", - "Internal\\Qossmic\\Deptrac\\": "internal/deptrac/" - } - }, - "config": { - "platform": { - "php": "8.1" - }, - "sort-packages": true, - "allow-plugins": { - "infection/extension-installer": true - } - }, - "require-dev": { - "friendsofphp/php-cs-fixer": "^3.4", - "humbug/box": "^4.1.0", - "infection/infection": "^0.26.16", - "phpstan/phpstan": "^1.6.8", - "phpstan/phpstan-symfony": "^1.1", - "phpunit/phpunit": "^9.5", - "rector/rector": "^0.15.17", - "roave/infection-static-analysis-plugin": "^1.28", - "vimeo/psalm": "^4.22" - } -} diff --git a/tests/Core/Layer/Collector/data/composer.lock b/tests/Core/Layer/Collector/data/composer.lock deleted file mode 100644 index f031f4af5..000000000 --- a/tests/Core/Layer/Collector/data/composer.lock +++ /dev/null @@ -1,7029 +0,0 @@ -{ - "_readme": [ - "This file locks the dependencies of your project to a known state", - "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", - "This file is @generated automatically" - ], - "content-hash": "633377a4738dbf6e033b8a046d595ecb", - "packages": [ - { - "name": "composer/pcre", - "version": "3.1.0", - "source": { - "type": "git", - "url": "https://github.com/composer/pcre.git", - "reference": "4bff79ddd77851fe3cdd11616ed3f92841ba5bd2" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/composer/pcre/zipball/4bff79ddd77851fe3cdd11616ed3f92841ba5bd2", - "reference": "4bff79ddd77851fe3cdd11616ed3f92841ba5bd2", - "shasum": "" - }, - "require": { - "php": "^7.4 || ^8.0" - }, - "require-dev": { - "phpstan/phpstan": "^1.3", - "phpstan/phpstan-strict-rules": "^1.1", - "symfony/phpunit-bridge": "^5" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "3.x-dev" - } - }, - "autoload": { - "psr-4": { - "Composer\\Pcre\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Jordi Boggiano", - "email": "j.boggiano@seld.be", - "homepage": "http://seld.be" - } - ], - "description": "PCRE wrapping library that offers type-safe preg_* replacements.", - "keywords": [ - "PCRE", - "preg", - "regex", - "regular expression" - ], - "support": { - "issues": "https://github.com/composer/pcre/issues", - "source": "https://github.com/composer/pcre/tree/3.1.0" - }, - "funding": [ - { - "url": "https://packagist.com", - "type": "custom" - }, - { - "url": "https://github.com/composer", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/composer/composer", - "type": "tidelift" - } - ], - "time": "2022-11-17T09:50:14+00:00" - }, - { - "name": "composer/xdebug-handler", - "version": "3.0.3", - "source": { - "type": "git", - "url": "https://github.com/composer/xdebug-handler.git", - "reference": "ced299686f41dce890debac69273b47ffe98a40c" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/composer/xdebug-handler/zipball/ced299686f41dce890debac69273b47ffe98a40c", - "reference": "ced299686f41dce890debac69273b47ffe98a40c", - "shasum": "" - }, - "require": { - "composer/pcre": "^1 || ^2 || ^3", - "php": "^7.2.5 || ^8.0", - "psr/log": "^1 || ^2 || ^3" - }, - "require-dev": { - "phpstan/phpstan": "^1.0", - "phpstan/phpstan-strict-rules": "^1.1", - "symfony/phpunit-bridge": "^6.0" - }, - "type": "library", - "autoload": { - "psr-4": { - "Composer\\XdebugHandler\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "John Stevenson", - "email": "john-stevenson@blueyonder.co.uk" - } - ], - "description": "Restarts a process without Xdebug.", - "keywords": [ - "Xdebug", - "performance" - ], - "support": { - "irc": "irc://irc.freenode.org/composer", - "issues": "https://github.com/composer/xdebug-handler/issues", - "source": "https://github.com/composer/xdebug-handler/tree/3.0.3" - }, - "funding": [ - { - "url": "https://packagist.com", - "type": "custom" - }, - { - "url": "https://github.com/composer", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/composer/composer", - "type": "tidelift" - } - ], - "time": "2022-02-25T21:32:43+00:00" - }, - { - "name": "doctrine/deprecations", - "version": "v1.0.0", - "source": { - "type": "git", - "url": "https://github.com/doctrine/deprecations.git", - "reference": "0e2a4f1f8cdfc7a92ec3b01c9334898c806b30de" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/doctrine/deprecations/zipball/0e2a4f1f8cdfc7a92ec3b01c9334898c806b30de", - "reference": "0e2a4f1f8cdfc7a92ec3b01c9334898c806b30de", - "shasum": "" - }, - "require": { - "php": "^7.1|^8.0" - }, - "require-dev": { - "doctrine/coding-standard": "^9", - "phpunit/phpunit": "^7.5|^8.5|^9.5", - "psr/log": "^1|^2|^3" - }, - "suggest": { - "psr/log": "Allows logging deprecations via PSR-3 logger implementation" - }, - "type": "library", - "autoload": { - "psr-4": { - "Doctrine\\Deprecations\\": "lib/Doctrine/Deprecations" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "description": "A small layer on top of trigger_error(E_USER_DEPRECATED) or PSR-3 logging with options to disable all deprecations or selectively for packages.", - "homepage": "https://www.doctrine-project.org/", - "support": { - "issues": "https://github.com/doctrine/deprecations/issues", - "source": "https://github.com/doctrine/deprecations/tree/v1.0.0" - }, - "time": "2022-05-02T15:47:09+00:00" - }, - { - "name": "jetbrains/phpstorm-stubs", - "version": "v2022.3", - "source": { - "type": "git", - "url": "https://github.com/JetBrains/phpstorm-stubs.git", - "reference": "6b568c153cea002dc6fad96285c3063d07cab18d" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/JetBrains/phpstorm-stubs/zipball/6b568c153cea002dc6fad96285c3063d07cab18d", - "reference": "6b568c153cea002dc6fad96285c3063d07cab18d", - "shasum": "" - }, - "require-dev": { - "friendsofphp/php-cs-fixer": "@stable", - "nikic/php-parser": "@stable", - "php": "^8.0", - "phpdocumentor/reflection-docblock": "@stable", - "phpunit/phpunit": "@stable" - }, - "type": "library", - "autoload": { - "files": [ - "PhpStormStubsMap.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "Apache-2.0" - ], - "description": "PHP runtime & extensions header files for PhpStorm", - "homepage": "https://www.jetbrains.com/phpstorm", - "keywords": [ - "autocomplete", - "code", - "inference", - "inspection", - "jetbrains", - "phpstorm", - "stubs", - "type" - ], - "support": { - "source": "https://github.com/JetBrains/phpstorm-stubs/tree/v2022.3" - }, - "time": "2022-10-17T09:21:37+00:00" - }, - { - "name": "nikic/php-parser", - "version": "v4.15.4", - "source": { - "type": "git", - "url": "https://github.com/nikic/PHP-Parser.git", - "reference": "6bb5176bc4af8bcb7d926f88718db9b96a2d4290" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/6bb5176bc4af8bcb7d926f88718db9b96a2d4290", - "reference": "6bb5176bc4af8bcb7d926f88718db9b96a2d4290", - "shasum": "" - }, - "require": { - "ext-tokenizer": "*", - "php": ">=7.0" - }, - "require-dev": { - "ircmaxell/php-yacc": "^0.0.7", - "phpunit/phpunit": "^6.5 || ^7.0 || ^8.0 || ^9.0" - }, - "bin": [ - "bin/php-parse" - ], - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "4.9-dev" - } - }, - "autoload": { - "psr-4": { - "PhpParser\\": "lib/PhpParser" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Nikita Popov" - } - ], - "description": "A PHP parser written in PHP", - "keywords": [ - "parser", - "php" - ], - "support": { - "issues": "https://github.com/nikic/PHP-Parser/issues", - "source": "https://github.com/nikic/PHP-Parser/tree/v4.15.4" - }, - "time": "2023-03-05T19:49:14+00:00" - }, - { - "name": "phpdocumentor/graphviz", - "version": "2.1.0", - "source": { - "type": "git", - "url": "https://github.com/phpDocumentor/GraphViz.git", - "reference": "115999dc7f31f2392645aa825a94a6b165e1cedf" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/GraphViz/zipball/115999dc7f31f2392645aa825a94a6b165e1cedf", - "reference": "115999dc7f31f2392645aa825a94a6b165e1cedf", - "shasum": "" - }, - "require": { - "php": "^7.2 || ^8.0" - }, - "require-dev": { - "ext-simplexml": "*", - "mockery/mockery": "^1.2", - "phpstan/phpstan": "^0.12", - "phpunit/phpunit": "^8.2 || ^9.2", - "psalm/phar": "^4.15" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.x-dev" - } - }, - "autoload": { - "psr-4": { - "phpDocumentor\\GraphViz\\": "src/phpDocumentor/GraphViz", - "phpDocumentor\\GraphViz\\PHPStan\\": "./src/phpDocumentor/PHPStan" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Mike van Riel", - "email": "mike.vanriel@naenius.com" - } - ], - "description": "Wrapper for Graphviz", - "support": { - "issues": "https://github.com/phpDocumentor/GraphViz/issues", - "source": "https://github.com/phpDocumentor/GraphViz/tree/2.1.0" - }, - "time": "2021-12-13T19:03:21+00:00" - }, - { - "name": "phpdocumentor/reflection-common", - "version": "2.2.0", - "source": { - "type": "git", - "url": "https://github.com/phpDocumentor/ReflectionCommon.git", - "reference": "1d01c49d4ed62f25aa84a747ad35d5a16924662b" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/1d01c49d4ed62f25aa84a747ad35d5a16924662b", - "reference": "1d01c49d4ed62f25aa84a747ad35d5a16924662b", - "shasum": "" - }, - "require": { - "php": "^7.2 || ^8.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-2.x": "2.x-dev" - } - }, - "autoload": { - "psr-4": { - "phpDocumentor\\Reflection\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Jaap van Otterdijk", - "email": "opensource@ijaap.nl" - } - ], - "description": "Common reflection classes used by phpdocumentor to reflect the code structure", - "homepage": "http://www.phpdoc.org", - "keywords": [ - "FQSEN", - "phpDocumentor", - "phpdoc", - "reflection", - "static analysis" - ], - "support": { - "issues": "https://github.com/phpDocumentor/ReflectionCommon/issues", - "source": "https://github.com/phpDocumentor/ReflectionCommon/tree/2.x" - }, - "time": "2020-06-27T09:03:43+00:00" - }, - { - "name": "phpdocumentor/type-resolver", - "version": "1.7.1", - "source": { - "type": "git", - "url": "https://github.com/phpDocumentor/TypeResolver.git", - "reference": "dfc078e8af9c99210337325ff5aa152872c98714" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/dfc078e8af9c99210337325ff5aa152872c98714", - "reference": "dfc078e8af9c99210337325ff5aa152872c98714", - "shasum": "" - }, - "require": { - "doctrine/deprecations": "^1.0", - "php": "^7.4 || ^8.0", - "phpdocumentor/reflection-common": "^2.0", - "phpstan/phpdoc-parser": "^1.13" - }, - "require-dev": { - "ext-tokenizer": "*", - "phpbench/phpbench": "^1.2", - "phpstan/extension-installer": "^1.1", - "phpstan/phpstan": "^1.8", - "phpstan/phpstan-phpunit": "^1.1", - "phpunit/phpunit": "^9.5", - "rector/rector": "^0.13.9", - "vimeo/psalm": "^4.25" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-1.x": "1.x-dev" - } - }, - "autoload": { - "psr-4": { - "phpDocumentor\\Reflection\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Mike van Riel", - "email": "me@mikevanriel.com" - } - ], - "description": "A PSR-5 based resolver of Class names, Types and Structural Element Names", - "support": { - "issues": "https://github.com/phpDocumentor/TypeResolver/issues", - "source": "https://github.com/phpDocumentor/TypeResolver/tree/1.7.1" - }, - "time": "2023-03-27T19:02:04+00:00" - }, - { - "name": "phpstan/phpdoc-parser", - "version": "1.20.4", - "source": { - "type": "git", - "url": "https://github.com/phpstan/phpdoc-parser.git", - "reference": "7d568c87a9df9c5f7e8b5f075fc469aa8cb0a4cd" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/7d568c87a9df9c5f7e8b5f075fc469aa8cb0a4cd", - "reference": "7d568c87a9df9c5f7e8b5f075fc469aa8cb0a4cd", - "shasum": "" - }, - "require": { - "php": "^7.2 || ^8.0" - }, - "require-dev": { - "php-parallel-lint/php-parallel-lint": "^1.2", - "phpstan/extension-installer": "^1.0", - "phpstan/phpstan": "^1.5", - "phpstan/phpstan-phpunit": "^1.1", - "phpstan/phpstan-strict-rules": "^1.0", - "phpunit/phpunit": "^9.5", - "symfony/process": "^5.2" - }, - "type": "library", - "autoload": { - "psr-4": { - "PHPStan\\PhpDocParser\\": [ - "src/" - ] - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "description": "PHPDoc parser with support for nullable, intersection and generic types", - "support": { - "issues": "https://github.com/phpstan/phpdoc-parser/issues", - "source": "https://github.com/phpstan/phpdoc-parser/tree/1.20.4" - }, - "time": "2023-05-02T09:19:37+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": "symfony/config", - "version": "v6.2.7", - "source": { - "type": "git", - "url": "https://github.com/symfony/config.git", - "reference": "249271da6f545d6579e0663374f8249a80be2893" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/config/zipball/249271da6f545d6579e0663374f8249a80be2893", - "reference": "249271da6f545d6579e0663374f8249a80be2893", - "shasum": "" - }, - "require": { - "php": ">=8.1", - "symfony/deprecation-contracts": "^2.1|^3", - "symfony/filesystem": "^5.4|^6.0", - "symfony/polyfill-ctype": "~1.8" - }, - "conflict": { - "symfony/finder": "<5.4" - }, - "require-dev": { - "symfony/event-dispatcher": "^5.4|^6.0", - "symfony/finder": "^5.4|^6.0", - "symfony/messenger": "^5.4|^6.0", - "symfony/service-contracts": "^1.1|^2|^3", - "symfony/yaml": "^5.4|^6.0" - }, - "suggest": { - "symfony/yaml": "To use the yaml reference dumper" - }, - "type": "library", - "autoload": { - "psr-4": { - "Symfony\\Component\\Config\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Helps you find, load, combine, autofill and validate configuration values of any kind", - "homepage": "https://symfony.com", - "support": { - "source": "https://github.com/symfony/config/tree/v6.2.7" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2023-02-14T08:44:56+00:00" - }, - { - "name": "symfony/console", - "version": "v6.2.10", - "source": { - "type": "git", - "url": "https://github.com/symfony/console.git", - "reference": "12288d9f4500f84a4d02254d4aa968b15488476f" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/12288d9f4500f84a4d02254d4aa968b15488476f", - "reference": "12288d9f4500f84a4d02254d4aa968b15488476f", - "shasum": "" - }, - "require": { - "php": ">=8.1", - "symfony/deprecation-contracts": "^2.1|^3", - "symfony/polyfill-mbstring": "~1.0", - "symfony/service-contracts": "^1.1|^2|^3", - "symfony/string": "^5.4|^6.0" - }, - "conflict": { - "symfony/dependency-injection": "<5.4", - "symfony/dotenv": "<5.4", - "symfony/event-dispatcher": "<5.4", - "symfony/lock": "<5.4", - "symfony/process": "<5.4" - }, - "provide": { - "psr/log-implementation": "1.0|2.0|3.0" - }, - "require-dev": { - "psr/log": "^1|^2|^3", - "symfony/config": "^5.4|^6.0", - "symfony/dependency-injection": "^5.4|^6.0", - "symfony/event-dispatcher": "^5.4|^6.0", - "symfony/lock": "^5.4|^6.0", - "symfony/process": "^5.4|^6.0", - "symfony/var-dumper": "^5.4|^6.0" - }, - "suggest": { - "psr/log": "For using the console logger", - "symfony/event-dispatcher": "", - "symfony/lock": "", - "symfony/process": "" - }, - "type": "library", - "autoload": { - "psr-4": { - "Symfony\\Component\\Console\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Eases the creation of beautiful and testable command line interfaces", - "homepage": "https://symfony.com", - "keywords": [ - "cli", - "command-line", - "console", - "terminal" - ], - "support": { - "source": "https://github.com/symfony/console/tree/v6.2.10" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2023-04-28T13:37:43+00:00" - }, - { - "name": "symfony/dependency-injection", - "version": "v6.2.10", - "source": { - "type": "git", - "url": "https://github.com/symfony/dependency-injection.git", - "reference": "d732a66a2672669232c0b4536c8c96724a679780" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/d732a66a2672669232c0b4536c8c96724a679780", - "reference": "d732a66a2672669232c0b4536c8c96724a679780", - "shasum": "" - }, - "require": { - "php": ">=8.1", - "psr/container": "^1.1|^2.0", - "symfony/deprecation-contracts": "^2.1|^3", - "symfony/service-contracts": "^1.1.6|^2.0|^3.0", - "symfony/var-exporter": "^6.2.7" - }, - "conflict": { - "ext-psr": "<1.1|>=2", - "symfony/config": "<6.1", - "symfony/finder": "<5.4", - "symfony/proxy-manager-bridge": "<6.2", - "symfony/yaml": "<5.4" - }, - "provide": { - "psr/container-implementation": "1.1|2.0", - "symfony/service-implementation": "1.1|2.0|3.0" - }, - "require-dev": { - "symfony/config": "^6.1", - "symfony/expression-language": "^5.4|^6.0", - "symfony/yaml": "^5.4|^6.0" - }, - "suggest": { - "symfony/config": "", - "symfony/expression-language": "For using expressions in service container configuration", - "symfony/finder": "For using double-star glob patterns or when GLOB_BRACE portability is required", - "symfony/yaml": "" - }, - "type": "library", - "autoload": { - "psr-4": { - "Symfony\\Component\\DependencyInjection\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Allows you to standardize and centralize the way objects are constructed in your application", - "homepage": "https://symfony.com", - "support": { - "source": "https://github.com/symfony/dependency-injection/tree/v6.2.10" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2023-04-21T15:42:15+00:00" - }, - { - "name": "symfony/deprecation-contracts", - "version": "v3.2.1", - "source": { - "type": "git", - "url": "https://github.com/symfony/deprecation-contracts.git", - "reference": "e2d1534420bd723d0ef5aec58a22c5fe60ce6f5e" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/e2d1534420bd723d0ef5aec58a22c5fe60ce6f5e", - "reference": "e2d1534420bd723d0ef5aec58a22c5fe60ce6f5e", - "shasum": "" - }, - "require": { - "php": ">=8.1" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "3.3-dev" - }, - "thanks": { - "name": "symfony/contracts", - "url": "https://github.com/symfony/contracts" - } - }, - "autoload": { - "files": [ - "function.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "A generic function and convention to trigger deprecation notices", - "homepage": "https://symfony.com", - "support": { - "source": "https://github.com/symfony/deprecation-contracts/tree/v3.2.1" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2023-03-01T10:25:55+00:00" - }, - { - "name": "symfony/event-dispatcher", - "version": "v6.2.8", - "source": { - "type": "git", - "url": "https://github.com/symfony/event-dispatcher.git", - "reference": "04046f35fd7d72f9646e721fc2ecb8f9c67d3339" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/04046f35fd7d72f9646e721fc2ecb8f9c67d3339", - "reference": "04046f35fd7d72f9646e721fc2ecb8f9c67d3339", - "shasum": "" - }, - "require": { - "php": ">=8.1", - "symfony/event-dispatcher-contracts": "^2|^3" - }, - "conflict": { - "symfony/dependency-injection": "<5.4" - }, - "provide": { - "psr/event-dispatcher-implementation": "1.0", - "symfony/event-dispatcher-implementation": "2.0|3.0" - }, - "require-dev": { - "psr/log": "^1|^2|^3", - "symfony/config": "^5.4|^6.0", - "symfony/dependency-injection": "^5.4|^6.0", - "symfony/error-handler": "^5.4|^6.0", - "symfony/expression-language": "^5.4|^6.0", - "symfony/http-foundation": "^5.4|^6.0", - "symfony/service-contracts": "^1.1|^2|^3", - "symfony/stopwatch": "^5.4|^6.0" - }, - "suggest": { - "symfony/dependency-injection": "", - "symfony/http-kernel": "" - }, - "type": "library", - "autoload": { - "psr-4": { - "Symfony\\Component\\EventDispatcher\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Provides tools that allow your application components to communicate with each other by dispatching events and listening to them", - "homepage": "https://symfony.com", - "support": { - "source": "https://github.com/symfony/event-dispatcher/tree/v6.2.8" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2023-03-20T16:06:02+00:00" - }, - { - "name": "symfony/event-dispatcher-contracts", - "version": "v3.2.1", - "source": { - "type": "git", - "url": "https://github.com/symfony/event-dispatcher-contracts.git", - "reference": "0ad3b6f1e4e2da5690fefe075cd53a238646d8dd" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher-contracts/zipball/0ad3b6f1e4e2da5690fefe075cd53a238646d8dd", - "reference": "0ad3b6f1e4e2da5690fefe075cd53a238646d8dd", - "shasum": "" - }, - "require": { - "php": ">=8.1", - "psr/event-dispatcher": "^1" - }, - "suggest": { - "symfony/event-dispatcher-implementation": "" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "3.3-dev" - }, - "thanks": { - "name": "symfony/contracts", - "url": "https://github.com/symfony/contracts" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Contracts\\EventDispatcher\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Generic abstractions related to dispatching event", - "homepage": "https://symfony.com", - "keywords": [ - "abstractions", - "contracts", - "decoupling", - "interfaces", - "interoperability", - "standards" - ], - "support": { - "source": "https://github.com/symfony/event-dispatcher-contracts/tree/v3.2.1" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2023-03-01T10:32:47+00:00" - }, - { - "name": "symfony/filesystem", - "version": "v6.2.10", - "source": { - "type": "git", - "url": "https://github.com/symfony/filesystem.git", - "reference": "fd588debf7d1bc16a2c84b4b3b71145d9946b894" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/filesystem/zipball/fd588debf7d1bc16a2c84b4b3b71145d9946b894", - "reference": "fd588debf7d1bc16a2c84b4b3b71145d9946b894", - "shasum": "" - }, - "require": { - "php": ">=8.1", - "symfony/polyfill-ctype": "~1.8", - "symfony/polyfill-mbstring": "~1.8" - }, - "type": "library", - "autoload": { - "psr-4": { - "Symfony\\Component\\Filesystem\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Provides basic utilities for the filesystem", - "homepage": "https://symfony.com", - "support": { - "source": "https://github.com/symfony/filesystem/tree/v6.2.10" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2023-04-18T13:46:08+00:00" - }, - { - "name": "symfony/finder", - "version": "v6.2.7", - "source": { - "type": "git", - "url": "https://github.com/symfony/finder.git", - "reference": "20808dc6631aecafbe67c186af5dcb370be3a0eb" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/20808dc6631aecafbe67c186af5dcb370be3a0eb", - "reference": "20808dc6631aecafbe67c186af5dcb370be3a0eb", - "shasum": "" - }, - "require": { - "php": ">=8.1" - }, - "require-dev": { - "symfony/filesystem": "^6.0" - }, - "type": "library", - "autoload": { - "psr-4": { - "Symfony\\Component\\Finder\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Finds files and directories via an intuitive fluent interface", - "homepage": "https://symfony.com", - "support": { - "source": "https://github.com/symfony/finder/tree/v6.2.7" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2023-02-16T09:57:23+00:00" - }, - { - "name": "symfony/polyfill-ctype", - "version": "v1.27.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-ctype.git", - "reference": "5bbc823adecdae860bb64756d639ecfec17b050a" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/5bbc823adecdae860bb64756d639ecfec17b050a", - "reference": "5bbc823adecdae860bb64756d639ecfec17b050a", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "provide": { - "ext-ctype": "*" - }, - "suggest": { - "ext-ctype": "For best performance" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "1.27-dev" - }, - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } - }, - "autoload": { - "files": [ - "bootstrap.php" - ], - "psr-4": { - "Symfony\\Polyfill\\Ctype\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Gert de Pagter", - "email": "BackEndTea@gmail.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony polyfill for ctype functions", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "ctype", - "polyfill", - "portable" - ], - "support": { - "source": "https://github.com/symfony/polyfill-ctype/tree/v1.27.0" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2022-11-03T14:55:06+00:00" - }, - { - "name": "symfony/polyfill-intl-grapheme", - "version": "v1.27.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-intl-grapheme.git", - "reference": "511a08c03c1960e08a883f4cffcacd219b758354" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/511a08c03c1960e08a883f4cffcacd219b758354", - "reference": "511a08c03c1960e08a883f4cffcacd219b758354", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "suggest": { - "ext-intl": "For best performance" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "1.27-dev" - }, - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } - }, - "autoload": { - "files": [ - "bootstrap.php" - ], - "psr-4": { - "Symfony\\Polyfill\\Intl\\Grapheme\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony polyfill for intl's grapheme_* functions", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "grapheme", - "intl", - "polyfill", - "portable", - "shim" - ], - "support": { - "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.27.0" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2022-11-03T14:55:06+00:00" - }, - { - "name": "symfony/polyfill-intl-normalizer", - "version": "v1.27.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-intl-normalizer.git", - "reference": "19bd1e4fcd5b91116f14d8533c57831ed00571b6" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/19bd1e4fcd5b91116f14d8533c57831ed00571b6", - "reference": "19bd1e4fcd5b91116f14d8533c57831ed00571b6", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "suggest": { - "ext-intl": "For best performance" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "1.27-dev" - }, - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } - }, - "autoload": { - "files": [ - "bootstrap.php" - ], - "psr-4": { - "Symfony\\Polyfill\\Intl\\Normalizer\\": "" - }, - "classmap": [ - "Resources/stubs" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony polyfill for intl's Normalizer class and related functions", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "intl", - "normalizer", - "polyfill", - "portable", - "shim" - ], - "support": { - "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.27.0" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2022-11-03T14:55:06+00:00" - }, - { - "name": "symfony/polyfill-mbstring", - "version": "v1.27.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "8ad114f6b39e2c98a8b0e3bd907732c207c2b534" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/8ad114f6b39e2c98a8b0e3bd907732c207c2b534", - "reference": "8ad114f6b39e2c98a8b0e3bd907732c207c2b534", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "provide": { - "ext-mbstring": "*" - }, - "suggest": { - "ext-mbstring": "For best performance" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "1.27-dev" - }, - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } - }, - "autoload": { - "files": [ - "bootstrap.php" - ], - "psr-4": { - "Symfony\\Polyfill\\Mbstring\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony polyfill for the Mbstring extension", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "mbstring", - "polyfill", - "portable", - "shim" - ], - "support": { - "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.27.0" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2022-11-03T14:55:06+00:00" - }, - { - "name": "symfony/service-contracts", - "version": "v3.2.1", - "source": { - "type": "git", - "url": "https://github.com/symfony/service-contracts.git", - "reference": "a8c9cedf55f314f3a186041d19537303766df09a" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/service-contracts/zipball/a8c9cedf55f314f3a186041d19537303766df09a", - "reference": "a8c9cedf55f314f3a186041d19537303766df09a", - "shasum": "" - }, - "require": { - "php": ">=8.1", - "psr/container": "^2.0" - }, - "conflict": { - "ext-psr": "<1.1|>=2" - }, - "suggest": { - "symfony/service-implementation": "" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "3.3-dev" - }, - "thanks": { - "name": "symfony/contracts", - "url": "https://github.com/symfony/contracts" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Contracts\\Service\\": "" - }, - "exclude-from-classmap": [ - "/Test/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Generic abstractions related to writing services", - "homepage": "https://symfony.com", - "keywords": [ - "abstractions", - "contracts", - "decoupling", - "interfaces", - "interoperability", - "standards" - ], - "support": { - "source": "https://github.com/symfony/service-contracts/tree/v3.2.1" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2023-03-01T10:32:47+00:00" - }, - { - "name": "symfony/string", - "version": "v6.2.8", - "source": { - "type": "git", - "url": "https://github.com/symfony/string.git", - "reference": "193e83bbd6617d6b2151c37fff10fa7168ebddef" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/string/zipball/193e83bbd6617d6b2151c37fff10fa7168ebddef", - "reference": "193e83bbd6617d6b2151c37fff10fa7168ebddef", - "shasum": "" - }, - "require": { - "php": ">=8.1", - "symfony/polyfill-ctype": "~1.8", - "symfony/polyfill-intl-grapheme": "~1.0", - "symfony/polyfill-intl-normalizer": "~1.0", - "symfony/polyfill-mbstring": "~1.0" - }, - "conflict": { - "symfony/translation-contracts": "<2.0" - }, - "require-dev": { - "symfony/error-handler": "^5.4|^6.0", - "symfony/http-client": "^5.4|^6.0", - "symfony/intl": "^6.2", - "symfony/translation-contracts": "^2.0|^3.0", - "symfony/var-exporter": "^5.4|^6.0" - }, - "type": "library", - "autoload": { - "files": [ - "Resources/functions.php" - ], - "psr-4": { - "Symfony\\Component\\String\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Provides an object-oriented API to strings and deals with bytes, UTF-8 code points and grapheme clusters in a unified way", - "homepage": "https://symfony.com", - "keywords": [ - "grapheme", - "i18n", - "string", - "unicode", - "utf-8", - "utf8" - ], - "support": { - "source": "https://github.com/symfony/string/tree/v6.2.8" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2023-03-20T16:06:02+00:00" - }, - { - "name": "symfony/var-exporter", - "version": "v6.2.10", - "source": { - "type": "git", - "url": "https://github.com/symfony/var-exporter.git", - "reference": "9a07920c2058bafee921ce4d90aeef2193837d63" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/var-exporter/zipball/9a07920c2058bafee921ce4d90aeef2193837d63", - "reference": "9a07920c2058bafee921ce4d90aeef2193837d63", - "shasum": "" - }, - "require": { - "php": ">=8.1" - }, - "require-dev": { - "symfony/var-dumper": "^5.4|^6.0" - }, - "type": "library", - "autoload": { - "psr-4": { - "Symfony\\Component\\VarExporter\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Allows exporting any serializable PHP data structure to plain PHP code", - "homepage": "https://symfony.com", - "keywords": [ - "clone", - "construct", - "export", - "hydrate", - "instantiate", - "lazy-loading", - "proxy", - "serialize" - ], - "support": { - "source": "https://github.com/symfony/var-exporter/tree/v6.2.10" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2023-04-21T08:33:05+00:00" - }, - { - "name": "symfony/yaml", - "version": "v6.2.10", - "source": { - "type": "git", - "url": "https://github.com/symfony/yaml.git", - "reference": "61916f3861b1e9705b18cfde723921a71dd1559d" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/yaml/zipball/61916f3861b1e9705b18cfde723921a71dd1559d", - "reference": "61916f3861b1e9705b18cfde723921a71dd1559d", - "shasum": "" - }, - "require": { - "php": ">=8.1", - "symfony/polyfill-ctype": "^1.8" - }, - "conflict": { - "symfony/console": "<5.4" - }, - "require-dev": { - "symfony/console": "^5.4|^6.0" - }, - "suggest": { - "symfony/console": "For validating YAML files using the lint command" - }, - "bin": [ - "Resources/bin/yaml-lint" - ], - "type": "library", - "autoload": { - "psr-4": { - "Symfony\\Component\\Yaml\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Loads and dumps YAML files", - "homepage": "https://symfony.com", - "support": { - "source": "https://github.com/symfony/yaml/tree/v6.2.10" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2023-04-28T13:25:36+00:00" - } - ], - "packages-dev": [ - { - "name": "amphp/amp", - "version": "v2.6.2", - "source": { - "type": "git", - "url": "https://github.com/amphp/amp.git", - "reference": "9d5100cebffa729aaffecd3ad25dc5aeea4f13bb" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/amphp/amp/zipball/9d5100cebffa729aaffecd3ad25dc5aeea4f13bb", - "reference": "9d5100cebffa729aaffecd3ad25dc5aeea4f13bb", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "require-dev": { - "amphp/php-cs-fixer-config": "dev-master", - "amphp/phpunit-util": "^1", - "ext-json": "*", - "jetbrains/phpstorm-stubs": "^2019.3", - "phpunit/phpunit": "^7 | ^8 | ^9", - "psalm/phar": "^3.11@dev", - "react/promise": "^2" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.x-dev" - } - }, - "autoload": { - "files": [ - "lib/functions.php", - "lib/Internal/functions.php" - ], - "psr-4": { - "Amp\\": "lib" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Daniel Lowrey", - "email": "rdlowrey@php.net" - }, - { - "name": "Aaron Piotrowski", - "email": "aaron@trowski.com" - }, - { - "name": "Bob Weinand", - "email": "bobwei9@hotmail.com" - }, - { - "name": "Niklas Keller", - "email": "me@kelunik.com" - } - ], - "description": "A non-blocking concurrency framework for PHP applications.", - "homepage": "https://amphp.org/amp", - "keywords": [ - "async", - "asynchronous", - "awaitable", - "concurrency", - "event", - "event-loop", - "future", - "non-blocking", - "promise" - ], - "support": { - "irc": "irc://irc.freenode.org/amphp", - "issues": "https://github.com/amphp/amp/issues", - "source": "https://github.com/amphp/amp/tree/v2.6.2" - }, - "funding": [ - { - "url": "https://github.com/amphp", - "type": "github" - } - ], - "time": "2022-02-20T17:52:18+00:00" - }, - { - "name": "amphp/byte-stream", - "version": "v1.8.1", - "source": { - "type": "git", - "url": "https://github.com/amphp/byte-stream.git", - "reference": "acbd8002b3536485c997c4e019206b3f10ca15bd" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/amphp/byte-stream/zipball/acbd8002b3536485c997c4e019206b3f10ca15bd", - "reference": "acbd8002b3536485c997c4e019206b3f10ca15bd", - "shasum": "" - }, - "require": { - "amphp/amp": "^2", - "php": ">=7.1" - }, - "require-dev": { - "amphp/php-cs-fixer-config": "dev-master", - "amphp/phpunit-util": "^1.4", - "friendsofphp/php-cs-fixer": "^2.3", - "jetbrains/phpstorm-stubs": "^2019.3", - "phpunit/phpunit": "^6 || ^7 || ^8", - "psalm/phar": "^3.11.4" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.x-dev" - } - }, - "autoload": { - "files": [ - "lib/functions.php" - ], - "psr-4": { - "Amp\\ByteStream\\": "lib" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Aaron Piotrowski", - "email": "aaron@trowski.com" - }, - { - "name": "Niklas Keller", - "email": "me@kelunik.com" - } - ], - "description": "A stream abstraction to make working with non-blocking I/O simple.", - "homepage": "http://amphp.org/byte-stream", - "keywords": [ - "amp", - "amphp", - "async", - "io", - "non-blocking", - "stream" - ], - "support": { - "irc": "irc://irc.freenode.org/amphp", - "issues": "https://github.com/amphp/byte-stream/issues", - "source": "https://github.com/amphp/byte-stream/tree/v1.8.1" - }, - "funding": [ - { - "url": "https://github.com/amphp", - "type": "github" - } - ], - "time": "2021-03-30T17:13:30+00:00" - }, - { - "name": "amphp/parallel", - "version": "v1.4.3", - "source": { - "type": "git", - "url": "https://github.com/amphp/parallel.git", - "reference": "3aac213ba7858566fd83d38ccb85b91b2d652cb0" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/amphp/parallel/zipball/3aac213ba7858566fd83d38ccb85b91b2d652cb0", - "reference": "3aac213ba7858566fd83d38ccb85b91b2d652cb0", - "shasum": "" - }, - "require": { - "amphp/amp": "^2", - "amphp/byte-stream": "^1.6.1", - "amphp/parser": "^1", - "amphp/process": "^1", - "amphp/serialization": "^1", - "amphp/sync": "^1.0.1", - "php": ">=7.1" - }, - "require-dev": { - "amphp/php-cs-fixer-config": "dev-master", - "amphp/phpunit-util": "^1.1", - "phpunit/phpunit": "^8 || ^7" - }, - "type": "library", - "autoload": { - "files": [ - "lib/Context/functions.php", - "lib/Sync/functions.php", - "lib/Worker/functions.php" - ], - "psr-4": { - "Amp\\Parallel\\": "lib" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Aaron Piotrowski", - "email": "aaron@trowski.com" - }, - { - "name": "Stephen Coakley", - "email": "me@stephencoakley.com" - } - ], - "description": "Parallel processing component for Amp.", - "homepage": "https://github.com/amphp/parallel", - "keywords": [ - "async", - "asynchronous", - "concurrent", - "multi-processing", - "multi-threading" - ], - "support": { - "issues": "https://github.com/amphp/parallel/issues", - "source": "https://github.com/amphp/parallel/tree/v1.4.3" - }, - "funding": [ - { - "url": "https://github.com/amphp", - "type": "github" - } - ], - "time": "2023-03-23T08:04:23+00:00" - }, - { - "name": "amphp/parallel-functions", - "version": "v1.1.0", - "source": { - "type": "git", - "url": "https://github.com/amphp/parallel-functions.git", - "reference": "04e92fcacfc921a56dfe12c23b3265e62593a7cb" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/amphp/parallel-functions/zipball/04e92fcacfc921a56dfe12c23b3265e62593a7cb", - "reference": "04e92fcacfc921a56dfe12c23b3265e62593a7cb", - "shasum": "" - }, - "require": { - "amphp/amp": "^2.0.3", - "amphp/parallel": "^1.4", - "amphp/serialization": "^1.0", - "laravel/serializable-closure": "^1.0", - "php": ">=7.4" - }, - "require-dev": { - "amphp/php-cs-fixer-config": "v2.x-dev", - "amphp/phpunit-util": "^2.0", - "phpunit/phpunit": "^9.5.11" - }, - "type": "library", - "autoload": { - "files": [ - "src/functions.php" - ], - "psr-4": { - "Amp\\ParallelFunctions\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Niklas Keller", - "email": "me@kelunik.com" - } - ], - "description": "Parallel processing made simple.", - "support": { - "issues": "https://github.com/amphp/parallel-functions/issues", - "source": "https://github.com/amphp/parallel-functions/tree/v1.1.0" - }, - "funding": [ - { - "url": "https://github.com/amphp", - "type": "github" - } - ], - "time": "2022-02-03T19:32:41+00:00" - }, - { - "name": "amphp/parser", - "version": "v1.1.0", - "source": { - "type": "git", - "url": "https://github.com/amphp/parser.git", - "reference": "ff1de4144726c5dad5fab97f66692ebe8de3e151" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/amphp/parser/zipball/ff1de4144726c5dad5fab97f66692ebe8de3e151", - "reference": "ff1de4144726c5dad5fab97f66692ebe8de3e151", - "shasum": "" - }, - "require": { - "php": ">=7.4" - }, - "require-dev": { - "amphp/php-cs-fixer-config": "^2", - "phpunit/phpunit": "^9", - "psalm/phar": "^5.4" - }, - "type": "library", - "autoload": { - "psr-4": { - "Amp\\Parser\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Aaron Piotrowski", - "email": "aaron@trowski.com" - }, - { - "name": "Niklas Keller", - "email": "me@kelunik.com" - } - ], - "description": "A generator parser to make streaming parsers simple.", - "homepage": "https://github.com/amphp/parser", - "keywords": [ - "async", - "non-blocking", - "parser", - "stream" - ], - "support": { - "issues": "https://github.com/amphp/parser/issues", - "source": "https://github.com/amphp/parser/tree/v1.1.0" - }, - "funding": [ - { - "url": "https://github.com/amphp", - "type": "github" - } - ], - "time": "2022-12-30T18:08:47+00:00" - }, - { - "name": "amphp/process", - "version": "v1.1.4", - "source": { - "type": "git", - "url": "https://github.com/amphp/process.git", - "reference": "76e9495fd6818b43a20167cb11d8a67f7744ee0f" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/amphp/process/zipball/76e9495fd6818b43a20167cb11d8a67f7744ee0f", - "reference": "76e9495fd6818b43a20167cb11d8a67f7744ee0f", - "shasum": "" - }, - "require": { - "amphp/amp": "^2", - "amphp/byte-stream": "^1.4", - "php": ">=7" - }, - "require-dev": { - "amphp/php-cs-fixer-config": "dev-master", - "amphp/phpunit-util": "^1", - "phpunit/phpunit": "^6" - }, - "type": "library", - "autoload": { - "files": [ - "lib/functions.php" - ], - "psr-4": { - "Amp\\Process\\": "lib" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Bob Weinand", - "email": "bobwei9@hotmail.com" - }, - { - "name": "Aaron Piotrowski", - "email": "aaron@trowski.com" - }, - { - "name": "Niklas Keller", - "email": "me@kelunik.com" - } - ], - "description": "Asynchronous process manager.", - "homepage": "https://github.com/amphp/process", - "support": { - "issues": "https://github.com/amphp/process/issues", - "source": "https://github.com/amphp/process/tree/v1.1.4" - }, - "funding": [ - { - "url": "https://github.com/amphp", - "type": "github" - } - ], - "time": "2022-07-06T23:50:12+00:00" - }, - { - "name": "amphp/serialization", - "version": "v1.0.0", - "source": { - "type": "git", - "url": "https://github.com/amphp/serialization.git", - "reference": "693e77b2fb0b266c3c7d622317f881de44ae94a1" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/amphp/serialization/zipball/693e77b2fb0b266c3c7d622317f881de44ae94a1", - "reference": "693e77b2fb0b266c3c7d622317f881de44ae94a1", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "require-dev": { - "amphp/php-cs-fixer-config": "dev-master", - "phpunit/phpunit": "^9 || ^8 || ^7" - }, - "type": "library", - "autoload": { - "files": [ - "src/functions.php" - ], - "psr-4": { - "Amp\\Serialization\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Aaron Piotrowski", - "email": "aaron@trowski.com" - }, - { - "name": "Niklas Keller", - "email": "me@kelunik.com" - } - ], - "description": "Serialization tools for IPC and data storage in PHP.", - "homepage": "https://github.com/amphp/serialization", - "keywords": [ - "async", - "asynchronous", - "serialization", - "serialize" - ], - "support": { - "issues": "https://github.com/amphp/serialization/issues", - "source": "https://github.com/amphp/serialization/tree/master" - }, - "time": "2020-03-25T21:39:07+00:00" - }, - { - "name": "amphp/sync", - "version": "v1.4.2", - "source": { - "type": "git", - "url": "https://github.com/amphp/sync.git", - "reference": "85ab06764f4f36d63b1356b466df6111cf4b89cf" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/amphp/sync/zipball/85ab06764f4f36d63b1356b466df6111cf4b89cf", - "reference": "85ab06764f4f36d63b1356b466df6111cf4b89cf", - "shasum": "" - }, - "require": { - "amphp/amp": "^2.2", - "php": ">=7.1" - }, - "require-dev": { - "amphp/php-cs-fixer-config": "dev-master", - "amphp/phpunit-util": "^1.1", - "phpunit/phpunit": "^9 || ^8 || ^7" - }, - "type": "library", - "autoload": { - "files": [ - "src/functions.php", - "src/ConcurrentIterator/functions.php" - ], - "psr-4": { - "Amp\\Sync\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Aaron Piotrowski", - "email": "aaron@trowski.com" - }, - { - "name": "Stephen Coakley", - "email": "me@stephencoakley.com" - } - ], - "description": "Mutex, Semaphore, and other synchronization tools for Amp.", - "homepage": "https://github.com/amphp/sync", - "keywords": [ - "async", - "asynchronous", - "mutex", - "semaphore", - "synchronization" - ], - "support": { - "issues": "https://github.com/amphp/sync/issues", - "source": "https://github.com/amphp/sync/tree/v1.4.2" - }, - "funding": [ - { - "url": "https://github.com/amphp", - "type": "github" - } - ], - "time": "2021-10-25T18:29:10+00:00" - }, - { - "name": "colinodell/json5", - "version": "v2.3.0", - "source": { - "type": "git", - "url": "https://github.com/colinodell/json5.git", - "reference": "15b063f8cb5e6deb15f0cd39123264ec0d19c710" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/colinodell/json5/zipball/15b063f8cb5e6deb15f0cd39123264ec0d19c710", - "reference": "15b063f8cb5e6deb15f0cd39123264ec0d19c710", - "shasum": "" - }, - "require": { - "ext-json": "*", - "ext-mbstring": "*", - "php": "^7.1.3|^8.0" - }, - "conflict": { - "scrutinizer/ocular": "1.7.*" - }, - "require-dev": { - "mikehaertl/php-shellcommand": "^1.2.5", - "phpstan/phpstan": "^1.4", - "scrutinizer/ocular": "^1.6", - "squizlabs/php_codesniffer": "^2.3 || ^3.0", - "symfony/finder": "^4.4|^5.4|^6.0", - "symfony/phpunit-bridge": "^5.4|^6.0" - }, - "bin": [ - "bin/json5" - ], - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "3.0-dev" - } - }, - "autoload": { - "files": [ - "src/global.php" - ], - "psr-4": { - "ColinODell\\Json5\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Colin O'Dell", - "email": "colinodell@gmail.com", - "homepage": "https://www.colinodell.com", - "role": "Developer" - } - ], - "description": "UTF-8 compatible JSON5 parser for PHP", - "homepage": "https://github.com/colinodell/json5", - "keywords": [ - "JSON5", - "json", - "json5_decode", - "json_decode" - ], - "support": { - "issues": "https://github.com/colinodell/json5/issues", - "source": "https://github.com/colinodell/json5/tree/v2.3.0" - }, - "funding": [ - { - "url": "https://www.colinodell.com/sponsor", - "type": "custom" - }, - { - "url": "https://www.paypal.me/colinpodell/10.00", - "type": "custom" - }, - { - "url": "https://github.com/colinodell", - "type": "github" - }, - { - "url": "https://www.patreon.com/colinodell", - "type": "patreon" - } - ], - "time": "2022-12-27T16:44:40+00:00" - }, - { - "name": "composer/semver", - "version": "3.3.2", - "source": { - "type": "git", - "url": "https://github.com/composer/semver.git", - "reference": "3953f23262f2bff1919fc82183ad9acb13ff62c9" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/composer/semver/zipball/3953f23262f2bff1919fc82183ad9acb13ff62c9", - "reference": "3953f23262f2bff1919fc82183ad9acb13ff62c9", - "shasum": "" - }, - "require": { - "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-main": "3.x-dev" - } - }, - "autoload": { - "psr-4": { - "Composer\\Semver\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nils Adermann", - "email": "naderman@naderman.de", - "homepage": "http://www.naderman.de" - }, - { - "name": "Jordi Boggiano", - "email": "j.boggiano@seld.be", - "homepage": "http://seld.be" - }, - { - "name": "Rob Bast", - "email": "rob.bast@gmail.com", - "homepage": "http://robbast.nl" - } - ], - "description": "Semver library that offers utilities, version constraint parsing and validation.", - "keywords": [ - "semantic", - "semver", - "validation", - "versioning" - ], - "support": { - "irc": "irc://irc.freenode.org/composer", - "issues": "https://github.com/composer/semver/issues", - "source": "https://github.com/composer/semver/tree/3.3.2" - }, - "funding": [ - { - "url": "https://packagist.com", - "type": "custom" - }, - { - "url": "https://github.com/composer", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/composer/composer", - "type": "tidelift" - } - ], - "time": "2022-04-01T19:23:25+00:00" - }, - { - "name": "dnoegel/php-xdg-base-dir", - "version": "v0.1.1", - "source": { - "type": "git", - "url": "https://github.com/dnoegel/php-xdg-base-dir.git", - "reference": "8f8a6e48c5ecb0f991c2fdcf5f154a47d85f9ffd" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/dnoegel/php-xdg-base-dir/zipball/8f8a6e48c5ecb0f991c2fdcf5f154a47d85f9ffd", - "reference": "8f8a6e48c5ecb0f991c2fdcf5f154a47d85f9ffd", - "shasum": "" - }, - "require": { - "php": ">=5.3.2" - }, - "require-dev": { - "phpunit/phpunit": "~7.0|~6.0|~5.0|~4.8.35" - }, - "type": "library", - "autoload": { - "psr-4": { - "XdgBaseDir\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "description": "implementation of xdg base directory specification for php", - "support": { - "issues": "https://github.com/dnoegel/php-xdg-base-dir/issues", - "source": "https://github.com/dnoegel/php-xdg-base-dir/tree/v0.1.1" - }, - "time": "2019-12-04T15:06:13+00:00" - }, - { - "name": "doctrine/annotations", - "version": "2.0.1", - "source": { - "type": "git", - "url": "https://github.com/doctrine/annotations.git", - "reference": "e157ef3f3124bbf6fe7ce0ffd109e8a8ef284e7f" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/doctrine/annotations/zipball/e157ef3f3124bbf6fe7ce0ffd109e8a8ef284e7f", - "reference": "e157ef3f3124bbf6fe7ce0ffd109e8a8ef284e7f", - "shasum": "" - }, - "require": { - "doctrine/lexer": "^2 || ^3", - "ext-tokenizer": "*", - "php": "^7.2 || ^8.0", - "psr/cache": "^1 || ^2 || ^3" - }, - "require-dev": { - "doctrine/cache": "^2.0", - "doctrine/coding-standard": "^10", - "phpstan/phpstan": "^1.8.0", - "phpunit/phpunit": "^7.5 || ^8.5 || ^9.5", - "symfony/cache": "^5.4 || ^6", - "vimeo/psalm": "^4.10" - }, - "suggest": { - "php": "PHP 8.0 or higher comes with attributes, a native replacement for annotations" - }, - "type": "library", - "autoload": { - "psr-4": { - "Doctrine\\Common\\Annotations\\": "lib/Doctrine/Common/Annotations" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Guilherme Blanco", - "email": "guilhermeblanco@gmail.com" - }, - { - "name": "Roman Borschel", - "email": "roman@code-factory.org" - }, - { - "name": "Benjamin Eberlei", - "email": "kontakt@beberlei.de" - }, - { - "name": "Jonathan Wage", - "email": "jonwage@gmail.com" - }, - { - "name": "Johannes Schmitt", - "email": "schmittjoh@gmail.com" - } - ], - "description": "Docblock Annotations Parser", - "homepage": "https://www.doctrine-project.org/projects/annotations.html", - "keywords": [ - "annotations", - "docblock", - "parser" - ], - "support": { - "issues": "https://github.com/doctrine/annotations/issues", - "source": "https://github.com/doctrine/annotations/tree/2.0.1" - }, - "time": "2023-02-02T22:02:53+00:00" - }, - { - "name": "doctrine/instantiator", - "version": "2.0.0", - "source": { - "type": "git", - "url": "https://github.com/doctrine/instantiator.git", - "reference": "c6222283fa3f4ac679f8b9ced9a4e23f163e80d0" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/doctrine/instantiator/zipball/c6222283fa3f4ac679f8b9ced9a4e23f163e80d0", - "reference": "c6222283fa3f4ac679f8b9ced9a4e23f163e80d0", - "shasum": "" - }, - "require": { - "php": "^8.1" - }, - "require-dev": { - "doctrine/coding-standard": "^11", - "ext-pdo": "*", - "ext-phar": "*", - "phpbench/phpbench": "^1.2", - "phpstan/phpstan": "^1.9.4", - "phpstan/phpstan-phpunit": "^1.3", - "phpunit/phpunit": "^9.5.27", - "vimeo/psalm": "^5.4" - }, - "type": "library", - "autoload": { - "psr-4": { - "Doctrine\\Instantiator\\": "src/Doctrine/Instantiator/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Marco Pivetta", - "email": "ocramius@gmail.com", - "homepage": "https://ocramius.github.io/" - } - ], - "description": "A small, lightweight utility to instantiate objects in PHP without invoking their constructors", - "homepage": "https://www.doctrine-project.org/projects/instantiator.html", - "keywords": [ - "constructor", - "instantiate" - ], - "support": { - "issues": "https://github.com/doctrine/instantiator/issues", - "source": "https://github.com/doctrine/instantiator/tree/2.0.0" - }, - "funding": [ - { - "url": "https://www.doctrine-project.org/sponsorship.html", - "type": "custom" - }, - { - "url": "https://www.patreon.com/phpdoctrine", - "type": "patreon" - }, - { - "url": "https://tidelift.com/funding/github/packagist/doctrine%2Finstantiator", - "type": "tidelift" - } - ], - "time": "2022-12-30T00:23:10+00:00" - }, - { - "name": "doctrine/lexer", - "version": "3.0.0", - "source": { - "type": "git", - "url": "https://github.com/doctrine/lexer.git", - "reference": "84a527db05647743d50373e0ec53a152f2cde568" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/doctrine/lexer/zipball/84a527db05647743d50373e0ec53a152f2cde568", - "reference": "84a527db05647743d50373e0ec53a152f2cde568", - "shasum": "" - }, - "require": { - "php": "^8.1" - }, - "require-dev": { - "doctrine/coding-standard": "^10", - "phpstan/phpstan": "^1.9", - "phpunit/phpunit": "^9.5", - "psalm/plugin-phpunit": "^0.18.3", - "vimeo/psalm": "^5.0" - }, - "type": "library", - "autoload": { - "psr-4": { - "Doctrine\\Common\\Lexer\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Guilherme Blanco", - "email": "guilhermeblanco@gmail.com" - }, - { - "name": "Roman Borschel", - "email": "roman@code-factory.org" - }, - { - "name": "Johannes Schmitt", - "email": "schmittjoh@gmail.com" - } - ], - "description": "PHP Doctrine Lexer parser library that can be used in Top-Down, Recursive Descent Parsers.", - "homepage": "https://www.doctrine-project.org/projects/lexer.html", - "keywords": [ - "annotations", - "docblock", - "lexer", - "parser", - "php" - ], - "support": { - "issues": "https://github.com/doctrine/lexer/issues", - "source": "https://github.com/doctrine/lexer/tree/3.0.0" - }, - "funding": [ - { - "url": "https://www.doctrine-project.org/sponsorship.html", - "type": "custom" - }, - { - "url": "https://www.patreon.com/phpdoctrine", - "type": "patreon" - }, - { - "url": "https://tidelift.com/funding/github/packagist/doctrine%2Flexer", - "type": "tidelift" - } - ], - "time": "2022-12-15T16:57:16+00:00" - }, - { - "name": "felixfbecker/advanced-json-rpc", - "version": "v3.2.1", - "source": { - "type": "git", - "url": "https://github.com/felixfbecker/php-advanced-json-rpc.git", - "reference": "b5f37dbff9a8ad360ca341f3240dc1c168b45447" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/felixfbecker/php-advanced-json-rpc/zipball/b5f37dbff9a8ad360ca341f3240dc1c168b45447", - "reference": "b5f37dbff9a8ad360ca341f3240dc1c168b45447", - "shasum": "" - }, - "require": { - "netresearch/jsonmapper": "^1.0 || ^2.0 || ^3.0 || ^4.0", - "php": "^7.1 || ^8.0", - "phpdocumentor/reflection-docblock": "^4.3.4 || ^5.0.0" - }, - "require-dev": { - "phpunit/phpunit": "^7.0 || ^8.0" - }, - "type": "library", - "autoload": { - "psr-4": { - "AdvancedJsonRpc\\": "lib/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "ISC" - ], - "authors": [ - { - "name": "Felix Becker", - "email": "felix.b@outlook.com" - } - ], - "description": "A more advanced JSONRPC implementation", - "support": { - "issues": "https://github.com/felixfbecker/php-advanced-json-rpc/issues", - "source": "https://github.com/felixfbecker/php-advanced-json-rpc/tree/v3.2.1" - }, - "time": "2021-06-11T22:34:44+00:00" - }, - { - "name": "felixfbecker/language-server-protocol", - "version": "v1.5.2", - "source": { - "type": "git", - "url": "https://github.com/felixfbecker/php-language-server-protocol.git", - "reference": "6e82196ffd7c62f7794d778ca52b69feec9f2842" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/felixfbecker/php-language-server-protocol/zipball/6e82196ffd7c62f7794d778ca52b69feec9f2842", - "reference": "6e82196ffd7c62f7794d778ca52b69feec9f2842", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "require-dev": { - "phpstan/phpstan": "*", - "squizlabs/php_codesniffer": "^3.1", - "vimeo/psalm": "^4.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.x-dev" - } - }, - "autoload": { - "psr-4": { - "LanguageServerProtocol\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "ISC" - ], - "authors": [ - { - "name": "Felix Becker", - "email": "felix.b@outlook.com" - } - ], - "description": "PHP classes for the Language Server Protocol", - "keywords": [ - "language", - "microsoft", - "php", - "server" - ], - "support": { - "issues": "https://github.com/felixfbecker/php-language-server-protocol/issues", - "source": "https://github.com/felixfbecker/php-language-server-protocol/tree/v1.5.2" - }, - "time": "2022-03-02T22:36:06+00:00" - }, - { - "name": "fidry/console", - "version": "0.5.5", - "source": { - "type": "git", - "url": "https://github.com/theofidry/console.git", - "reference": "bc1fe03f600c63f12ec0a39c6b746c1a1fb77bf7" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/theofidry/console/zipball/bc1fe03f600c63f12ec0a39c6b746c1a1fb77bf7", - "reference": "bc1fe03f600c63f12ec0a39c6b746c1a1fb77bf7", - "shasum": "" - }, - "require": { - "php": "^7.4.0 || ^8.0.0", - "symfony/console": "^4.4 || ^5.4 || ^6.1", - "symfony/event-dispatcher-contracts": "^1.0 || ^2.5 || ^3.0", - "symfony/service-contracts": "^1.0 || ^2.5 || ^3.0", - "thecodingmachine/safe": "^1.3 || ^2.0", - "webmozart/assert": "^1.11" - }, - "conflict": { - "symfony/dependency-injection": "<5.3.0", - "symfony/framework-bundle": "<5.3.0", - "symfony/http-kernel": "<5.3.0" - }, - "require-dev": { - "bamarni/composer-bin-plugin": "^1.4", - "composer/semver": "^3.3", - "ergebnis/composer-normalize": "^2.28", - "infection/infection": "^0.26", - "phpspec/prophecy-phpunit": "^2.0", - "phpunit/phpunit": "^9.4.3", - "symfony/dependency-injection": "^4.4 || ^5.4 || ^6.1", - "symfony/framework-bundle": "^4.4 || ^5.4 || ^6.1", - "symfony/http-kernel": "^4.4 || ^5.4 || ^6.1", - "symfony/phpunit-bridge": "^4.4.47 || ^5.4 || ^6.0", - "symfony/yaml": "^4.4 || ^5.4 || ^6.1", - "webmozarts/strict-phpunit": "^7.3" - }, - "type": "library", - "extra": { - "bamarni-bin": { - "bin-links": false, - "forward-command": false - }, - "branch-alias": { - "dev-main": "1.0.x-dev" - } - }, - "autoload": { - "psr-4": { - "Fidry\\Console\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Théo Fidry", - "email": "theo.fidry@gmail.com" - } - ], - "description": "Library to create CLI applications", - "keywords": [ - "cli", - "console", - "symfony" - ], - "support": { - "issues": "https://github.com/theofidry/console/issues", - "source": "https://github.com/theofidry/console/tree/0.5.5" - }, - "funding": [ - { - "url": "https://github.com/theofidry", - "type": "github" - } - ], - "time": "2022-12-18T10:49:34+00:00" - }, - { - "name": "fidry/cpu-core-counter", - "version": "0.4.1", - "source": { - "type": "git", - "url": "https://github.com/theofidry/cpu-core-counter.git", - "reference": "79261cc280aded96d098e1b0e0ba0c4881b432c2" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/theofidry/cpu-core-counter/zipball/79261cc280aded96d098e1b0e0ba0c4881b432c2", - "reference": "79261cc280aded96d098e1b0e0ba0c4881b432c2", - "shasum": "" - }, - "require": { - "php": "^7.2 || ^8.0" - }, - "require-dev": { - "fidry/makefile": "^0.2.0", - "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": "^9.5.26 || ^8.5.31", - "theofidry/php-cs-fixer-config": "^1.0", - "webmozarts/strict-phpunit": "^7.5" - }, - "type": "library", - "autoload": { - "psr-4": { - "Fidry\\CpuCoreCounter\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Théo FIDRY", - "email": "theo.fidry@gmail.com" - } - ], - "description": "Tiny utility to get the number of CPU cores.", - "keywords": [ - "CPU", - "core" - ], - "support": { - "issues": "https://github.com/theofidry/cpu-core-counter/issues", - "source": "https://github.com/theofidry/cpu-core-counter/tree/0.4.1" - }, - "funding": [ - { - "url": "https://github.com/theofidry", - "type": "github" - } - ], - "time": "2022-12-16T22:01:02+00:00" - }, - { - "name": "friendsofphp/php-cs-fixer", - "version": "v3.16.0", - "source": { - "type": "git", - "url": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer.git", - "reference": "d40f9436e1c448d309fa995ab9c14c5c7a96f2dc" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/PHP-CS-Fixer/PHP-CS-Fixer/zipball/d40f9436e1c448d309fa995ab9c14c5c7a96f2dc", - "reference": "d40f9436e1c448d309fa995ab9c14c5c7a96f2dc", - "shasum": "" - }, - "require": { - "composer/semver": "^3.3", - "composer/xdebug-handler": "^3.0.3", - "doctrine/annotations": "^2", - "doctrine/lexer": "^2 || ^3", - "ext-json": "*", - "ext-tokenizer": "*", - "php": "^7.4 || ^8.0", - "sebastian/diff": "^4.0 || ^5.0", - "symfony/console": "^5.4 || ^6.0", - "symfony/event-dispatcher": "^5.4 || ^6.0", - "symfony/filesystem": "^5.4 || ^6.0", - "symfony/finder": "^5.4 || ^6.0", - "symfony/options-resolver": "^5.4 || ^6.0", - "symfony/polyfill-mbstring": "^1.27", - "symfony/polyfill-php80": "^1.27", - "symfony/polyfill-php81": "^1.27", - "symfony/process": "^5.4 || ^6.0", - "symfony/stopwatch": "^5.4 || ^6.0" - }, - "require-dev": { - "justinrainbow/json-schema": "^5.2", - "keradus/cli-executor": "^2.0", - "mikey179/vfsstream": "^1.6.11", - "php-coveralls/php-coveralls": "^2.5.3", - "php-cs-fixer/accessible-object": "^1.1", - "php-cs-fixer/phpunit-constraint-isidenticalstring": "^1.2", - "php-cs-fixer/phpunit-constraint-xmlmatchesxsd": "^1.2.1", - "phpspec/prophecy": "^1.16", - "phpspec/prophecy-phpunit": "^2.0", - "phpunit/phpunit": "^9.5", - "phpunitgoodpractices/polyfill": "^1.6", - "phpunitgoodpractices/traits": "^1.9.2", - "symfony/phpunit-bridge": "^6.2.3", - "symfony/yaml": "^5.4 || ^6.0" - }, - "suggest": { - "ext-dom": "For handling output formats in XML", - "ext-mbstring": "For handling non-UTF8 characters." - }, - "bin": [ - "php-cs-fixer" - ], - "type": "application", - "autoload": { - "psr-4": { - "PhpCsFixer\\": "src/" - } - }, - "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.16.0" - }, - "funding": [ - { - "url": "https://github.com/keradus", - "type": "github" - } - ], - "time": "2023-04-02T19:30:06+00:00" - }, - { - "name": "humbug/box", - "version": "4.3.8", - "source": { - "type": "git", - "url": "https://github.com/box-project/box.git", - "reference": "55344067891d8be61e6efa50f7c2e59114f32704" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/box-project/box/zipball/55344067891d8be61e6efa50f7c2e59114f32704", - "reference": "55344067891d8be61e6efa50f7c2e59114f32704", - "shasum": "" - }, - "require": { - "amphp/parallel-functions": "^1.1", - "composer-plugin-api": "^2.2", - "composer/semver": "^3.3.2", - "composer/xdebug-handler": "^3.0.3", - "ext-phar": "*", - "ext-sodium": "*", - "fidry/console": "^0.5.3", - "humbug/php-scoper": "^0.18.3", - "justinrainbow/json-schema": "^5.2.12", - "laravel/serializable-closure": "^1.2.2", - "nikic/iter": "^2.2", - "nikic/php-parser": "^4.15.2", - "paragonie/constant_time_encoding": "^2.6", - "php": "^8.1", - "phpdocumentor/reflection-docblock": "^5.3", - "psr/log": "^3.0", - "seld/jsonlint": "^1.9", - "symfony/console": "^6.1.7", - "symfony/filesystem": "^6.1.5", - "symfony/finder": "^6.1.3", - "symfony/process": "^6.1.3", - "symfony/var-dumper": "^6.1.6", - "webmozart/assert": "^1.11" - }, - "replace": { - "paragonie/sodium_compat": "*", - "symfony/polyfill-php80": "*", - "symfony/polyfill-php81": "*" - }, - "require-dev": { - "bamarni/composer-bin-plugin": "^1.8.2", - "ergebnis/composer-normalize": "^2.29", - "fidry/makefile": "^0.2.1", - "mikey179/vfsstream": "^1.6.11", - "phpspec/prophecy-phpunit": "^2.0.1", - "phpunit/phpunit": "^9.5.26", - "symfony/phpunit-bridge": "^6.1.6", - "symfony/yaml": "^6.2", - "webmozarts/strict-phpunit": "^7.6" - }, - "suggest": { - "ext-openssl": "To accelerate private key generation." - }, - "bin": [ - "bin/box" - ], - "type": "library", - "extra": { - "bamarni-bin": { - "bin-links": false, - "forward-command": false - }, - "branch-alias": { - "dev-main": "4.x-dev" - } - }, - "autoload": { - "files": [ - "src/FileSystem/file_system.php", - "src/consts.php", - "src/functions.php" - ], - "psr-4": { - "KevinGH\\Box\\": "src" - }, - "exclude-from-classmap": [ - "/Test/", - "vendor/humbug/php-scoper/vendor-hotfix" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Kevin Herrera", - "email": "kevin@herrera.io", - "homepage": "http://kevin.herrera.io" - }, - { - "name": "Théo Fidry", - "email": "theo.fidry@gmail.com" - } - ], - "description": "Fast, zero config application bundler with PHARs.", - "keywords": [ - "phar" - ], - "support": { - "issues": "https://github.com/box-project/box/issues", - "source": "https://github.com/box-project/box/tree/4.3.8" - }, - "time": "2023-03-17T08:30:03+00:00" - }, - { - "name": "humbug/php-scoper", - "version": "0.18.3", - "source": { - "type": "git", - "url": "https://github.com/humbug/php-scoper.git", - "reference": "1a49b88b7961152daf534757137b8f86f67fde23" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/humbug/php-scoper/zipball/1a49b88b7961152daf534757137b8f86f67fde23", - "reference": "1a49b88b7961152daf534757137b8f86f67fde23", - "shasum": "" - }, - "require": { - "fidry/console": "^0.5.0", - "jetbrains/phpstorm-stubs": "^v2022.2", - "nikic/php-parser": "^4.12", - "php": "^8.1", - "symfony/console": "^5.2 || ^6.0", - "symfony/filesystem": "^5.2 || ^6.0", - "symfony/finder": "^5.2 || ^6.0", - "thecodingmachine/safe": "^1.3 || ^2.0" - }, - "require-dev": { - "bamarni/composer-bin-plugin": "^1.1", - "ergebnis/composer-normalize": "^2.28", - "fidry/makefile": "^0.2.1", - "humbug/box": "^4.0", - "phpspec/prophecy-phpunit": "^2.0", - "phpunit/phpunit": "^9.0", - "symfony/yaml": "^6.1" - }, - "bin": [ - "bin/php-scoper" - ], - "type": "library", - "extra": { - "bamarni-bin": { - "bin-links": false, - "forward-command": false - }, - "branch-alias": { - "dev-master": "1.0-dev" - } - }, - "autoload": { - "files": [ - "src/functions.php" - ], - "psr-4": { - "Humbug\\PhpScoper\\": "src/" - }, - "classmap": [ - "vendor-hotfix/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Bernhard Schussek", - "email": "bschussek@gmail.com" - }, - { - "name": "Théo Fidry", - "email": "theo.fidry@gmail.com" - }, - { - "name": "Pádraic Brady", - "email": "padraic.brady@gmail.com" - } - ], - "description": "Prefixes all PHP namespaces in a file or directory.", - "support": { - "issues": "https://github.com/humbug/php-scoper/issues", - "source": "https://github.com/humbug/php-scoper/tree/0.18.3" - }, - "time": "2023-03-16T22:49:19+00:00" - }, - { - "name": "infection/abstract-testframework-adapter", - "version": "0.5.0", - "source": { - "type": "git", - "url": "https://github.com/infection/abstract-testframework-adapter.git", - "reference": "18925e20d15d1a5995bb85c9dc09e8751e1e069b" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/infection/abstract-testframework-adapter/zipball/18925e20d15d1a5995bb85c9dc09e8751e1e069b", - "reference": "18925e20d15d1a5995bb85c9dc09e8751e1e069b", - "shasum": "" - }, - "require": { - "php": "^7.4 || ^8.0" - }, - "require-dev": { - "ergebnis/composer-normalize": "^2.8", - "friendsofphp/php-cs-fixer": "^2.17", - "phpunit/phpunit": "^9.5" - }, - "type": "library", - "autoload": { - "psr-4": { - "Infection\\AbstractTestFramework\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Maks Rafalko", - "email": "maks.rafalko@gmail.com" - } - ], - "description": "Abstract Test Framework Adapter for Infection", - "support": { - "issues": "https://github.com/infection/abstract-testframework-adapter/issues", - "source": "https://github.com/infection/abstract-testframework-adapter/tree/0.5.0" - }, - "funding": [ - { - "url": "https://github.com/infection", - "type": "github" - }, - { - "url": "https://opencollective.com/infection", - "type": "open_collective" - } - ], - "time": "2021-08-17T18:49:12+00:00" - }, - { - "name": "infection/extension-installer", - "version": "0.1.2", - "source": { - "type": "git", - "url": "https://github.com/infection/extension-installer.git", - "reference": "9b351d2910b9a23ab4815542e93d541e0ca0cdcf" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/infection/extension-installer/zipball/9b351d2910b9a23ab4815542e93d541e0ca0cdcf", - "reference": "9b351d2910b9a23ab4815542e93d541e0ca0cdcf", - "shasum": "" - }, - "require": { - "composer-plugin-api": "^1.1 || ^2.0" - }, - "require-dev": { - "composer/composer": "^1.9 || ^2.0", - "friendsofphp/php-cs-fixer": "^2.18, <2.19", - "infection/infection": "^0.15.2", - "php-coveralls/php-coveralls": "^2.4", - "phpstan/extension-installer": "^1.0", - "phpstan/phpstan": "^0.12.10", - "phpstan/phpstan-phpunit": "^0.12.6", - "phpstan/phpstan-strict-rules": "^0.12.2", - "phpstan/phpstan-webmozart-assert": "^0.12.2", - "phpunit/phpunit": "^9.5", - "vimeo/psalm": "^4.8" - }, - "type": "composer-plugin", - "extra": { - "class": "Infection\\ExtensionInstaller\\Plugin" - }, - "autoload": { - "psr-4": { - "Infection\\ExtensionInstaller\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Maks Rafalko", - "email": "maks.rafalko@gmail.com" - } - ], - "description": "Infection Extension Installer", - "support": { - "issues": "https://github.com/infection/extension-installer/issues", - "source": "https://github.com/infection/extension-installer/tree/0.1.2" - }, - "funding": [ - { - "url": "https://github.com/infection", - "type": "github" - }, - { - "url": "https://opencollective.com/infection", - "type": "open_collective" - } - ], - "time": "2021-10-20T22:08:34+00:00" - }, - { - "name": "infection/include-interceptor", - "version": "0.2.5", - "source": { - "type": "git", - "url": "https://github.com/infection/include-interceptor.git", - "reference": "0cc76d95a79d9832d74e74492b0a30139904bdf7" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/infection/include-interceptor/zipball/0cc76d95a79d9832d74e74492b0a30139904bdf7", - "reference": "0cc76d95a79d9832d74e74492b0a30139904bdf7", - "shasum": "" - }, - "require-dev": { - "friendsofphp/php-cs-fixer": "^2.16", - "infection/infection": "^0.15.0", - "phan/phan": "^2.4 || ^3", - "php-coveralls/php-coveralls": "^2.2", - "phpstan/phpstan": "^0.12.8", - "phpunit/phpunit": "^8.5", - "vimeo/psalm": "^3.8" - }, - "type": "library", - "autoload": { - "psr-4": { - "Infection\\StreamWrapper\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Maks Rafalko", - "email": "maks.rafalko@gmail.com" - } - ], - "description": "Stream Wrapper: Include Interceptor. Allows to replace included (autoloaded) file with another one.", - "support": { - "issues": "https://github.com/infection/include-interceptor/issues", - "source": "https://github.com/infection/include-interceptor/tree/0.2.5" - }, - "funding": [ - { - "url": "https://github.com/infection", - "type": "github" - }, - { - "url": "https://opencollective.com/infection", - "type": "open_collective" - } - ], - "time": "2021-08-09T10:03:57+00:00" - }, - { - "name": "infection/infection", - "version": "0.26.20", - "source": { - "type": "git", - "url": "https://github.com/infection/infection.git", - "reference": "37dd2f590bec3d0058e11dbeefc8f93fc9132c62" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/infection/infection/zipball/37dd2f590bec3d0058e11dbeefc8f93fc9132c62", - "reference": "37dd2f590bec3d0058e11dbeefc8f93fc9132c62", - "shasum": "" - }, - "require": { - "colinodell/json5": "^2.2", - "composer-runtime-api": "^2.0", - "composer/xdebug-handler": "^2.0 || ^3.0", - "ext-dom": "*", - "ext-json": "*", - "ext-libxml": "*", - "ext-mbstring": "*", - "fidry/cpu-core-counter": "^0.4.0", - "infection/abstract-testframework-adapter": "^0.5.0", - "infection/extension-installer": "^0.1.0", - "infection/include-interceptor": "^0.2.5", - "justinrainbow/json-schema": "^5.2.10", - "nikic/php-parser": "^4.15.1", - "ondram/ci-detector": "^4.1.0", - "php": "^8.1", - "sanmai/later": "^0.1.1", - "sanmai/pipeline": "^5.1 || ^6", - "sebastian/diff": "^3.0.2 || ^4.0 || ^5.0", - "symfony/console": "^5.4 || ^6.0", - "symfony/filesystem": "^5.4 || ^6.0", - "symfony/finder": "^5.4 || ^6.0", - "symfony/process": "^5.4 || ^6.0", - "thecodingmachine/safe": "^2.1.2", - "webmozart/assert": "^1.11" - }, - "conflict": { - "antecedent/patchwork": "<2.1.25", - "dg/bypass-finals": "<1.4.1", - "phpunit/php-code-coverage": ">9,<9.1.4 || >9.2.17,<9.2.21" - }, - "require-dev": { - "brianium/paratest": "^6.3", - "ext-simplexml": "*", - "fidry/makefile": "^0.2.0", - "helmich/phpunit-json-assert": "^3.0", - "phpspec/prophecy": "^1.15", - "phpspec/prophecy-phpunit": "^2.0", - "phpstan/extension-installer": "^1.1.0", - "phpstan/phpstan": "^1.3.0", - "phpstan/phpstan-phpunit": "^1.0.0", - "phpstan/phpstan-strict-rules": "^1.1.0", - "phpstan/phpstan-webmozart-assert": "^1.0.2", - "phpunit/phpunit": "^9.5.5", - "symfony/phpunit-bridge": "^5.4 || ^6.0", - "symfony/yaml": "^5.4 || ^6.0", - "thecodingmachine/phpstan-safe-rule": "^1.2.0" - }, - "bin": [ - "bin/infection" - ], - "type": "library", - "autoload": { - "psr-4": { - "Infection\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Maks Rafalko", - "email": "maks.rafalko@gmail.com", - "homepage": "https://twitter.com/maks_rafalko" - }, - { - "name": "Oleg Zhulnev", - "homepage": "https://github.com/sidz" - }, - { - "name": "Gert de Pagter", - "homepage": "https://github.com/BackEndTea" - }, - { - "name": "Théo FIDRY", - "email": "theo.fidry@gmail.com", - "homepage": "https://twitter.com/tfidry" - }, - { - "name": "Alexey Kopytko", - "email": "alexey@kopytko.com", - "homepage": "https://www.alexeykopytko.com" - }, - { - "name": "Andreas Möller", - "email": "am@localheinz.com", - "homepage": "https://localheinz.com" - } - ], - "description": "Infection is a Mutation Testing framework for PHP. The mutation adequacy score can be used to measure the effectiveness of a test set in terms of its ability to detect faults.", - "keywords": [ - "coverage", - "mutant", - "mutation framework", - "mutation testing", - "testing", - "unit testing" - ], - "support": { - "issues": "https://github.com/infection/infection/issues", - "source": "https://github.com/infection/infection/tree/0.26.20" - }, - "funding": [ - { - "url": "https://github.com/infection", - "type": "github" - }, - { - "url": "https://opencollective.com/infection", - "type": "open_collective" - } - ], - "time": "2023-04-14T21:39:46+00:00" - }, - { - "name": "justinrainbow/json-schema", - "version": "5.2.12", - "source": { - "type": "git", - "url": "https://github.com/justinrainbow/json-schema.git", - "reference": "ad87d5a5ca981228e0e205c2bc7dfb8e24559b60" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/justinrainbow/json-schema/zipball/ad87d5a5ca981228e0e205c2bc7dfb8e24559b60", - "reference": "ad87d5a5ca981228e0e205c2bc7dfb8e24559b60", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "require-dev": { - "friendsofphp/php-cs-fixer": "~2.2.20||~2.15.1", - "json-schema/json-schema-test-suite": "1.2.0", - "phpunit/phpunit": "^4.8.35" - }, - "bin": [ - "bin/validate-json" - ], - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "5.0.x-dev" - } - }, - "autoload": { - "psr-4": { - "JsonSchema\\": "src/JsonSchema/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Bruno Prieto Reis", - "email": "bruno.p.reis@gmail.com" - }, - { - "name": "Justin Rainbow", - "email": "justin.rainbow@gmail.com" - }, - { - "name": "Igor Wiedler", - "email": "igor@wiedler.ch" - }, - { - "name": "Robert Schönthal", - "email": "seroscho@googlemail.com" - } - ], - "description": "A library to validate a json schema.", - "homepage": "https://github.com/justinrainbow/json-schema", - "keywords": [ - "json", - "schema" - ], - "support": { - "issues": "https://github.com/justinrainbow/json-schema/issues", - "source": "https://github.com/justinrainbow/json-schema/tree/5.2.12" - }, - "time": "2022-04-13T08:02:27+00:00" - }, - { - "name": "laravel/serializable-closure", - "version": "v1.3.0", - "source": { - "type": "git", - "url": "https://github.com/laravel/serializable-closure.git", - "reference": "f23fe9d4e95255dacee1bf3525e0810d1a1b0f37" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/laravel/serializable-closure/zipball/f23fe9d4e95255dacee1bf3525e0810d1a1b0f37", - "reference": "f23fe9d4e95255dacee1bf3525e0810d1a1b0f37", - "shasum": "" - }, - "require": { - "php": "^7.3|^8.0" - }, - "require-dev": { - "nesbot/carbon": "^2.61", - "pestphp/pest": "^1.21.3", - "phpstan/phpstan": "^1.8.2", - "symfony/var-dumper": "^5.4.11" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.x-dev" - } - }, - "autoload": { - "psr-4": { - "Laravel\\SerializableClosure\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Taylor Otwell", - "email": "taylor@laravel.com" - }, - { - "name": "Nuno Maduro", - "email": "nuno@laravel.com" - } - ], - "description": "Laravel Serializable Closure provides an easy and secure way to serialize closures in PHP.", - "keywords": [ - "closure", - "laravel", - "serializable" - ], - "support": { - "issues": "https://github.com/laravel/serializable-closure/issues", - "source": "https://github.com/laravel/serializable-closure" - }, - "time": "2023-01-30T18:31:20+00:00" - }, - { - "name": "myclabs/deep-copy", - "version": "1.11.1", - "source": { - "type": "git", - "url": "https://github.com/myclabs/DeepCopy.git", - "reference": "7284c22080590fb39f2ffa3e9057f10a4ddd0e0c" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/7284c22080590fb39f2ffa3e9057f10a4ddd0e0c", - "reference": "7284c22080590fb39f2ffa3e9057f10a4ddd0e0c", - "shasum": "" - }, - "require": { - "php": "^7.1 || ^8.0" - }, - "conflict": { - "doctrine/collections": "<1.6.8", - "doctrine/common": "<2.13.3 || >=3,<3.2.2" - }, - "require-dev": { - "doctrine/collections": "^1.6.8", - "doctrine/common": "^2.13.3 || ^3.2.2", - "phpunit/phpunit": "^7.5.20 || ^8.5.23 || ^9.5.13" - }, - "type": "library", - "autoload": { - "files": [ - "src/DeepCopy/deep_copy.php" - ], - "psr-4": { - "DeepCopy\\": "src/DeepCopy/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "description": "Create deep copies (clones) of your objects", - "keywords": [ - "clone", - "copy", - "duplicate", - "object", - "object graph" - ], - "support": { - "issues": "https://github.com/myclabs/DeepCopy/issues", - "source": "https://github.com/myclabs/DeepCopy/tree/1.11.1" - }, - "funding": [ - { - "url": "https://tidelift.com/funding/github/packagist/myclabs/deep-copy", - "type": "tidelift" - } - ], - "time": "2023-03-08T13:26:56+00:00" - }, - { - "name": "netresearch/jsonmapper", - "version": "v4.2.0", - "source": { - "type": "git", - "url": "https://github.com/cweiske/jsonmapper.git", - "reference": "f60565f8c0566a31acf06884cdaa591867ecc956" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/cweiske/jsonmapper/zipball/f60565f8c0566a31acf06884cdaa591867ecc956", - "reference": "f60565f8c0566a31acf06884cdaa591867ecc956", - "shasum": "" - }, - "require": { - "ext-json": "*", - "ext-pcre": "*", - "ext-reflection": "*", - "ext-spl": "*", - "php": ">=7.1" - }, - "require-dev": { - "phpunit/phpunit": "~7.5 || ~8.0 || ~9.0", - "squizlabs/php_codesniffer": "~3.5" - }, - "type": "library", - "autoload": { - "psr-0": { - "JsonMapper": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "OSL-3.0" - ], - "authors": [ - { - "name": "Christian Weiske", - "email": "cweiske@cweiske.de", - "homepage": "http://github.com/cweiske/jsonmapper/", - "role": "Developer" - } - ], - "description": "Map nested JSON structures onto PHP classes", - "support": { - "email": "cweiske@cweiske.de", - "issues": "https://github.com/cweiske/jsonmapper/issues", - "source": "https://github.com/cweiske/jsonmapper/tree/v4.2.0" - }, - "time": "2023-04-09T17:37:40+00:00" - }, - { - "name": "nikic/iter", - "version": "v2.2.0", - "source": { - "type": "git", - "url": "https://github.com/nikic/iter.git", - "reference": "d1323929952ddcb0b06439991f93bde3816a39e9" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/nikic/iter/zipball/d1323929952ddcb0b06439991f93bde3816a39e9", - "reference": "d1323929952ddcb0b06439991f93bde3816a39e9", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "require-dev": { - "phpunit/phpunit": "^7.0 || ^8.0 || ^9.0" - }, - "type": "library", - "autoload": { - "files": [ - "src/iter.func.php", - "src/iter.php", - "src/iter.rewindable.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Nikita Popov", - "email": "nikic@php.net" - } - ], - "description": "Iteration primitives using generators", - "keywords": [ - "functional", - "generator", - "iterator" - ], - "support": { - "issues": "https://github.com/nikic/iter/issues", - "source": "https://github.com/nikic/iter/tree/v2.2.0" - }, - "time": "2021-08-02T15:04:32+00:00" - }, - { - "name": "ocramius/package-versions", - "version": "2.7.0", - "source": { - "type": "git", - "url": "https://github.com/Ocramius/PackageVersions.git", - "reference": "065921ed7cb2a6861443d91138d0a4378316af8d" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/Ocramius/PackageVersions/zipball/065921ed7cb2a6861443d91138d0a4378316af8d", - "reference": "065921ed7cb2a6861443d91138d0a4378316af8d", - "shasum": "" - }, - "require": { - "composer-runtime-api": "^2.2.0", - "php": "~8.1.0 || ~8.2.0" - }, - "replace": { - "composer/package-versions-deprecated": "*" - }, - "require-dev": { - "composer/composer": "^2.4.4", - "doctrine/coding-standard": "^10.0.0", - "ext-zip": "^1.15.0", - "phpunit/phpunit": "^9.5.26", - "roave/infection-static-analysis-plugin": "^1.25.0", - "vimeo/psalm": "^4.29.0" - }, - "type": "library", - "autoload": { - "psr-4": { - "PackageVersions\\": "src/PackageVersions" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Marco Pivetta", - "email": "ocramius@gmail.com" - } - ], - "description": "Provides efficient querying for installed package versions (no runtime IO)", - "support": { - "issues": "https://github.com/Ocramius/PackageVersions/issues", - "source": "https://github.com/Ocramius/PackageVersions/tree/2.7.0" - }, - "funding": [ - { - "url": "https://github.com/Ocramius", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/ocramius/package-versions", - "type": "tidelift" - } - ], - "time": "2022-10-31T12:51:46+00:00" - }, - { - "name": "ondram/ci-detector", - "version": "4.1.0", - "source": { - "type": "git", - "url": "https://github.com/OndraM/ci-detector.git", - "reference": "8a4b664e916df82ff26a44709942dfd593fa6f30" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/OndraM/ci-detector/zipball/8a4b664e916df82ff26a44709942dfd593fa6f30", - "reference": "8a4b664e916df82ff26a44709942dfd593fa6f30", - "shasum": "" - }, - "require": { - "php": "^7.1 || ^8.0" - }, - "require-dev": { - "ergebnis/composer-normalize": "^2.2", - "lmc/coding-standard": "^1.3 || ^2.1", - "php-parallel-lint/php-parallel-lint": "^1.2", - "phpstan/extension-installer": "^1.0.5", - "phpstan/phpstan": "^0.12.58", - "phpstan/phpstan-phpunit": "^0.12.16", - "phpunit/phpunit": "^7.1 || ^8.0 || ^9.0" - }, - "type": "library", - "autoload": { - "psr-4": { - "OndraM\\CiDetector\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Ondřej Machulda", - "email": "ondrej.machulda@gmail.com" - } - ], - "description": "Detect continuous integration environment and provide unified access to properties of current build", - "keywords": [ - "CircleCI", - "Codeship", - "Wercker", - "adapter", - "appveyor", - "aws", - "aws codebuild", - "azure", - "azure devops", - "azure pipelines", - "bamboo", - "bitbucket", - "buddy", - "ci-info", - "codebuild", - "continuous integration", - "continuousphp", - "devops", - "drone", - "github", - "gitlab", - "interface", - "jenkins", - "pipelines", - "sourcehut", - "teamcity", - "travis" - ], - "support": { - "issues": "https://github.com/OndraM/ci-detector/issues", - "source": "https://github.com/OndraM/ci-detector/tree/4.1.0" - }, - "time": "2021-04-14T09:16:52+00:00" - }, - { - "name": "openlss/lib-array2xml", - "version": "1.0.0", - "source": { - "type": "git", - "url": "https://github.com/nullivex/lib-array2xml.git", - "reference": "a91f18a8dfc69ffabe5f9b068bc39bb202c81d90" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/nullivex/lib-array2xml/zipball/a91f18a8dfc69ffabe5f9b068bc39bb202c81d90", - "reference": "a91f18a8dfc69ffabe5f9b068bc39bb202c81d90", - "shasum": "" - }, - "require": { - "php": ">=5.3.2" - }, - "type": "library", - "autoload": { - "psr-0": { - "LSS": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "Apache-2.0" - ], - "authors": [ - { - "name": "Bryan Tong", - "email": "bryan@nullivex.com", - "homepage": "https://www.nullivex.com" - }, - { - "name": "Tony Butler", - "email": "spudz76@gmail.com", - "homepage": "https://www.nullivex.com" - } - ], - "description": "Array2XML conversion library credit to lalit.org", - "homepage": "https://www.nullivex.com", - "keywords": [ - "array", - "array conversion", - "xml", - "xml conversion" - ], - "support": { - "issues": "https://github.com/nullivex/lib-array2xml/issues", - "source": "https://github.com/nullivex/lib-array2xml/tree/master" - }, - "time": "2019-03-29T20:06:56+00:00" - }, - { - "name": "paragonie/constant_time_encoding", - "version": "v2.6.3", - "source": { - "type": "git", - "url": "https://github.com/paragonie/constant_time_encoding.git", - "reference": "58c3f47f650c94ec05a151692652a868995d2938" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/paragonie/constant_time_encoding/zipball/58c3f47f650c94ec05a151692652a868995d2938", - "reference": "58c3f47f650c94ec05a151692652a868995d2938", - "shasum": "" - }, - "require": { - "php": "^7|^8" - }, - "require-dev": { - "phpunit/phpunit": "^6|^7|^8|^9", - "vimeo/psalm": "^1|^2|^3|^4" - }, - "type": "library", - "autoload": { - "psr-4": { - "ParagonIE\\ConstantTime\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Paragon Initiative Enterprises", - "email": "security@paragonie.com", - "homepage": "https://paragonie.com", - "role": "Maintainer" - }, - { - "name": "Steve 'Sc00bz' Thomas", - "email": "steve@tobtu.com", - "homepage": "https://www.tobtu.com", - "role": "Original Developer" - } - ], - "description": "Constant-time Implementations of RFC 4648 Encoding (Base-64, Base-32, Base-16)", - "keywords": [ - "base16", - "base32", - "base32_decode", - "base32_encode", - "base64", - "base64_decode", - "base64_encode", - "bin2hex", - "encoding", - "hex", - "hex2bin", - "rfc4648" - ], - "support": { - "email": "info@paragonie.com", - "issues": "https://github.com/paragonie/constant_time_encoding/issues", - "source": "https://github.com/paragonie/constant_time_encoding" - }, - "time": "2022-06-14T06:56:20+00:00" - }, - { - "name": "phar-io/manifest", - "version": "2.0.3", - "source": { - "type": "git", - "url": "https://github.com/phar-io/manifest.git", - "reference": "97803eca37d319dfa7826cc2437fc020857acb53" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phar-io/manifest/zipball/97803eca37d319dfa7826cc2437fc020857acb53", - "reference": "97803eca37d319dfa7826cc2437fc020857acb53", - "shasum": "" - }, - "require": { - "ext-dom": "*", - "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.3" - }, - "time": "2021-07-20T11:28:43+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": "phpdocumentor/reflection-docblock", - "version": "5.3.0", - "source": { - "type": "git", - "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", - "reference": "622548b623e81ca6d78b721c5e029f4ce664f170" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/622548b623e81ca6d78b721c5e029f4ce664f170", - "reference": "622548b623e81ca6d78b721c5e029f4ce664f170", - "shasum": "" - }, - "require": { - "ext-filter": "*", - "php": "^7.2 || ^8.0", - "phpdocumentor/reflection-common": "^2.2", - "phpdocumentor/type-resolver": "^1.3", - "webmozart/assert": "^1.9.1" - }, - "require-dev": { - "mockery/mockery": "~1.3.2", - "psalm/phar": "^4.8" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "5.x-dev" - } - }, - "autoload": { - "psr-4": { - "phpDocumentor\\Reflection\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Mike van Riel", - "email": "me@mikevanriel.com" - }, - { - "name": "Jaap van Otterdijk", - "email": "account@ijaap.nl" - } - ], - "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.", - "support": { - "issues": "https://github.com/phpDocumentor/ReflectionDocBlock/issues", - "source": "https://github.com/phpDocumentor/ReflectionDocBlock/tree/5.3.0" - }, - "time": "2021-10-19T17:43:47+00:00" - }, - { - "name": "phpstan/phpstan", - "version": "1.10.14", - "source": { - "type": "git", - "url": "https://github.com/phpstan/phpstan.git", - "reference": "d232901b09e67538e5c86a724be841bea5768a7c" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan/zipball/d232901b09e67538e5c86a724be841bea5768a7c", - "reference": "d232901b09e67538e5c86a724be841bea5768a7c", - "shasum": "" - }, - "require": { - "php": "^7.2|^8.0" - }, - "conflict": { - "phpstan/phpstan-shim": "*" - }, - "bin": [ - "phpstan", - "phpstan.phar" - ], - "type": "library", - "autoload": { - "files": [ - "bootstrap.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "description": "PHPStan - PHP Static Analysis Tool", - "keywords": [ - "dev", - "static analysis" - ], - "support": { - "docs": "https://phpstan.org/user-guide/getting-started", - "forum": "https://github.com/phpstan/phpstan/discussions", - "issues": "https://github.com/phpstan/phpstan/issues", - "security": "https://github.com/phpstan/phpstan/security/policy", - "source": "https://github.com/phpstan/phpstan-src" - }, - "funding": [ - { - "url": "https://github.com/ondrejmirtes", - "type": "github" - }, - { - "url": "https://github.com/phpstan", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/phpstan/phpstan", - "type": "tidelift" - } - ], - "time": "2023-04-19T13:47:27+00:00" - }, - { - "name": "phpstan/phpstan-symfony", - "version": "1.3.1", - "source": { - "type": "git", - "url": "https://github.com/phpstan/phpstan-symfony.git", - "reference": "7e78605a699d183f5a6936cf91904f4c16ca79b2" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan-symfony/zipball/7e78605a699d183f5a6936cf91904f4c16ca79b2", - "reference": "7e78605a699d183f5a6936cf91904f4c16ca79b2", - "shasum": "" - }, - "require": { - "ext-simplexml": "*", - "php": "^7.2 || ^8.0", - "phpstan/phpstan": "^1.9.18" - }, - "conflict": { - "symfony/framework-bundle": "<3.0" - }, - "require-dev": { - "nikic/php-parser": "^4.13.0", - "php-parallel-lint/php-parallel-lint": "^1.2", - "phpstan/phpstan-phpunit": "^1.0", - "phpstan/phpstan-strict-rules": "^1.0", - "phpunit/phpunit": "^8.5.29 || ^9.5", - "psr/container": "1.0 || 1.1.1", - "symfony/config": "^5.4 || ^6.1", - "symfony/console": "^5.4 || ^6.1", - "symfony/dependency-injection": "^5.4 || ^6.1", - "symfony/form": "^5.4 || ^6.1", - "symfony/framework-bundle": "^5.4 || ^6.1", - "symfony/http-foundation": "^5.4 || ^6.1", - "symfony/messenger": "^5.4", - "symfony/polyfill-php80": "^1.24", - "symfony/serializer": "^5.4" - }, - "type": "phpstan-extension", - "extra": { - "phpstan": { - "includes": [ - "extension.neon", - "rules.neon" - ] - } - }, - "autoload": { - "psr-4": { - "PHPStan\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Lukáš Unger", - "email": "looky.msc@gmail.com", - "homepage": "https://lookyman.net" - } - ], - "description": "Symfony Framework extensions and rules for PHPStan", - "support": { - "issues": "https://github.com/phpstan/phpstan-symfony/issues", - "source": "https://github.com/phpstan/phpstan-symfony/tree/1.3.1" - }, - "time": "2023-04-14T16:59:18+00:00" - }, - { - "name": "phpunit/php-code-coverage", - "version": "9.2.26", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "443bc6912c9bd5b409254a40f4b0f4ced7c80ea1" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/443bc6912c9bd5b409254a40f4b0f4ced7c80ea1", - "reference": "443bc6912c9bd5b409254a40f4b0f4ced7c80ea1", - "shasum": "" - }, - "require": { - "ext-dom": "*", - "ext-libxml": "*", - "ext-xmlwriter": "*", - "nikic/php-parser": "^4.15", - "php": ">=7.3", - "phpunit/php-file-iterator": "^3.0.3", - "phpunit/php-text-template": "^2.0.2", - "sebastian/code-unit-reverse-lookup": "^2.0.2", - "sebastian/complexity": "^2.0", - "sebastian/environment": "^5.1.2", - "sebastian/lines-of-code": "^1.0.3", - "sebastian/version": "^3.0.1", - "theseer/tokenizer": "^1.2.0" - }, - "require-dev": { - "phpunit/phpunit": "^9.3" - }, - "suggest": { - "ext-pcov": "PHP extension that provides line coverage", - "ext-xdebug": "PHP extension that provides line coverage as well as branch and path coverage" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "9.2-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "description": "Library that provides collection, processing, and rendering functionality for PHP code coverage information.", - "homepage": "https://github.com/sebastianbergmann/php-code-coverage", - "keywords": [ - "coverage", - "testing", - "xunit" - ], - "support": { - "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues", - "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.26" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2023-03-06T12:58:08+00:00" - }, - { - "name": "phpunit/php-file-iterator", - "version": "3.0.6", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-file-iterator.git", - "reference": "cf1c2e7c203ac650e352f4cc675a7021e7d1b3cf" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/cf1c2e7c203ac650e352f4cc675a7021e7d1b3cf", - "reference": "cf1c2e7c203ac650e352f4cc675a7021e7d1b3cf", - "shasum": "" - }, - "require": { - "php": ">=7.3" - }, - "require-dev": { - "phpunit/phpunit": "^9.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "description": "FilterIterator implementation that filters files based on a list of suffixes.", - "homepage": "https://github.com/sebastianbergmann/php-file-iterator/", - "keywords": [ - "filesystem", - "iterator" - ], - "support": { - "issues": "https://github.com/sebastianbergmann/php-file-iterator/issues", - "source": "https://github.com/sebastianbergmann/php-file-iterator/tree/3.0.6" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2021-12-02T12:48:52+00:00" - }, - { - "name": "phpunit/php-invoker", - "version": "3.1.1", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-invoker.git", - "reference": "5a10147d0aaf65b58940a0b72f71c9ac0423cc67" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-invoker/zipball/5a10147d0aaf65b58940a0b72f71c9ac0423cc67", - "reference": "5a10147d0aaf65b58940a0b72f71c9ac0423cc67", - "shasum": "" - }, - "require": { - "php": ">=7.3" - }, - "require-dev": { - "ext-pcntl": "*", - "phpunit/phpunit": "^9.3" - }, - "suggest": { - "ext-pcntl": "*" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.1-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "description": "Invoke callables with a timeout", - "homepage": "https://github.com/sebastianbergmann/php-invoker/", - "keywords": [ - "process" - ], - "support": { - "issues": "https://github.com/sebastianbergmann/php-invoker/issues", - "source": "https://github.com/sebastianbergmann/php-invoker/tree/3.1.1" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2020-09-28T05:58:55+00:00" - }, - { - "name": "phpunit/php-text-template", - "version": "2.0.4", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-text-template.git", - "reference": "5da5f67fc95621df9ff4c4e5a84d6a8a2acf7c28" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/5da5f67fc95621df9ff4c4e5a84d6a8a2acf7c28", - "reference": "5da5f67fc95621df9ff4c4e5a84d6a8a2acf7c28", - "shasum": "" - }, - "require": { - "php": ">=7.3" - }, - "require-dev": { - "phpunit/phpunit": "^9.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "description": "Simple template engine.", - "homepage": "https://github.com/sebastianbergmann/php-text-template/", - "keywords": [ - "template" - ], - "support": { - "issues": "https://github.com/sebastianbergmann/php-text-template/issues", - "source": "https://github.com/sebastianbergmann/php-text-template/tree/2.0.4" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2020-10-26T05:33:50+00:00" - }, - { - "name": "phpunit/php-timer", - "version": "5.0.3", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-timer.git", - "reference": "5a63ce20ed1b5bf577850e2c4e87f4aa902afbd2" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/5a63ce20ed1b5bf577850e2c4e87f4aa902afbd2", - "reference": "5a63ce20ed1b5bf577850e2c4e87f4aa902afbd2", - "shasum": "" - }, - "require": { - "php": ">=7.3" - }, - "require-dev": { - "phpunit/phpunit": "^9.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "5.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "description": "Utility class for timing", - "homepage": "https://github.com/sebastianbergmann/php-timer/", - "keywords": [ - "timer" - ], - "support": { - "issues": "https://github.com/sebastianbergmann/php-timer/issues", - "source": "https://github.com/sebastianbergmann/php-timer/tree/5.0.3" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2020-10-26T13:16:10+00:00" - }, - { - "name": "phpunit/phpunit", - "version": "9.6.7", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "c993f0d3b0489ffc42ee2fe0bd645af1538a63b2" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/c993f0d3b0489ffc42ee2fe0bd645af1538a63b2", - "reference": "c993f0d3b0489ffc42ee2fe0bd645af1538a63b2", - "shasum": "" - }, - "require": { - "doctrine/instantiator": "^1.3.1 || ^2", - "ext-dom": "*", - "ext-json": "*", - "ext-libxml": "*", - "ext-mbstring": "*", - "ext-xml": "*", - "ext-xmlwriter": "*", - "myclabs/deep-copy": "^1.10.1", - "phar-io/manifest": "^2.0.3", - "phar-io/version": "^3.0.2", - "php": ">=7.3", - "phpunit/php-code-coverage": "^9.2.13", - "phpunit/php-file-iterator": "^3.0.5", - "phpunit/php-invoker": "^3.1.1", - "phpunit/php-text-template": "^2.0.3", - "phpunit/php-timer": "^5.0.2", - "sebastian/cli-parser": "^1.0.1", - "sebastian/code-unit": "^1.0.6", - "sebastian/comparator": "^4.0.8", - "sebastian/diff": "^4.0.3", - "sebastian/environment": "^5.1.3", - "sebastian/exporter": "^4.0.5", - "sebastian/global-state": "^5.0.1", - "sebastian/object-enumerator": "^4.0.3", - "sebastian/resource-operations": "^3.0.3", - "sebastian/type": "^3.2", - "sebastian/version": "^3.0.2" - }, - "suggest": { - "ext-soap": "To be able to generate mocks based on WSDL files", - "ext-xdebug": "PHP extension that provides line coverage as well as branch and path coverage" - }, - "bin": [ - "phpunit" - ], - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "9.6-dev" - } - }, - "autoload": { - "files": [ - "src/Framework/Assert/Functions.php" - ], - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "description": "The PHP Unit Testing framework.", - "homepage": "https://phpunit.de/", - "keywords": [ - "phpunit", - "testing", - "xunit" - ], - "support": { - "issues": "https://github.com/sebastianbergmann/phpunit/issues", - "security": "https://github.com/sebastianbergmann/phpunit/security/policy", - "source": "https://github.com/sebastianbergmann/phpunit/tree/9.6.7" - }, - "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": "2023-04-14T08:58:40+00:00" - }, - { - "name": "psr/cache", - "version": "3.0.0", - "source": { - "type": "git", - "url": "https://github.com/php-fig/cache.git", - "reference": "aa5030cfa5405eccfdcb1083ce040c2cb8d253bf" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-fig/cache/zipball/aa5030cfa5405eccfdcb1083ce040c2cb8d253bf", - "reference": "aa5030cfa5405eccfdcb1083ce040c2cb8d253bf", - "shasum": "" - }, - "require": { - "php": ">=8.0.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "autoload": { - "psr-4": { - "Psr\\Cache\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "PHP-FIG", - "homepage": "https://www.php-fig.org/" - } - ], - "description": "Common interface for caching libraries", - "keywords": [ - "cache", - "psr", - "psr-6" - ], - "support": { - "source": "https://github.com/php-fig/cache/tree/3.0.0" - }, - "time": "2021-02-03T23:26:27+00:00" - }, - { - "name": "rector/rector", - "version": "0.15.25", - "source": { - "type": "git", - "url": "https://github.com/rectorphp/rector.git", - "reference": "015935c7ed9e48a4f5895ba974f337e20a263841" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/rectorphp/rector/zipball/015935c7ed9e48a4f5895ba974f337e20a263841", - "reference": "015935c7ed9e48a4f5895ba974f337e20a263841", - "shasum": "" - }, - "require": { - "php": "^7.2|^8.0", - "phpstan/phpstan": "^1.10.14" - }, - "conflict": { - "rector/rector-doctrine": "*", - "rector/rector-downgrade-php": "*", - "rector/rector-phpunit": "*", - "rector/rector-symfony": "*" - }, - "bin": [ - "bin/rector" - ], - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "0.15-dev" - } - }, - "autoload": { - "files": [ - "bootstrap.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "description": "Instant Upgrade and Automated Refactoring of any PHP code", - "keywords": [ - "automation", - "dev", - "migration", - "refactoring" - ], - "support": { - "issues": "https://github.com/rectorphp/rector/issues", - "source": "https://github.com/rectorphp/rector/tree/0.15.25" - }, - "funding": [ - { - "url": "https://github.com/tomasvotruba", - "type": "github" - } - ], - "time": "2023-04-20T16:07:39+00:00" - }, - { - "name": "roave/infection-static-analysis-plugin", - "version": "1.30.0", - "source": { - "type": "git", - "url": "https://github.com/Roave/infection-static-analysis-plugin.git", - "reference": "23579f3f35262daa26ae3b2133212393f4bd8d36" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/Roave/infection-static-analysis-plugin/zipball/23579f3f35262daa26ae3b2133212393f4bd8d36", - "reference": "23579f3f35262daa26ae3b2133212393f4bd8d36", - "shasum": "" - }, - "require": { - "infection/infection": "0.26.20", - "ocramius/package-versions": "^2.7.0", - "php": "~8.1.0 || ~8.2.0", - "sanmai/later": "^0.1.2", - "vimeo/psalm": "^4.30.0 || ^5.0.0" - }, - "require-dev": { - "doctrine/coding-standard": "^11.1.0", - "phpunit/phpunit": "^10.1.0" - }, - "bin": [ - "bin/roave-infection-static-analysis-plugin" - ], - "type": "library", - "autoload": { - "psr-4": { - "Roave\\InfectionStaticAnalysis\\": "src/Roave/InfectionStaticAnalysis" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Marco Pivetta", - "email": "ocramius@gmail.com" - } - ], - "description": "Static analysis on top of mutation testing - prevents escaped mutants from being invalid according to static analysis", - "support": { - "issues": "https://github.com/Roave/infection-static-analysis-plugin/issues", - "source": "https://github.com/Roave/infection-static-analysis-plugin/tree/1.30.0" - }, - "time": "2023-04-16T17:22:34+00:00" - }, - { - "name": "sanmai/later", - "version": "0.1.2", - "source": { - "type": "git", - "url": "https://github.com/sanmai/later.git", - "reference": "9b659fecef2030193fd02402955bc39629d5606f" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sanmai/later/zipball/9b659fecef2030193fd02402955bc39629d5606f", - "reference": "9b659fecef2030193fd02402955bc39629d5606f", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "require-dev": { - "friendsofphp/php-cs-fixer": "^2.13", - "infection/infection": ">=0.10.5", - "phan/phan": ">=2", - "php-coveralls/php-coveralls": "^2.0", - "phpstan/phpstan": ">=0.10", - "phpunit/phpunit": ">=7.4", - "vimeo/psalm": ">=2" - }, - "type": "library", - "autoload": { - "files": [ - "src/functions.php" - ], - "psr-4": { - "Later\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "Apache-2.0" - ], - "authors": [ - { - "name": "Alexey Kopytko", - "email": "alexey@kopytko.com" - } - ], - "description": "Later: deferred wrapper object", - "support": { - "issues": "https://github.com/sanmai/later/issues", - "source": "https://github.com/sanmai/later/tree/0.1.2" - }, - "funding": [ - { - "url": "https://github.com/sanmai", - "type": "github" - } - ], - "time": "2021-01-02T10:26:44+00:00" - }, - { - "name": "sanmai/pipeline", - "version": "v6.7", - "source": { - "type": "git", - "url": "https://github.com/sanmai/pipeline.git", - "reference": "0e5c45c8046298212347a0bfb659126af8e75d2e" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sanmai/pipeline/zipball/0e5c45c8046298212347a0bfb659126af8e75d2e", - "reference": "0e5c45c8046298212347a0bfb659126af8e75d2e", - "shasum": "" - }, - "require": { - "php": "^7.4 || ^8.0" - }, - "require-dev": { - "ergebnis/composer-normalize": "^2.8", - "friendsofphp/php-cs-fixer": "^3", - "infection/infection": ">=0.10.5", - "league/pipeline": "^0.3 || ^1.0", - "phan/phan": ">=1.1", - "php-coveralls/php-coveralls": "^2.4.1", - "phpstan/phpstan": ">=0.10", - "phpunit/phpunit": ">=9.4", - "vimeo/psalm": ">=2" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "v6.x-dev" - } - }, - "autoload": { - "files": [ - "src/functions.php" - ], - "psr-4": { - "Pipeline\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "Apache-2.0" - ], - "authors": [ - { - "name": "Alexey Kopytko", - "email": "alexey@kopytko.com" - } - ], - "description": "General-purpose collections pipeline", - "support": { - "issues": "https://github.com/sanmai/pipeline/issues", - "source": "https://github.com/sanmai/pipeline/tree/v6.7" - }, - "funding": [ - { - "url": "https://github.com/sanmai", - "type": "github" - } - ], - "time": "2023-04-29T11:21:51+00:00" - }, - { - "name": "sebastian/cli-parser", - "version": "1.0.1", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/cli-parser.git", - "reference": "442e7c7e687e42adc03470c7b668bc4b2402c0b2" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/cli-parser/zipball/442e7c7e687e42adc03470c7b668bc4b2402c0b2", - "reference": "442e7c7e687e42adc03470c7b668bc4b2402c0b2", - "shasum": "" - }, - "require": { - "php": ">=7.3" - }, - "require-dev": { - "phpunit/phpunit": "^9.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "description": "Library for parsing CLI options", - "homepage": "https://github.com/sebastianbergmann/cli-parser", - "support": { - "issues": "https://github.com/sebastianbergmann/cli-parser/issues", - "source": "https://github.com/sebastianbergmann/cli-parser/tree/1.0.1" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2020-09-28T06:08:49+00:00" - }, - { - "name": "sebastian/code-unit", - "version": "1.0.8", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/code-unit.git", - "reference": "1fc9f64c0927627ef78ba436c9b17d967e68e120" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/code-unit/zipball/1fc9f64c0927627ef78ba436c9b17d967e68e120", - "reference": "1fc9f64c0927627ef78ba436c9b17d967e68e120", - "shasum": "" - }, - "require": { - "php": ">=7.3" - }, - "require-dev": { - "phpunit/phpunit": "^9.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "description": "Collection of value objects that represent the PHP code units", - "homepage": "https://github.com/sebastianbergmann/code-unit", - "support": { - "issues": "https://github.com/sebastianbergmann/code-unit/issues", - "source": "https://github.com/sebastianbergmann/code-unit/tree/1.0.8" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2020-10-26T13:08:54+00:00" - }, - { - "name": "sebastian/code-unit-reverse-lookup", - "version": "2.0.3", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/code-unit-reverse-lookup.git", - "reference": "ac91f01ccec49fb77bdc6fd1e548bc70f7faa3e5" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/ac91f01ccec49fb77bdc6fd1e548bc70f7faa3e5", - "reference": "ac91f01ccec49fb77bdc6fd1e548bc70f7faa3e5", - "shasum": "" - }, - "require": { - "php": ">=7.3" - }, - "require-dev": { - "phpunit/phpunit": "^9.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Looks up which function or method a line of code belongs to", - "homepage": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/", - "support": { - "issues": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/issues", - "source": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/tree/2.0.3" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2020-09-28T05:30:19+00:00" - }, - { - "name": "sebastian/comparator", - "version": "4.0.8", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/comparator.git", - "reference": "fa0f136dd2334583309d32b62544682ee972b51a" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/fa0f136dd2334583309d32b62544682ee972b51a", - "reference": "fa0f136dd2334583309d32b62544682ee972b51a", - "shasum": "" - }, - "require": { - "php": ">=7.3", - "sebastian/diff": "^4.0", - "sebastian/exporter": "^4.0" - }, - "require-dev": { - "phpunit/phpunit": "^9.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "4.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - }, - { - "name": "Jeff Welch", - "email": "whatthejeff@gmail.com" - }, - { - "name": "Volker Dusch", - "email": "github@wallbash.com" - }, - { - "name": "Bernhard Schussek", - "email": "bschussek@2bepublished.at" - } - ], - "description": "Provides the functionality to compare PHP values for equality", - "homepage": "https://github.com/sebastianbergmann/comparator", - "keywords": [ - "comparator", - "compare", - "equality" - ], - "support": { - "issues": "https://github.com/sebastianbergmann/comparator/issues", - "source": "https://github.com/sebastianbergmann/comparator/tree/4.0.8" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2022-09-14T12:41:17+00:00" - }, - { - "name": "sebastian/complexity", - "version": "2.0.2", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/complexity.git", - "reference": "739b35e53379900cc9ac327b2147867b8b6efd88" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/complexity/zipball/739b35e53379900cc9ac327b2147867b8b6efd88", - "reference": "739b35e53379900cc9ac327b2147867b8b6efd88", - "shasum": "" - }, - "require": { - "nikic/php-parser": "^4.7", - "php": ">=7.3" - }, - "require-dev": { - "phpunit/phpunit": "^9.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "description": "Library for calculating the complexity of PHP code units", - "homepage": "https://github.com/sebastianbergmann/complexity", - "support": { - "issues": "https://github.com/sebastianbergmann/complexity/issues", - "source": "https://github.com/sebastianbergmann/complexity/tree/2.0.2" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2020-10-26T15:52:27+00:00" - }, - { - "name": "sebastian/diff", - "version": "4.0.4", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/diff.git", - "reference": "3461e3fccc7cfdfc2720be910d3bd73c69be590d" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/3461e3fccc7cfdfc2720be910d3bd73c69be590d", - "reference": "3461e3fccc7cfdfc2720be910d3bd73c69be590d", - "shasum": "" - }, - "require": { - "php": ">=7.3" - }, - "require-dev": { - "phpunit/phpunit": "^9.3", - "symfony/process": "^4.2 || ^5" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "4.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - }, - { - "name": "Kore Nordmann", - "email": "mail@kore-nordmann.de" - } - ], - "description": "Diff implementation", - "homepage": "https://github.com/sebastianbergmann/diff", - "keywords": [ - "diff", - "udiff", - "unidiff", - "unified diff" - ], - "support": { - "issues": "https://github.com/sebastianbergmann/diff/issues", - "source": "https://github.com/sebastianbergmann/diff/tree/4.0.4" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2020-10-26T13:10:38+00:00" - }, - { - "name": "sebastian/environment", - "version": "5.1.5", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/environment.git", - "reference": "830c43a844f1f8d5b7a1f6d6076b784454d8b7ed" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/830c43a844f1f8d5b7a1f6d6076b784454d8b7ed", - "reference": "830c43a844f1f8d5b7a1f6d6076b784454d8b7ed", - "shasum": "" - }, - "require": { - "php": ">=7.3" - }, - "require-dev": { - "phpunit/phpunit": "^9.3" - }, - "suggest": { - "ext-posix": "*" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "5.1-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Provides functionality to handle HHVM/PHP environments", - "homepage": "http://www.github.com/sebastianbergmann/environment", - "keywords": [ - "Xdebug", - "environment", - "hhvm" - ], - "support": { - "issues": "https://github.com/sebastianbergmann/environment/issues", - "source": "https://github.com/sebastianbergmann/environment/tree/5.1.5" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2023-02-03T06:03:51+00:00" - }, - { - "name": "sebastian/exporter", - "version": "4.0.5", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/exporter.git", - "reference": "ac230ed27f0f98f597c8a2b6eb7ac563af5e5b9d" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/ac230ed27f0f98f597c8a2b6eb7ac563af5e5b9d", - "reference": "ac230ed27f0f98f597c8a2b6eb7ac563af5e5b9d", - "shasum": "" - }, - "require": { - "php": ">=7.3", - "sebastian/recursion-context": "^4.0" - }, - "require-dev": { - "ext-mbstring": "*", - "phpunit/phpunit": "^9.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "4.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - }, - { - "name": "Jeff Welch", - "email": "whatthejeff@gmail.com" - }, - { - "name": "Volker Dusch", - "email": "github@wallbash.com" - }, - { - "name": "Adam Harvey", - "email": "aharvey@php.net" - }, - { - "name": "Bernhard Schussek", - "email": "bschussek@gmail.com" - } - ], - "description": "Provides the functionality to export PHP variables for visualization", - "homepage": "https://www.github.com/sebastianbergmann/exporter", - "keywords": [ - "export", - "exporter" - ], - "support": { - "issues": "https://github.com/sebastianbergmann/exporter/issues", - "source": "https://github.com/sebastianbergmann/exporter/tree/4.0.5" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2022-09-14T06:03:37+00:00" - }, - { - "name": "sebastian/global-state", - "version": "5.0.5", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/global-state.git", - "reference": "0ca8db5a5fc9c8646244e629625ac486fa286bf2" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/0ca8db5a5fc9c8646244e629625ac486fa286bf2", - "reference": "0ca8db5a5fc9c8646244e629625ac486fa286bf2", - "shasum": "" - }, - "require": { - "php": ">=7.3", - "sebastian/object-reflector": "^2.0", - "sebastian/recursion-context": "^4.0" - }, - "require-dev": { - "ext-dom": "*", - "phpunit/phpunit": "^9.3" - }, - "suggest": { - "ext-uopz": "*" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "5.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Snapshotting of global state", - "homepage": "http://www.github.com/sebastianbergmann/global-state", - "keywords": [ - "global state" - ], - "support": { - "issues": "https://github.com/sebastianbergmann/global-state/issues", - "source": "https://github.com/sebastianbergmann/global-state/tree/5.0.5" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2022-02-14T08:28:10+00:00" - }, - { - "name": "sebastian/lines-of-code", - "version": "1.0.3", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/lines-of-code.git", - "reference": "c1c2e997aa3146983ed888ad08b15470a2e22ecc" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/lines-of-code/zipball/c1c2e997aa3146983ed888ad08b15470a2e22ecc", - "reference": "c1c2e997aa3146983ed888ad08b15470a2e22ecc", - "shasum": "" - }, - "require": { - "nikic/php-parser": "^4.6", - "php": ">=7.3" - }, - "require-dev": { - "phpunit/phpunit": "^9.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "description": "Library for counting the lines of code in PHP source code", - "homepage": "https://github.com/sebastianbergmann/lines-of-code", - "support": { - "issues": "https://github.com/sebastianbergmann/lines-of-code/issues", - "source": "https://github.com/sebastianbergmann/lines-of-code/tree/1.0.3" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2020-11-28T06:42:11+00:00" - }, - { - "name": "sebastian/object-enumerator", - "version": "4.0.4", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/object-enumerator.git", - "reference": "5c9eeac41b290a3712d88851518825ad78f45c71" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/5c9eeac41b290a3712d88851518825ad78f45c71", - "reference": "5c9eeac41b290a3712d88851518825ad78f45c71", - "shasum": "" - }, - "require": { - "php": ">=7.3", - "sebastian/object-reflector": "^2.0", - "sebastian/recursion-context": "^4.0" - }, - "require-dev": { - "phpunit/phpunit": "^9.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "4.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Traverses array structures and object graphs to enumerate all referenced objects", - "homepage": "https://github.com/sebastianbergmann/object-enumerator/", - "support": { - "issues": "https://github.com/sebastianbergmann/object-enumerator/issues", - "source": "https://github.com/sebastianbergmann/object-enumerator/tree/4.0.4" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2020-10-26T13:12:34+00:00" - }, - { - "name": "sebastian/object-reflector", - "version": "2.0.4", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/object-reflector.git", - "reference": "b4f479ebdbf63ac605d183ece17d8d7fe49c15c7" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/object-reflector/zipball/b4f479ebdbf63ac605d183ece17d8d7fe49c15c7", - "reference": "b4f479ebdbf63ac605d183ece17d8d7fe49c15c7", - "shasum": "" - }, - "require": { - "php": ">=7.3" - }, - "require-dev": { - "phpunit/phpunit": "^9.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Allows reflection of object attributes, including inherited and non-public ones", - "homepage": "https://github.com/sebastianbergmann/object-reflector/", - "support": { - "issues": "https://github.com/sebastianbergmann/object-reflector/issues", - "source": "https://github.com/sebastianbergmann/object-reflector/tree/2.0.4" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2020-10-26T13:14:26+00:00" - }, - { - "name": "sebastian/recursion-context", - "version": "4.0.5", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/recursion-context.git", - "reference": "e75bd0f07204fec2a0af9b0f3cfe97d05f92efc1" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/e75bd0f07204fec2a0af9b0f3cfe97d05f92efc1", - "reference": "e75bd0f07204fec2a0af9b0f3cfe97d05f92efc1", - "shasum": "" - }, - "require": { - "php": ">=7.3" - }, - "require-dev": { - "phpunit/phpunit": "^9.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "4.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - }, - { - "name": "Jeff Welch", - "email": "whatthejeff@gmail.com" - }, - { - "name": "Adam Harvey", - "email": "aharvey@php.net" - } - ], - "description": "Provides functionality to recursively process PHP variables", - "homepage": "https://github.com/sebastianbergmann/recursion-context", - "support": { - "issues": "https://github.com/sebastianbergmann/recursion-context/issues", - "source": "https://github.com/sebastianbergmann/recursion-context/tree/4.0.5" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2023-02-03T06:07:39+00:00" - }, - { - "name": "sebastian/resource-operations", - "version": "3.0.3", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/resource-operations.git", - "reference": "0f4443cb3a1d92ce809899753bc0d5d5a8dd19a8" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/resource-operations/zipball/0f4443cb3a1d92ce809899753bc0d5d5a8dd19a8", - "reference": "0f4443cb3a1d92ce809899753bc0d5d5a8dd19a8", - "shasum": "" - }, - "require": { - "php": ">=7.3" - }, - "require-dev": { - "phpunit/phpunit": "^9.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Provides a list of PHP built-in functions that operate on resources", - "homepage": "https://www.github.com/sebastianbergmann/resource-operations", - "support": { - "issues": "https://github.com/sebastianbergmann/resource-operations/issues", - "source": "https://github.com/sebastianbergmann/resource-operations/tree/3.0.3" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2020-09-28T06:45:17+00:00" - }, - { - "name": "sebastian/type", - "version": "3.2.1", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/type.git", - "reference": "75e2c2a32f5e0b3aef905b9ed0b179b953b3d7c7" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/75e2c2a32f5e0b3aef905b9ed0b179b953b3d7c7", - "reference": "75e2c2a32f5e0b3aef905b9ed0b179b953b3d7c7", - "shasum": "" - }, - "require": { - "php": ">=7.3" - }, - "require-dev": { - "phpunit/phpunit": "^9.5" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.2-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "description": "Collection of value objects that represent the types of the PHP type system", - "homepage": "https://github.com/sebastianbergmann/type", - "support": { - "issues": "https://github.com/sebastianbergmann/type/issues", - "source": "https://github.com/sebastianbergmann/type/tree/3.2.1" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2023-02-03T06:13:03+00:00" - }, - { - "name": "sebastian/version", - "version": "3.0.2", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/version.git", - "reference": "c6c1022351a901512170118436c764e473f6de8c" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/c6c1022351a901512170118436c764e473f6de8c", - "reference": "c6c1022351a901512170118436c764e473f6de8c", - "shasum": "" - }, - "require": { - "php": ">=7.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "description": "Library that helps with managing the version number of Git-hosted PHP projects", - "homepage": "https://github.com/sebastianbergmann/version", - "support": { - "issues": "https://github.com/sebastianbergmann/version/issues", - "source": "https://github.com/sebastianbergmann/version/tree/3.0.2" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2020-09-28T06:39:44+00:00" - }, - { - "name": "seld/jsonlint", - "version": "1.9.0", - "source": { - "type": "git", - "url": "https://github.com/Seldaek/jsonlint.git", - "reference": "4211420d25eba80712bff236a98960ef68b866b7" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/Seldaek/jsonlint/zipball/4211420d25eba80712bff236a98960ef68b866b7", - "reference": "4211420d25eba80712bff236a98960ef68b866b7", - "shasum": "" - }, - "require": { - "php": "^5.3 || ^7.0 || ^8.0" - }, - "require-dev": { - "phpstan/phpstan": "^1.5", - "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0 || ^8.5.13" - }, - "bin": [ - "bin/jsonlint" - ], - "type": "library", - "autoload": { - "psr-4": { - "Seld\\JsonLint\\": "src/Seld/JsonLint/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Jordi Boggiano", - "email": "j.boggiano@seld.be", - "homepage": "http://seld.be" - } - ], - "description": "JSON Linter", - "keywords": [ - "json", - "linter", - "parser", - "validator" - ], - "support": { - "issues": "https://github.com/Seldaek/jsonlint/issues", - "source": "https://github.com/Seldaek/jsonlint/tree/1.9.0" - }, - "funding": [ - { - "url": "https://github.com/Seldaek", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/seld/jsonlint", - "type": "tidelift" - } - ], - "time": "2022-04-01T13:37:23+00:00" - }, - { - "name": "symfony/options-resolver", - "version": "v6.2.7", - "source": { - "type": "git", - "url": "https://github.com/symfony/options-resolver.git", - "reference": "aa0e85b53bbb2b4951960efd61d295907eacd629" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/options-resolver/zipball/aa0e85b53bbb2b4951960efd61d295907eacd629", - "reference": "aa0e85b53bbb2b4951960efd61d295907eacd629", - "shasum": "" - }, - "require": { - "php": ">=8.1", - "symfony/deprecation-contracts": "^2.1|^3" - }, - "type": "library", - "autoload": { - "psr-4": { - "Symfony\\Component\\OptionsResolver\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Provides an improved replacement for the array_replace PHP function", - "homepage": "https://symfony.com", - "keywords": [ - "config", - "configuration", - "options" - ], - "support": { - "source": "https://github.com/symfony/options-resolver/tree/v6.2.7" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2023-02-14T08:44:56+00:00" - }, - { - "name": "symfony/process", - "version": "v6.2.10", - "source": { - "type": "git", - "url": "https://github.com/symfony/process.git", - "reference": "b34cdbc9c5e75d45a3703e63a48ad07aafa8bf2e" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/b34cdbc9c5e75d45a3703e63a48ad07aafa8bf2e", - "reference": "b34cdbc9c5e75d45a3703e63a48ad07aafa8bf2e", - "shasum": "" - }, - "require": { - "php": ">=8.1" - }, - "type": "library", - "autoload": { - "psr-4": { - "Symfony\\Component\\Process\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Executes commands in sub-processes", - "homepage": "https://symfony.com", - "support": { - "source": "https://github.com/symfony/process/tree/v6.2.10" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2023-04-18T13:56:57+00:00" - }, - { - "name": "symfony/stopwatch", - "version": "v6.2.7", - "source": { - "type": "git", - "url": "https://github.com/symfony/stopwatch.git", - "reference": "f3adc98c1061875dd2edcd45e5b04e63d0e29f8f" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/stopwatch/zipball/f3adc98c1061875dd2edcd45e5b04e63d0e29f8f", - "reference": "f3adc98c1061875dd2edcd45e5b04e63d0e29f8f", - "shasum": "" - }, - "require": { - "php": ">=8.1", - "symfony/service-contracts": "^1|^2|^3" - }, - "type": "library", - "autoload": { - "psr-4": { - "Symfony\\Component\\Stopwatch\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Provides a way to profile code", - "homepage": "https://symfony.com", - "support": { - "source": "https://github.com/symfony/stopwatch/tree/v6.2.7" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2023-02-14T08:44:56+00:00" - }, - { - "name": "symfony/var-dumper", - "version": "v6.2.10", - "source": { - "type": "git", - "url": "https://github.com/symfony/var-dumper.git", - "reference": "41a750a23412ca76fdbbf5096943b4134272c1ab" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/var-dumper/zipball/41a750a23412ca76fdbbf5096943b4134272c1ab", - "reference": "41a750a23412ca76fdbbf5096943b4134272c1ab", - "shasum": "" - }, - "require": { - "php": ">=8.1", - "symfony/polyfill-mbstring": "~1.0" - }, - "conflict": { - "phpunit/phpunit": "<5.4.3", - "symfony/console": "<5.4" - }, - "require-dev": { - "ext-iconv": "*", - "symfony/console": "^5.4|^6.0", - "symfony/process": "^5.4|^6.0", - "symfony/uid": "^5.4|^6.0", - "twig/twig": "^2.13|^3.0.4" - }, - "suggest": { - "ext-iconv": "To convert non-UTF-8 strings to UTF-8 (or symfony/polyfill-iconv in case ext-iconv cannot be used).", - "ext-intl": "To show region name in time zone dump", - "symfony/console": "To use the ServerDumpCommand and/or the bin/var-dump-server script" - }, - "bin": [ - "Resources/bin/var-dump-server" - ], - "type": "library", - "autoload": { - "files": [ - "Resources/functions/dump.php" - ], - "psr-4": { - "Symfony\\Component\\VarDumper\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Provides mechanisms for walking through any arbitrary PHP variable", - "homepage": "https://symfony.com", - "keywords": [ - "debug", - "dump" - ], - "support": { - "source": "https://github.com/symfony/var-dumper/tree/v6.2.10" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2023-04-18T13:46:08+00:00" - }, - { - "name": "thecodingmachine/safe", - "version": "v2.5.0", - "source": { - "type": "git", - "url": "https://github.com/thecodingmachine/safe.git", - "reference": "3115ecd6b4391662b4931daac4eba6b07a2ac1f0" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/thecodingmachine/safe/zipball/3115ecd6b4391662b4931daac4eba6b07a2ac1f0", - "reference": "3115ecd6b4391662b4931daac4eba6b07a2ac1f0", - "shasum": "" - }, - "require": { - "php": "^8.0" - }, - "require-dev": { - "phpstan/phpstan": "^1.5", - "phpunit/phpunit": "^9.5", - "squizlabs/php_codesniffer": "^3.2", - "thecodingmachine/phpstan-strict-rules": "^1.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.2.x-dev" - } - }, - "autoload": { - "files": [ - "deprecated/apc.php", - "deprecated/array.php", - "deprecated/datetime.php", - "deprecated/libevent.php", - "deprecated/misc.php", - "deprecated/password.php", - "deprecated/mssql.php", - "deprecated/stats.php", - "deprecated/strings.php", - "lib/special_cases.php", - "deprecated/mysqli.php", - "generated/apache.php", - "generated/apcu.php", - "generated/array.php", - "generated/bzip2.php", - "generated/calendar.php", - "generated/classobj.php", - "generated/com.php", - "generated/cubrid.php", - "generated/curl.php", - "generated/datetime.php", - "generated/dir.php", - "generated/eio.php", - "generated/errorfunc.php", - "generated/exec.php", - "generated/fileinfo.php", - "generated/filesystem.php", - "generated/filter.php", - "generated/fpm.php", - "generated/ftp.php", - "generated/funchand.php", - "generated/gettext.php", - "generated/gmp.php", - "generated/gnupg.php", - "generated/hash.php", - "generated/ibase.php", - "generated/ibmDb2.php", - "generated/iconv.php", - "generated/image.php", - "generated/imap.php", - "generated/info.php", - "generated/inotify.php", - "generated/json.php", - "generated/ldap.php", - "generated/libxml.php", - "generated/lzf.php", - "generated/mailparse.php", - "generated/mbstring.php", - "generated/misc.php", - "generated/mysql.php", - "generated/network.php", - "generated/oci8.php", - "generated/opcache.php", - "generated/openssl.php", - "generated/outcontrol.php", - "generated/pcntl.php", - "generated/pcre.php", - "generated/pgsql.php", - "generated/posix.php", - "generated/ps.php", - "generated/pspell.php", - "generated/readline.php", - "generated/rpminfo.php", - "generated/rrd.php", - "generated/sem.php", - "generated/session.php", - "generated/shmop.php", - "generated/sockets.php", - "generated/sodium.php", - "generated/solr.php", - "generated/spl.php", - "generated/sqlsrv.php", - "generated/ssdeep.php", - "generated/ssh2.php", - "generated/stream.php", - "generated/strings.php", - "generated/swoole.php", - "generated/uodbc.php", - "generated/uopz.php", - "generated/url.php", - "generated/var.php", - "generated/xdiff.php", - "generated/xml.php", - "generated/xmlrpc.php", - "generated/yaml.php", - "generated/yaz.php", - "generated/zip.php", - "generated/zlib.php" - ], - "classmap": [ - "lib/DateTime.php", - "lib/DateTimeImmutable.php", - "lib/Exceptions/", - "deprecated/Exceptions/", - "generated/Exceptions/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "description": "PHP core functions that throw exceptions instead of returning FALSE on error", - "support": { - "issues": "https://github.com/thecodingmachine/safe/issues", - "source": "https://github.com/thecodingmachine/safe/tree/v2.5.0" - }, - "time": "2023-04-05T11:54:14+00:00" - }, - { - "name": "theseer/tokenizer", - "version": "1.2.1", - "source": { - "type": "git", - "url": "https://github.com/theseer/tokenizer.git", - "reference": "34a41e998c2183e22995f158c581e7b5e755ab9e" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/theseer/tokenizer/zipball/34a41e998c2183e22995f158c581e7b5e755ab9e", - "reference": "34a41e998c2183e22995f158c581e7b5e755ab9e", - "shasum": "" - }, - "require": { - "ext-dom": "*", - "ext-tokenizer": "*", - "ext-xmlwriter": "*", - "php": "^7.2 || ^8.0" - }, - "type": "library", - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Arne Blankerts", - "email": "arne@blankerts.de", - "role": "Developer" - } - ], - "description": "A small library for converting tokenized PHP source code into XML and potentially other formats", - "support": { - "issues": "https://github.com/theseer/tokenizer/issues", - "source": "https://github.com/theseer/tokenizer/tree/1.2.1" - }, - "funding": [ - { - "url": "https://github.com/theseer", - "type": "github" - } - ], - "time": "2021-07-28T10:34:58+00:00" - }, - { - "name": "vimeo/psalm", - "version": "4.30.0", - "source": { - "type": "git", - "url": "https://github.com/vimeo/psalm.git", - "reference": "d0bc6e25d89f649e4f36a534f330f8bb4643dd69" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/vimeo/psalm/zipball/d0bc6e25d89f649e4f36a534f330f8bb4643dd69", - "reference": "d0bc6e25d89f649e4f36a534f330f8bb4643dd69", - "shasum": "" - }, - "require": { - "amphp/amp": "^2.4.2", - "amphp/byte-stream": "^1.5", - "composer/package-versions-deprecated": "^1.8.0", - "composer/semver": "^1.4 || ^2.0 || ^3.0", - "composer/xdebug-handler": "^1.1 || ^2.0 || ^3.0", - "dnoegel/php-xdg-base-dir": "^0.1.1", - "ext-ctype": "*", - "ext-dom": "*", - "ext-json": "*", - "ext-libxml": "*", - "ext-mbstring": "*", - "ext-simplexml": "*", - "ext-tokenizer": "*", - "felixfbecker/advanced-json-rpc": "^3.0.3", - "felixfbecker/language-server-protocol": "^1.5", - "netresearch/jsonmapper": "^1.0 || ^2.0 || ^3.0 || ^4.0", - "nikic/php-parser": "^4.13", - "openlss/lib-array2xml": "^1.0", - "php": "^7.1|^8", - "sebastian/diff": "^3.0 || ^4.0", - "symfony/console": "^3.4.17 || ^4.1.6 || ^5.0 || ^6.0", - "symfony/polyfill-php80": "^1.25", - "webmozart/path-util": "^2.3" - }, - "provide": { - "psalm/psalm": "self.version" - }, - "require-dev": { - "bamarni/composer-bin-plugin": "^1.2", - "brianium/paratest": "^4.0||^6.0", - "ext-curl": "*", - "php-parallel-lint/php-parallel-lint": "^1.2", - "phpdocumentor/reflection-docblock": "^5", - "phpmyadmin/sql-parser": "5.1.0||dev-master", - "phpspec/prophecy": ">=1.9.0", - "phpstan/phpdoc-parser": "1.2.* || 1.6.4", - "phpunit/phpunit": "^9.0", - "psalm/plugin-phpunit": "^0.16", - "slevomat/coding-standard": "^7.0", - "squizlabs/php_codesniffer": "^3.5", - "symfony/process": "^4.3 || ^5.0 || ^6.0", - "weirdan/prophecy-shim": "^1.0 || ^2.0" - }, - "suggest": { - "ext-curl": "In order to send data to shepherd", - "ext-igbinary": "^2.0.5 is required, used to serialize caching data" - }, - "bin": [ - "psalm", - "psalm-language-server", - "psalm-plugin", - "psalm-refactor", - "psalter" - ], - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "4.x-dev", - "dev-3.x": "3.x-dev", - "dev-2.x": "2.x-dev", - "dev-1.x": "1.x-dev" - } - }, - "autoload": { - "files": [ - "src/functions.php", - "src/spl_object_id.php" - ], - "psr-4": { - "Psalm\\": "src/Psalm/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Matthew Brown" - } - ], - "description": "A static analysis tool for finding errors in PHP applications", - "keywords": [ - "code", - "inspection", - "php" - ], - "support": { - "issues": "https://github.com/vimeo/psalm/issues", - "source": "https://github.com/vimeo/psalm/tree/4.30.0" - }, - "time": "2022-11-06T20:37:08+00:00" - }, - { - "name": "webmozart/assert", - "version": "1.11.0", - "source": { - "type": "git", - "url": "https://github.com/webmozarts/assert.git", - "reference": "11cb2199493b2f8a3b53e7f19068fc6aac760991" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/webmozarts/assert/zipball/11cb2199493b2f8a3b53e7f19068fc6aac760991", - "reference": "11cb2199493b2f8a3b53e7f19068fc6aac760991", - "shasum": "" - }, - "require": { - "ext-ctype": "*", - "php": "^7.2 || ^8.0" - }, - "conflict": { - "phpstan/phpstan": "<0.12.20", - "vimeo/psalm": "<4.6.1 || 4.6.2" - }, - "require-dev": { - "phpunit/phpunit": "^8.5.13" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.10-dev" - } - }, - "autoload": { - "psr-4": { - "Webmozart\\Assert\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Bernhard Schussek", - "email": "bschussek@gmail.com" - } - ], - "description": "Assertions to validate method input/output with nice error messages.", - "keywords": [ - "assert", - "check", - "validate" - ], - "support": { - "issues": "https://github.com/webmozarts/assert/issues", - "source": "https://github.com/webmozarts/assert/tree/1.11.0" - }, - "time": "2022-06-03T18:03:27+00:00" - }, - { - "name": "webmozart/path-util", - "version": "2.3.0", - "source": { - "type": "git", - "url": "https://github.com/webmozart/path-util.git", - "reference": "d939f7edc24c9a1bb9c0dee5cb05d8e859490725" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/webmozart/path-util/zipball/d939f7edc24c9a1bb9c0dee5cb05d8e859490725", - "reference": "d939f7edc24c9a1bb9c0dee5cb05d8e859490725", - "shasum": "" - }, - "require": { - "php": ">=5.3.3", - "webmozart/assert": "~1.0" - }, - "require-dev": { - "phpunit/phpunit": "^4.6", - "sebastian/version": "^1.0.1" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.3-dev" - } - }, - "autoload": { - "psr-4": { - "Webmozart\\PathUtil\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Bernhard Schussek", - "email": "bschussek@gmail.com" - } - ], - "description": "A robust cross-platform utility for normalizing, comparing and modifying file paths.", - "support": { - "issues": "https://github.com/webmozart/path-util/issues", - "source": "https://github.com/webmozart/path-util/tree/2.3.0" - }, - "abandoned": "symfony/filesystem", - "time": "2015-12-17T08:42:14+00:00" - } - ], - "aliases": [], - "minimum-stability": "stable", - "stability-flags": [], - "prefer-stable": false, - "prefer-lowest": false, - "platform": { - "php": "^8.1", - "ext-json": "*" - }, - "platform-dev": [], - "platform-overrides": { - "php": "8.1" - }, - "plugin-api-version": "2.3.0" -} diff --git a/tests/Core/Layer/LayerResolverTest.php b/tests/Core/Layer/LayerResolverTest.php deleted file mode 100644 index 2fc0e279d..000000000 --- a/tests/Core/Layer/LayerResolverTest.php +++ /dev/null @@ -1,231 +0,0 @@ - [ - [], - InvalidLayerDefinitionException::class, - 'Layer configuration is empty. You need to define at least 1 layer.', - ]; - - yield 'layer with missing name' => [ - [ - [ - 'collectors' => [], - ], - ], - InvalidLayerDefinitionException::class, - 'Could not resolve layer definition. The field "name" is required for all layers.', - ]; - - yield 'Duplicate layers' => [ - [ - [ - 'name' => 'test', - 'collectors' => [], - ], - [ - 'name' => 'test', - 'collectors' => [], - ], - ], - InvalidLayerDefinitionException::class, - 'The layer "test" is empty. You must assign at least 1 collector to a layer.', - ]; - - yield 'Layer without other attributes' => [ - [ - [ - 'name' => 'test', - ], - ], - InvalidLayerDefinitionException::class, - 'The layer "test" is empty. You must assign at least 1 collector to a layer.', - ]; - - yield 'Layer with empty collectors' => [ - [ - [ - 'name' => 'test', - 'collectors' => [], - ], - ], - InvalidLayerDefinitionException::class, - 'The layer "test" is empty. You must assign at least 1 collector to a layer.', - ]; - } - - /** - * @dataProvider provideInvalidLayerConfigs - */ - public function testInvalidLayerConfigs(array $layers, string $exception, string $expectedMessage): void - { - $this->expectException($exception); - $this->expectExceptionMessage($expectedMessage); - - new LayerResolver( - $this->createMock(CollectorResolverInterface::class), - $layers - ); - } - - public function testHas(): void - { - $resolver = new LayerResolver( - $this->buildCollectorResolverWithFakeCollector(), - [ - [ - 'name' => 'test', - 'collectors' => [ - [ - 'type' => 'custom', - ], - ], - ], - ] - ); - - self::assertTrue($resolver->has('test')); - self::assertFalse($resolver->has('other')); - } - - public function testIsReferenceInLayer(): void - { - $reference = new ClassLikeReference(ClassLikeToken::fromFQCN('foo')); - $resolver = new LayerResolver( - $this->buildCollectorResolverWithFakeCollector(), - [ - [ - 'name' => 'test', - 'collectors' => [ - [ - 'type' => 'custom', - 'resolvable' => true, - 'satisfy' => true, - ], - ], - ], - ] - ); - - self::assertTrue($resolver->isReferenceInLayer( - 'test', - $reference, - )); - - self::assertFalse($resolver->isReferenceInLayer( - 'other', - $reference, - )); - } - - public function testGetLayersForReference(): void - { - $reference = new ClassLikeReference(ClassLikeToken::fromFQCN('foo')); - $resolver = new LayerResolver( - $this->buildCollectorResolverWithFakeCollector(), - [ - [ - 'name' => 'test', - 'collectors' => [ - [ - 'type' => 'custom', - 'resolvable' => true, - 'satisfy' => true, - ], - ], - ], - ] - ); - - self::assertSame( - ['test' => true], - $resolver->getLayersForReference($reference) - ); - } - - public function testGetLayersForReferenceWhenCollectorDoesNotSatisfy(): void - { - $reference = new ClassLikeReference(ClassLikeToken::fromFQCN('foo')); - $resolver = new LayerResolver( - $this->buildCollectorResolverWithFakeCollector(), - [ - [ - 'name' => 'test', - 'collectors' => [ - [ - 'type' => 'custom', - 'resolvable' => true, - 'satisfy' => false, - ], - ], - ], - ] - ); - - self::assertSame( - [], - $resolver->getLayersForReference($reference) - ); - } - - public function testGetLayersForReferenceWhenCollectorIsNotResolvable(): void - { - $reference = new ClassLikeReference(ClassLikeToken::fromFQCN('foo')); - $resolver = new LayerResolver( - $this->buildCollectorResolverWithFakeCollector(), - [ - [ - 'name' => 'test', - 'collectors' => [ - [ - 'type' => 'custom', - 'resolvable' => false, - ], - ], - ], - ] - ); - - self::assertSame( - [], - $resolver->getLayersForReference($reference) - ); - } - - private function buildCollectorResolverWithFakeCollector(): CollectorResolverInterface - { - $collector = $this->createMock(ConditionalCollectorInterface::class); - $collector - ->method('resolvable') - ->with($this->callback(static fn (array $config): bool => 'custom' === $config['type'])) - ->willReturnCallback(static fn (array $config): bool => (bool) $config['resolvable'] ?? false); - $collector - ->method('satisfy') - ->with($this->callback(static fn (array $config): bool => 'custom' === $config['type'])) - ->willReturnCallback(static fn (array $config): bool => (bool) $config['satisfy'] ?? false); - - $resolver = $this->createMock(CollectorResolverInterface::class); - $resolver - ->method('resolve') - ->with($this->callback(static fn (array $config): bool => 'custom' === $config['type'])) - ->willReturnCallback(static fn (array $config): Collectable => new Collectable($collector, $config)); - - return $resolver; - } -} diff --git a/tests/Supportive/Console/Command/AnalyseCommandTest.php b/tests/Supportive/Console/Command/AnalyseCommandTest.php deleted file mode 100644 index c9f249718..000000000 --- a/tests/Supportive/Console/Command/AnalyseCommandTest.php +++ /dev/null @@ -1,23 +0,0 @@ - 'onPreCreateAstMapEvent', - PostCreateAstMapEvent::class => 'onPostCreateAstMapEvent', - AstFileAnalysedEvent::class => 'onAstFileAnalysedEvent', - AstFileSyntaxErrorEvent::class => 'onAstFileSyntaxErrorEvent', - PreEmitEvent::class => 'onPreDependencyEmit', - PostEmitEvent::class => 'onPostDependencyEmit', - PreFlattenEvent::class => 'onPreDependencyFlatten', - PostFlattenEvent::class => 'onPostDependencyFlatten', - ], - ConsoleSubscriber::getSubscribedEvents() - ); - } - - public function testOnPreCreateAstMapEventWithVerboseVerbosity(): void - { - $symfonyOutput = new BufferedOutput(OutputInterface::VERBOSITY_VERBOSE); - $output = new SymfonyOutput($symfonyOutput, new Style(new SymfonyStyle(new ArrayInput([]), $symfonyOutput))); - - $subscriber = new ConsoleSubscriber($output, new Stopwatch()); - $subscriber->onPreCreateAstMapEvent(new PreCreateAstMapEvent(9999999)); - - self::assertSame('Start to create an AstMap for 9999999 Files.'.PHP_EOL, $symfonyOutput->fetch()); - } - - public function testOnPreCreateAstMapEventWithStopwatchAlreadyStartedVerboseVerbosity(): void - { - $symfonyOutput = new BufferedOutput(OutputInterface::VERBOSITY_VERBOSE); - $output = new SymfonyOutput($symfonyOutput, new Style(new SymfonyStyle(new ArrayInput([]), $symfonyOutput))); - - $stopwatch = new Stopwatch(); - $stopwatch->start('ast'); - - $subscriber = new ConsoleSubscriber($output, $stopwatch); - $subscriber->onPreCreateAstMapEvent(new PreCreateAstMapEvent(9999999)); - - self::assertSame('Start to create an AstMap for 9999999 Files.'.PHP_EOL, $symfonyOutput->fetch()); - } - - public function testOnPostCreateAstMapEventWithVerboseVerbosityWithNoStopwatchStarted(): void - { - $symfonyOutput = new BufferedOutput(OutputInterface::VERBOSITY_VERBOSE); - $output = new SymfonyOutput($symfonyOutput, new Style(new SymfonyStyle(new ArrayInput([]), $symfonyOutput))); - - $subscriber = new ConsoleSubscriber($output, new Stopwatch()); - $subscriber->onPostCreateAstMapEvent(new PostCreateAstMapEvent()); - - self::assertSame('AstMap created.'.PHP_EOL, $symfonyOutput->fetch()); - } - - public function testOnPostCreateAstMapEventWithVerboseVerbosity(): void - { - $symfonyOutput = new BufferedOutput(OutputInterface::VERBOSITY_VERBOSE); - $output = new SymfonyOutput($symfonyOutput, new Style(new SymfonyStyle(new ArrayInput([]), $symfonyOutput))); - - $subscriber = new ConsoleSubscriber($output, new Stopwatch()); - $subscriber->onPreCreateAstMapEvent(new PreCreateAstMapEvent(9999999)); - $subscriber->onPostCreateAstMapEvent(new PostCreateAstMapEvent()); - - self::assertMatchesRegularExpression( - '/AstMap created in \d+\.\d+ sec\.'.PHP_EOL.'/', - $symfonyOutput->fetch() - ); - } - - public function testOnAstFileAnalysedEventWithVerboseVerbosity(): void - { - $symfonyOutput = new BufferedOutput(OutputInterface::VERBOSITY_VERBOSE); - $output = new SymfonyOutput($symfonyOutput, new Style(new SymfonyStyle(new ArrayInput([]), $symfonyOutput))); - - $subscriber = new ConsoleSubscriber($output, new Stopwatch()); - $subscriber->onAstFileAnalysedEvent(new AstFileAnalysedEvent('foo.php')); - - self::assertSame('Parsing File foo.php'.PHP_EOL, $symfonyOutput->fetch()); - } - - public function testOnAstFileSyntaxErrorEvent(): void - { - $symfonyOutput = new BufferedOutput(OutputInterface::VERBOSITY_VERBOSE); - $output = new SymfonyOutput($symfonyOutput, new Style(new SymfonyStyle(new ArrayInput([]), $symfonyOutput))); - - $subscriber = new ConsoleSubscriber($output, new Stopwatch()); - $subscriber->onAstFileSyntaxErrorEvent( - new AstFileSyntaxErrorEvent('foo.php', 'Invalid') - ); - - self::assertSame("\nSyntax Error on File foo.php\nInvalid\n".PHP_EOL, $symfonyOutput->fetch()); - } - - public function testOnPreDependencyEmit(): void - { - $symfonyOutput = new BufferedOutput(OutputInterface::VERBOSITY_VERBOSE); - $output = new SymfonyOutput($symfonyOutput, new Style(new SymfonyStyle(new ArrayInput([]), $symfonyOutput))); - - $subscriber = new ConsoleSubscriber($output, new Stopwatch()); - $subscriber->onPreDependencyEmit(new PreEmitEvent('emitter-name')); - - self::assertSame('start emitting dependencies "emitter-name"'.PHP_EOL, $symfonyOutput->fetch()); - } - - public function testOnPreDependencyEmitWithStopwatchAlreadyStarted(): void - { - $symfonyOutput = new BufferedOutput(OutputInterface::VERBOSITY_VERBOSE); - $output = new SymfonyOutput($symfonyOutput, new Style(new SymfonyStyle(new ArrayInput([]), $symfonyOutput))); - - $stopwatch = new Stopwatch(); - $stopwatch->start('deps'); - - $subscriber = new ConsoleSubscriber($output, $stopwatch); - $subscriber->onPreDependencyEmit(new PreEmitEvent('emitter-name')); - - self::assertSame('start emitting dependencies "emitter-name"'.PHP_EOL, $symfonyOutput->fetch()); - } - - public function testOnPostDependencyEmitWithNoStopwatchStarted(): void - { - $symfonyOutput = new BufferedOutput(OutputInterface::VERBOSITY_VERBOSE); - $output = new SymfonyOutput($symfonyOutput, new Style(new SymfonyStyle(new ArrayInput([]), $symfonyOutput))); - - $subscriber = new ConsoleSubscriber($output, new Stopwatch()); - $subscriber->onPostDependencyEmit(new PostEmitEvent()); - - self::assertSame('Dependencies emitted.'.PHP_EOL, $symfonyOutput->fetch()); - } - - public function testOnPostDependencyEmit(): void - { - $symfonyOutput = new BufferedOutput(OutputInterface::VERBOSITY_VERBOSE); - $output = new SymfonyOutput($symfonyOutput, new Style(new SymfonyStyle(new ArrayInput([]), $symfonyOutput))); - - $subscriber = new ConsoleSubscriber($output, new Stopwatch()); - $subscriber->onPreDependencyEmit(new PreEmitEvent('emitter-name')); - $subscriber->onPostDependencyEmit(new PostEmitEvent()); - - self::assertMatchesRegularExpression( - '/Dependencies emitted in \d+\.\d+ sec\.'.PHP_EOL.'/', - $symfonyOutput->fetch() - ); - } - - public function testOnPreDependencyFlatten(): void - { - $symfonyOutput = new BufferedOutput(OutputInterface::VERBOSITY_VERBOSE); - $output = new SymfonyOutput($symfonyOutput, new Style(new SymfonyStyle(new ArrayInput([]), $symfonyOutput))); - - $subscriber = new ConsoleSubscriber($output, new Stopwatch()); - $subscriber->onPreDependencyFlatten(new PreFlattenEvent()); - - self::assertSame('start flatten dependencies'.PHP_EOL, $symfonyOutput->fetch()); - } - - public function testOnPreDependencyFlattenWithStopwatchStarted(): void - { - $symfonyOutput = new BufferedOutput(OutputInterface::VERBOSITY_VERBOSE); - $output = new SymfonyOutput($symfonyOutput, new Style(new SymfonyStyle(new ArrayInput([]), $symfonyOutput))); - - $stopwatch = new Stopwatch(); - $stopwatch->start('flatten'); - - $subscriber = new ConsoleSubscriber($output, $stopwatch); - $subscriber->onPreDependencyFlatten(new PreFlattenEvent()); - - self::assertSame('start flatten dependencies'.PHP_EOL, $symfonyOutput->fetch()); - } - - public function testOnPostDependencyFlattenWithNoStopwatchStarted(): void - { - $symfonyOutput = new BufferedOutput(OutputInterface::VERBOSITY_VERBOSE); - $output = new SymfonyOutput($symfonyOutput, new Style(new SymfonyStyle(new ArrayInput([]), $symfonyOutput))); - - $subscriber = new ConsoleSubscriber($output, new Stopwatch()); - $subscriber->onPostDependencyFlatten(new PostFlattenEvent()); - - self::assertSame('Dependencies flattened.'.PHP_EOL, $symfonyOutput->fetch()); - } - - public function testOnPostDependencyFlatten(): void - { - $symfonyOutput = new BufferedOutput(OutputInterface::VERBOSITY_VERBOSE); - $output = new SymfonyOutput($symfonyOutput, new Style(new SymfonyStyle(new ArrayInput([]), $symfonyOutput))); - - $subscriber = new ConsoleSubscriber($output, new Stopwatch()); - $subscriber->onPreDependencyFlatten(new PreFlattenEvent()); - $subscriber->onPostDependencyFlatten(new PostFlattenEvent()); - - self::assertMatchesRegularExpression( - '/Dependencies flattened in \d+\.\d+ sec\.'.PHP_EOL.'/', - $symfonyOutput->fetch() - ); - } -} diff --git a/tests/Supportive/Console/EmptyEnv.php b/tests/Supportive/Console/EmptyEnv.php deleted file mode 100644 index 864b1e49f..000000000 --- a/tests/Supportive/Console/EmptyEnv.php +++ /dev/null @@ -1,15 +0,0 @@ -get('TEST')); - self::assertSame('true', $env->get('FOO')); - } - - public function testEnvMissing(): void - { - $env = new Env(); - self::assertSame(false, $env->get('BAR')); - } -} diff --git a/tests/Supportive/Console/ProgressSubscriberTest.php b/tests/Supportive/Console/ProgressSubscriberTest.php deleted file mode 100644 index 8f2d92464..000000000 --- a/tests/Supportive/Console/ProgressSubscriberTest.php +++ /dev/null @@ -1,91 +0,0 @@ - 'onPreCreateAstMapEvent', - PostCreateAstMapEvent::class => ['onPostCreateAstMapEvent', 1], - AstFileAnalysedEvent::class => 'onAstFileAnalysedEvent', - ], - ProgressSubscriber::getSubscribedEvents() - ); - } - - public function testProgress(): void - { - $bufferedOutput = new BufferedOutput(); - $subscriber = new ProgressSubscriber($this->createSymfonyOutput($bufferedOutput)); - - $subscriber->onPreCreateAstMapEvent(new PreCreateAstMapEvent(1)); - $subscriber->onAstFileAnalysedEvent(new AstFileAnalysedEvent('foo.php')); - $subscriber->onPostCreateAstMapEvent(new PostCreateAstMapEvent()); - - $expectedOutput = " 0/1 [{$this->getEmptyBarOutput()}] 0%".PHP_EOL. - " 1/1 [{$this->getBarOutput()}] 100%".PHP_EOL.PHP_EOL; - - self::assertSame($expectedOutput, $bufferedOutput->fetch()); - } - - public function testOnPostCreateAstMapEvent(): void - { - $formatter = new BufferedOutput(); - $subscriber = new ProgressSubscriber($this->createSymfonyOutput($formatter)); - - $subscriber->onPreCreateAstMapEvent(new PreCreateAstMapEvent(1)); - $subscriber->onPostCreateAstMapEvent(new PostCreateAstMapEvent()); - - $expectedOutput = " 0/1 [{$this->getEmptyBarOutput()}] 0%".PHP_EOL. - " 1/1 [{$this->getBarOutput()}] 100%".PHP_EOL.PHP_EOL; - - self::assertSame($expectedOutput, $formatter->fetch()); - } - - private function createSymfonyOutput(BufferedOutput $bufferedOutput): SymfonyOutput - { - return new SymfonyOutput( - $bufferedOutput, - new Style(new SymfonyStyle($this->createMock(InputInterface::class), $bufferedOutput)) - ); - } - - private function getEmptyBarOutput(): string - { - $progressChar = $this->getProgressBar()->getProgressCharacter(); - - return $progressChar.str_repeat($this->getProgressBar()->getEmptyBarCharacter(), '' === $progressChar ? 28 : 27); - } - - private function getBarOutput(): string - { - return str_repeat($this->getProgressBar()->getBarCharacter(), 28); - } - - private function getProgressBar(): ProgressBar - { - $style = new SymfonyStyle($this->createMock(InputInterface::class), $this->createMock(OutputInterface::class)); - - return $style->createProgressBar(28); - } -} diff --git a/tests/Supportive/DependencyInjection/DeptracExtensionTest.php b/tests/Supportive/DependencyInjection/DeptracExtensionTest.php deleted file mode 100644 index aa0b00908..000000000 --- a/tests/Supportive/DependencyInjection/DeptracExtensionTest.php +++ /dev/null @@ -1,530 +0,0 @@ - [ - 'hidden_layers' => [], - 'groups' => [], - 'point_to_groups' => false, - ], - 'codeclimate' => [ - 'severity' => [ - 'failure' => 'major', - 'skipped' => 'minor', - 'uncovered' => 'info', - ], - ], - ]; - - protected function setUp(): void - { - parent::setUp(); - - $this->container = new ContainerBuilder(); - $this->extension = new DeptracExtension(); - } - - public function testDefaults(): void - { - $configs = []; - - $this->extension->load($configs, $this->container); - - self::assertSame(['src/'], $this->container->getParameter('paths')); - self::assertSame([], $this->container->getParameter('exclude_files')); - self::assertSame([], $this->container->getParameter('layers')); - self::assertSame([], $this->container->getParameter('ruleset')); - self::assertSame([], $this->container->getParameter('skip_violations')); - self::assertSame($this->formatterDefaults, $this->container->getParameter('formatters')); - self::assertSame(['types' => [EmitterType::CLASS_TOKEN->value, EmitterType::FUNCTION_TOKEN->value]], $this->container->getParameter('analyser')); - self::assertSame(true, $this->container->getParameter('ignore_uncovered_internal_classes')); - } - - public function testDefaultsWithEmptyRoot(): void - { - $configs = [ - 'deptrac' => [], - ]; - - $this->extension->load($configs, $this->container); - - self::assertSame(['src/'], $this->container->getParameter('paths')); - self::assertSame([], $this->container->getParameter('exclude_files')); - self::assertSame([], $this->container->getParameter('layers')); - self::assertSame([], $this->container->getParameter('ruleset')); - self::assertSame([], $this->container->getParameter('skip_violations')); - self::assertSame($this->formatterDefaults, $this->container->getParameter('formatters')); - self::assertSame(['types' => [EmitterType::CLASS_TOKEN->value, EmitterType::FUNCTION_TOKEN->value]], $this->container->getParameter('analyser')); - self::assertSame(true, $this->container->getParameter('ignore_uncovered_internal_classes')); - } - - public function testPathsWithMultipleElements(): void - { - $configs = [ - 'deptrac' => [ - 'paths' => ['tests/', 'src/', 'lib/'], - ], - ]; - - $this->extension->load($configs, $this->container); - - self::assertSame(['tests/', 'src/', 'lib/'], $this->container->getParameter('paths')); - } - - public function testPathsWithSingleElement(): void - { - $configs = [ - 'deptrac' => [ - 'paths' => ['lib/'], - ], - ]; - - $this->extension->load($configs, $this->container); - - self::assertSame(['lib/'], $this->container->getParameter('paths')); - } - - public function testPathsWithScalar(): void - { - $configs = [ - 'deptrac' => [ - 'path' => 'tests/', - ], - ]; - - $this->extension->load($configs, $this->container); - - self::assertSame(['tests/'], $this->container->getParameter('paths')); - } - - public function testExcludePatternWithMultipleElements(): void - { - $configs = [ - 'deptrac' => [ - 'exclude_files' => ['.*', '/\d+/'], - ], - ]; - - $this->extension->load($configs, $this->container); - - self::assertSame(['.*', '/\d+/'], $this->container->getParameter('exclude_files')); - } - - public function testExcludePatternsWithSingleElement(): void - { - $configs = [ - 'deptrac' => [ - 'exclude_files' => ['#.*Test\.php#'], - ], - ]; - - $this->extension->load($configs, $this->container); - - self::assertSame(['#.*Test\.php#'], $this->container->getParameter('exclude_files')); - } - - public function testExcludePatternsWithScalar(): void - { - $configs = [ - 'deptrac' => [ - 'exclude_file' => '/^[a-z]+$/', - ], - ]; - - $this->extension->load($configs, $this->container); - - self::assertSame(['/^[a-z]+$/'], $this->container->getParameter('exclude_files')); - } - - public function testNullLayers(): void - { - $configs = [ - 'deptrac' => [ - 'layers' => null, - ], - ]; - - $this->extension->load($configs, $this->container); - - self::assertSame([], $this->container->getParameter('layers')); - } - - public function testEmptyLayers(): void - { - $configs = [ - 'deptrac' => [ - 'layers' => [], - ], - ]; - - $this->extension->load($configs, $this->container); - - self::assertSame([], $this->container->getParameter('layers')); - } - - public function testLayers(): void - { - $configs = [ - 'deptrac' => [ - 'layers' => [ - [ - 'name' => 'test', - 'collectors' => [ - [ - 'type' => 'directory', - 'value' => 'Repository', - 'attributes' => [], - ], - ], - 'attributes' => [], - ], - ], - ], - ]; - - $this->extension->load($configs, $this->container); - - self::assertSame( - [ - 'test' => [ - 'name' => 'test', - 'collectors' => [ - [ - 'type' => 'directory', - 'value' => 'Repository', - 'attributes' => [], - 'private' => false, - ], - ], - 'attributes' => [], - ], - ], - $this->container->getParameter('layers') - ); - } - - public function testNullRuleset(): void - { - $configs = [ - 'deptrac' => [ - 'ruleset' => null, - ], - ]; - - $this->extension->load($configs, $this->container); - - self::assertSame( - [], - $this->container->getParameter('ruleset') - ); - } - - public function testEmptyRuleset(): void - { - $configs = [ - 'deptrac' => [ - 'ruleset' => [], - ], - ]; - - $this->extension->load($configs, $this->container); - - self::assertSame( - [], - $this->container->getParameter('ruleset') - ); - } - - public function testRuleset(): void - { - $configs = [ - 'deptrac' => [ - 'ruleset' => [ - 'Foo' => ['Bar', 'Baz'], - 'Bar' => null, - 'Baz' => [], - ], - ], - ]; - - $this->extension->load($configs, $this->container); - - self::assertSame( - [ - 'Foo' => ['Bar', 'Baz'], - 'Bar' => [], - 'Baz' => [], - ], - $this->container->getParameter('ruleset') - ); - } - - public function testSkipViolations(): void - { - $configs = [ - 'deptrac' => [ - 'skip_violations' => [ - 'examples\Layer2\SomeOtherClass' => [ - 'examples\Layer1\SomeClass', - ], - ], - ], - ]; - - $this->extension->load($configs, $this->container); - - self::assertSame( - [ - 'examples\Layer2\SomeOtherClass' => [ - 'examples\Layer1\SomeClass', - ], - ], - $this->container->getParameter('skip_violations') - ); - } - - public function testNullAnalyser(): void - { - $configs = [ - 'deptrac' => [ - 'analyser' => null, - ], - ]; - - $this->expectException(InvalidConfigurationException::class); - $this->expectExceptionMessage('The child config "types" under "deptrac.analyser" must be configured.'); - - $this->extension->load($configs, $this->container); - } - - public function testEmptyAnalyser(): void - { - $configs = [ - 'deptrac' => [ - 'analyser' => [], - ], - ]; - - $this->expectException(InvalidConfigurationException::class); - $this->expectExceptionMessage('The child config "types" under "deptrac.analyser" must be configured.'); - - $this->extension->load($configs, $this->container); - } - - public function testInvalidAnalyserTypes(): void - { - $configs = [ - 'deptrac' => [ - 'analyser' => [ - 'types' => ['invalid'], - ], - ], - ]; - - $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Invalid type "invalid"'); - - $this->extension->load($configs, $this->container); - } - - public function testNullAnalyserTypes(): void - { - $configs = [ - 'deptrac' => [ - 'analyser' => [ - 'types' => null, - ], - ], - ]; - - $this->extension->load($configs, $this->container); - - self::assertSame( - ['types' => []], - $this->container->getParameter('analyser') - ); - } - - public function testEmptyAnalyserTypes(): void - { - $configs = [ - 'deptrac' => [ - 'analyser' => [ - 'types' => [], - ], - ], - ]; - - $this->extension->load($configs, $this->container); - - self::assertSame( - ['types' => []], - $this->container->getParameter('analyser') - ); - } - - public function testAnalyserWithDuplicateTypes(): void - { - $configs = [ - 'deptrac' => [ - 'analyser' => [ - 'types' => [EmitterType::CLASS_TOKEN->value, EmitterType::CLASS_TOKEN->value], - ], - ], - ]; - - $this->extension->load($configs, $this->container); - - self::assertSame( - ['types' => [EmitterType::CLASS_TOKEN->value, EmitterType::CLASS_TOKEN->value]], - $this->container->getParameter('analyser') - ); - } - - public function testIgnoreUncoveredInternalClasses(): void - { - $configs = [ - 'deptrac' => [ - 'ignore_uncovered_internal_classes' => false, - ], - ]; - - $this->extension->load($configs, $this->container); - - self::assertSame(false, $this->container->getParameter('ignore_uncovered_internal_classes')); - } - - public function testGraphvizFormatterWithEmptyNodes(): void - { - $configs = [ - 'deptrac' => [ - 'formatters' => [ - 'graphviz' => [], - ], - ], - ]; - - $this->extension->load($configs, $this->container); - - $expectedFormatterConfig = $this->formatterDefaults; - $actualFormatterConfig = $this->container->getParameter('formatters'); - - krsort($expectedFormatterConfig); - krsort($actualFormatterConfig); - - self::assertSame($expectedFormatterConfig, $actualFormatterConfig); - } - - public function testGraphvizFormatterWithOldPointToGroupsConfig(): void - { - $configs = [ - 'deptrac' => [ - 'formatters' => [ - 'graphviz' => [ - 'pointToGroups' => true, - ], - ], - ], - ]; - - $this->extension->load($configs, $this->container); - - $expectedFormatterConfig = $this->formatterDefaults; - $expectedFormatterConfig['graphviz'] = [ - 'point_to_groups' => true, - 'hidden_layers' => [], - 'groups' => [], - ]; - - self::assertSame($expectedFormatterConfig, $this->container->getParameter('formatters')); - } - - public function testGraphvizFormattersWithHiddenLayers(): void - { - $configs = [ - 'deptrac' => [ - 'formatters' => [ - 'graphviz' => [ - 'hidden_layers' => ['Utils'], - 'groups' => [ - 'App' => ['Controller', 'View'], - 'Domain' => ['User', 'Checkout', 'Product'], - ], - 'point_to_groups' => true, - ], - ], - ], - ]; - - $this->extension->load($configs, $this->container); - - $expectedFormatterConfig = $this->formatterDefaults; - $expectedFormatterConfig['graphviz'] = [ - 'hidden_layers' => ['Utils'], - 'groups' => [ - 'App' => ['Controller', 'View'], - 'Domain' => ['User', 'Checkout', 'Product'], - ], - 'point_to_groups' => true, - ]; - - self::assertSame($expectedFormatterConfig, $this->container->getParameter('formatters')); - } - - public function testCodeclimateFormatterWithEmptyNodes(): void - { - $configs = [ - 'deptrac' => [ - 'formatters' => [ - 'codeclimate' => [], - ], - ], - ]; - - $this->extension->load($configs, $this->container); - - $expectedFormatterConfig = $this->formatterDefaults; - $actualFormatterConfig = $this->container->getParameter('formatters'); - - krsort($expectedFormatterConfig); - krsort($actualFormatterConfig); - - self::assertSame($expectedFormatterConfig, $actualFormatterConfig); - } - - public function testCodeclimateFormatterRequiresValidSeverity(): void - { - $configs = [ - 'deptrac' => [ - 'formatters' => [ - 'codeclimate' => [ - 'severity' => [ - 'failure' => 'super duper important', - ], - ], - ], - ], - ]; - - $this->expectException(InvalidConfigurationException::class); - $this->expectExceptionMessage('The value "super duper important" is not allowed for path "deptrac.formatters.codeclimate.severity.failure".'); - - $this->extension->load($configs, $this->container); - } -} diff --git a/tests/Supportive/DependencyInjection/ServiceContainerBuilderTest.php b/tests/Supportive/DependencyInjection/ServiceContainerBuilderTest.php deleted file mode 100644 index 64957b2cf..000000000 --- a/tests/Supportive/DependencyInjection/ServiceContainerBuilderTest.php +++ /dev/null @@ -1,44 +0,0 @@ -build(); - - self::assertTrue($container->getParameter('ignore_uncovered_internal_classes')); - self::assertSame( - ['types' => ['class', 'function']], - $container->getParameter('analyser') - ); - self::assertSame( - [], - $container->getParameter('paths') - ); - self::assertSame( - [], - $container->getParameter('exclude_files') - ); - self::assertSame( - [], - $container->getParameter('layers') - ); - self::assertSame( - [], - $container->getParameter('ruleset') - ); - self::assertSame( - [], - $container->getParameter('skip_violations') - ); - } -} diff --git a/tests/Supportive/File/CouldNotReadFileExceptionTest.php b/tests/Supportive/File/CouldNotReadFileExceptionTest.php deleted file mode 100644 index e4e07c345..000000000 --- a/tests/Supportive/File/CouldNotReadFileExceptionTest.php +++ /dev/null @@ -1,36 +0,0 @@ -getMessage()); - } -} diff --git a/tests/Supportive/File/DumperTest.php b/tests/Supportive/File/DumperTest.php deleted file mode 100644 index 44a93abc9..000000000 --- a/tests/Supportive/File/DumperTest.php +++ /dev/null @@ -1,91 +0,0 @@ -sourceFile = __DIR__.'/Fixtures/deptrac.yaml'; - $this->dumper = new Dumper($this->sourceFile); - } - - protected function tearDown(): void - { - parent::tearDown(); - - unset($this->dumper); - } - - public function testFailsWhenFileAlreadyExists(): void - { - $targetFile = $this->sourceFile; - - $this->expectException(FileAlreadyExistsException::class); - - $this->dumper->dump($targetFile); - } - - public function testFailsWhenFileIsNotWritable(): void - { - $tempDir = sprintf('%s/%s', rtrim(sys_get_temp_dir(), DIRECTORY_SEPARATOR), uniqid()); - if (!mkdir($tempDir) || !chmod($tempDir, 0444)) { - $this->markTestSkipped(sprintf('Skipping test. Could not create readonly temporary directory "%s". Please check permissions', $tempDir)); - } - $tempFile = new SplFileInfo($tempDir.DIRECTORY_SEPARATOR.'deptrac.yaml'); - - $this->expectException(FileNotWritableException::class); - - $this->dumper->dump($tempFile->getPathname()); - } - - public function testCopiesTemplateToNewFile(): void - { - $tempFilename = tempnam(sys_get_temp_dir(), 'deptrac'); - if (false === $tempFilename) { - $this->markTestSkipped('Skipping test. Could not create temporary file. Please check permissions'); - } - $tempFile = new SplFileInfo($tempFilename); - unlink($tempFile->getPathname()); - $tempDir = $tempFile->getPath(); - if (!is_writable($tempDir)) { - $this->markTestSkipped(sprintf('Skipping test. Can not write to temporary directory "%s". Please check your permissions.', $tempDir)); - } - if ($tempFile->isFile()) { - $this->fail(sprintf('Temporary file "%s" already exists.', $tempFile->getPathname())); - } - - $this->dumper->dump($tempFile->getPathname()); - - self::assertTrue(file_exists($tempFile->getPathname())); - self::assertSame(file_get_contents($this->sourceFile), file_get_contents($tempFile->getPathname())); - - @unlink($tempFile->getPathname()); - @rmdir($tempDir); - } -} diff --git a/tests/Supportive/File/Fixtures/deptrac.yaml b/tests/Supportive/File/Fixtures/deptrac.yaml deleted file mode 100644 index 195cd1a1f..000000000 --- a/tests/Supportive/File/Fixtures/deptrac.yaml +++ /dev/null @@ -1,24 +0,0 @@ -deptrac: - paths: - - ./src - exclude_files: - - '#.*test.*#' - layers: - - name: Controller - collectors: - - type: classLike - value: .*Controller.* - - name: Repository - collectors: - - type: classLike - value: .*Repository.* - - name: Service - collectors: - - type: classLike - value: .*Service.* - ruleset: - Controller: - - Service - Service: - - Repository - Repository: diff --git a/tests/Supportive/FileCannotBeParsedAsYamlExceptionTest.php b/tests/Supportive/FileCannotBeParsedAsYamlExceptionTest.php deleted file mode 100644 index a82ede1b7..000000000 --- a/tests/Supportive/FileCannotBeParsedAsYamlExceptionTest.php +++ /dev/null @@ -1,37 +0,0 @@ -getMessage()); - } -} diff --git a/tests/Supportive/Fixtures/depfile-syntax-error.yaml b/tests/Supportive/Fixtures/depfile-syntax-error.yaml deleted file mode 100644 index b223e548d..000000000 --- a/tests/Supportive/Fixtures/depfile-syntax-error.yaml +++ /dev/null @@ -1,29 +0,0 @@ -deptrac: - paths: - - app/ - - layers: - - name: Controller - collectors: - - type: classLike - value: .*Controller.* - - name: ViewModel - collectors: - - type: classLike - value: ^(.*\\viewmodel\\.*)$ - - name: Service - collectors: - - type: classLike - value: .*\\service\\.* - - name: Business - collectors: - - type: classLike - value: .*\\business\\.* - ruleset: - ViewModel: - - Business - Controller: - - Service - - ViewModel - ViewModel: - - Business diff --git a/tests/Supportive/Fixtures/does-not-contain-array.yml b/tests/Supportive/Fixtures/does-not-contain-array.yml deleted file mode 100644 index ce0136250..000000000 --- a/tests/Supportive/Fixtures/does-not-contain-array.yml +++ /dev/null @@ -1 +0,0 @@ -hello diff --git a/tests/Supportive/OutputFormatter/BaselineOutputFormatterTest.php b/tests/Supportive/OutputFormatter/BaselineOutputFormatterTest.php deleted file mode 100644 index cb5eddba6..000000000 --- a/tests/Supportive/OutputFormatter/BaselineOutputFormatterTest.php +++ /dev/null @@ -1,155 +0,0 @@ -getName()); - } - - public static function basicDataProvider(): iterable - { - $originalA = ClassLikeToken::fromFQCN('OriginalA'); - $originalB = ClassLikeToken::fromFQCN('OriginalB'); - - yield [ - [ - new Violation( - new InheritDependency( - ClassLikeToken::fromFQCN('ClassA'), - ClassLikeToken::fromFQCN('ClassB'), - new Dependency($originalA, $originalB, new FileOccurrence('originalA.php', 12), DependencyType::PARAMETER), - (new AstInherit( - ClassLikeToken::fromFQCN('ClassInheritA'), new FileOccurrence('originalA.php', 3), - AstInheritType::EXTENDS - )) - ->replacePath([ - new AstInherit( - ClassLikeToken::fromFQCN('ClassInheritB'), - new FileOccurrence('originalA.php', 4), - AstInheritType::EXTENDS - ), - new AstInherit( - ClassLikeToken::fromFQCN('ClassInheritC'), - new FileOccurrence('originalA.php', 5), - AstInheritType::EXTENDS - ), - new AstInherit( - ClassLikeToken::fromFQCN('ClassInheritD'), - new FileOccurrence('originalA.php', 6), - AstInheritType::EXTENDS - ), - ]) - ), - 'LayerA', - 'LayerB', - new DummyViolationCreatingRule() - ), - ], - file_get_contents(__DIR__.'/data/expected-baseline-report_1.yml'), - ]; - - yield [ - [ - new Violation( - new Dependency($originalA, $originalB, new FileOccurrence('originalA.php', 12), DependencyType::PARAMETER), - 'LayerA', - 'LayerB', - new DummyViolationCreatingRule() - ), - ], - file_get_contents(__DIR__.'/data/expected-baseline-report_2.yml'), - ]; - - yield [ - [], - "deptrac:\n skip_violations: { }\n", - ]; - - yield [ - [ - new SkippedViolation( - new Dependency($originalA, $originalB, new FileOccurrence('originalA.php', 12), DependencyType::PARAMETER), - 'LayerA', - 'LayerB' - ), - ], - file_get_contents(__DIR__.'/data/expected-baseline-report_3.yml'), - ]; - - yield [ - [ - new Uncovered( - new Dependency($originalA, $originalB, new FileOccurrence('originalA.php', 12), DependencyType::PARAMETER), - 'LayerA' - ), - ], - file_get_contents(__DIR__.'/data/expected-baseline-report_4.yml'), - ]; - } - - /** - * @dataProvider basicDataProvider - */ - public function testBasic(array $rules, string $expectedOutput): void - { - $generatedBaselineFile = tempnam(sys_get_temp_dir(), 'deptrac_'); - - $analysisResult = new AnalysisResult(); - foreach ($rules as $rule) { - $analysisResult->addRule($rule); - } - - try { - $output = new BufferedOutput(); - - $formatter = new BaselineOutputFormatter(); - $formatter->finish( - OutputResult::fromAnalysisResult($analysisResult), - $this->createSymfonyOutput($output), - new OutputFormatterInput($generatedBaselineFile, false, false, false) - ); - - static::assertSame( - $expectedOutput, - file_get_contents($generatedBaselineFile) - ); - } finally { - unlink($generatedBaselineFile); - } - } - - private function createSymfonyOutput(BufferedOutput $bufferedOutput): SymfonyOutput - { - return new SymfonyOutput( - $bufferedOutput, - new Style(new SymfonyStyle($this->createMock(InputInterface::class), $bufferedOutput)) - ); - } -} diff --git a/tests/Supportive/OutputFormatter/CodeclimateOutputFormatterTest.php b/tests/Supportive/OutputFormatter/CodeclimateOutputFormatterTest.php deleted file mode 100644 index ab23d1fce..000000000 --- a/tests/Supportive/OutputFormatter/CodeclimateOutputFormatterTest.php +++ /dev/null @@ -1,497 +0,0 @@ - [ - [ - new Violation( - new InheritDependency( - ClassLikeToken::fromFQCN('ClassA'), - ClassLikeToken::fromFQCN('ClassB'), - new Dependency( - ClassLikeToken::fromFQCN('OriginalA'), - ClassLikeToken::fromFQCN('OriginalB'), new FileOccurrence('ClassA.php', 12), DependencyType::PARAMETER - ), - (new AstInherit( - ClassLikeToken::fromFQCN('ClassInheritA'), new FileOccurrence('ClassA.php', 3), - AstInheritType::EXTENDS - ))->replacePath( - [ - new AstInherit( - ClassLikeToken::fromFQCN('ClassInheritB'), - new FileOccurrence('ClassInheritA.php', 4), - AstInheritType::EXTENDS - ), - new AstInherit( - ClassLikeToken::fromFQCN('ClassInheritC'), - new FileOccurrence('ClassInheritB.php', 5), - AstInheritType::EXTENDS - ), - new AstInherit( - ClassLikeToken::fromFQCN('ClassInheritD'), - new FileOccurrence('ClassInheritC.php', 6), - AstInheritType::EXTENDS - ), - ] - ) - ), - 'LayerA', - 'LayerB', - new DummyViolationCreatingRule() - ), - new Violation( - new InheritDependency( - ClassLikeToken::fromFQCN('ClassC'), - ClassLikeToken::fromFQCN('ClassD'), - new Dependency( - ClassLikeToken::fromFQCN('OriginalA'), - ClassLikeToken::fromFQCN('OriginalB'), new FileOccurrence('ClassC.php', 12), DependencyType::PARAMETER - ), - (new AstInherit( - ClassLikeToken::fromFQCN('ClassInheritA'), new FileOccurrence('ClassA.php', 3), - AstInheritType::EXTENDS - ))->replacePath( - [ - new AstInherit( - ClassLikeToken::fromFQCN('ClassInheritB'), - new FileOccurrence('ClassInheritA.php', 4), - AstInheritType::EXTENDS - ), - new AstInherit( - ClassLikeToken::fromFQCN('ClassInheritC'), - new FileOccurrence('ClassInheritB.php', 5), - AstInheritType::EXTENDS - ), - new AstInherit( - ClassLikeToken::fromFQCN('ClassInheritD'), - new FileOccurrence('ClassInheritC.php', 6), - AstInheritType::EXTENDS - ), - ] - ) - ), - 'LayerA', - 'LayerC', - new DummyViolationCreatingRule() - ), - new Violation( - new InheritDependency( - ClassLikeToken::fromFQCN('ClassC'), - ClassLikeToken::fromFQCN('ClassE'), - new Dependency( - ClassLikeToken::fromFQCN('OriginalA'), - ClassLikeToken::fromFQCN('OriginalB'), new FileOccurrence('ClassC.php', 15), DependencyType::PARAMETER - ), - (new AstInherit( - ClassLikeToken::fromFQCN('ClassInheritA'), new FileOccurrence('ClassA.php', 3), - AstInheritType::EXTENDS - ))->replacePath( - [ - new AstInherit( - ClassLikeToken::fromFQCN('ClassInheritB'), - new FileOccurrence('ClassInheritA.php', 4), - AstInheritType::EXTENDS - ), - new AstInherit( - ClassLikeToken::fromFQCN('ClassInheritC'), - new FileOccurrence('ClassInheritB.php', 5), - AstInheritType::EXTENDS - ), - new AstInherit( - ClassLikeToken::fromFQCN('ClassInheritD'), - new FileOccurrence('ClassInheritC.php', 6), - AstInheritType::EXTENDS - ), - ] - ) - ), - 'LayerA', - 'LayerE', - new DummyViolationCreatingRule() - ), - ], - 'expected-codeclimate-report_1.json', - ]; - - yield [ - [ - new Violation( - new Dependency( - ClassLikeToken::fromFQCN('OriginalA'), - ClassLikeToken::fromFQCN('OriginalB'), new FileOccurrence('ClassA.php', 12), DependencyType::PARAMETER - ), - 'LayerA', - 'LayerB', - new DummyViolationCreatingRule() - ), - ], - 'expected-codeclimate-report_2.json', - ]; - - yield [ - [], - 'expected-codeclimate-report_3.json', - ]; - - yield [ - [ - new SkippedViolation( - new InheritDependency( - ClassLikeToken::fromFQCN('ClassA'), - ClassLikeToken::fromFQCN('ClassB'), - new Dependency( - ClassLikeToken::fromFQCN('OriginalA'), - ClassLikeToken::fromFQCN('OriginalB'), new FileOccurrence('ClassA.php', 12), DependencyType::PARAMETER - ), - (new AstInherit( - ClassLikeToken::fromFQCN('ClassInheritA'), new FileOccurrence('ClassA.php', 3), - AstInheritType::EXTENDS - ))->replacePath( - [ - new AstInherit( - ClassLikeToken::fromFQCN('ClassInheritB'), - new FileOccurrence('ClassInheritA.php', 4), - AstInheritType::EXTENDS - ), - new AstInherit( - ClassLikeToken::fromFQCN('ClassInheritC'), - new FileOccurrence('ClassInheritB.php', 5), - AstInheritType::EXTENDS - ), - new AstInherit( - ClassLikeToken::fromFQCN('ClassInheritD'), - new FileOccurrence('ClassInheritC.php', 6), - AstInheritType::EXTENDS - ), - ] - ) - ), - 'LayerA', - 'LayerB' - ), - new SkippedViolation( - new InheritDependency( - ClassLikeToken::fromFQCN('ClassC'), - ClassLikeToken::fromFQCN('ClassD'), - new Dependency( - ClassLikeToken::fromFQCN('OriginalA'), - ClassLikeToken::fromFQCN('OriginalB'), new FileOccurrence('ClassC.php', 12), DependencyType::PARAMETER - ), - (new AstInherit( - ClassLikeToken::fromFQCN('ClassInheritA'), new FileOccurrence('ClassA.php', 3), - AstInheritType::EXTENDS - ))->replacePath( - [ - new AstInherit( - ClassLikeToken::fromFQCN('ClassInheritB'), - new FileOccurrence('ClassInheritA.php', 4), - AstInheritType::EXTENDS - ), - new AstInherit( - ClassLikeToken::fromFQCN('ClassInheritC'), - new FileOccurrence('ClassInheritB.php', 5), - AstInheritType::EXTENDS - ), - new AstInherit( - ClassLikeToken::fromFQCN('ClassInheritD'), - new FileOccurrence('ClassInheritC.php', 6), - AstInheritType::EXTENDS - ), - ] - ) - ), - 'LayerA', - 'LayerB' - ), - ], - 'expected-codeclimate-report_4.json', - true, - ]; - - $multipleViolationTypes = [ - new Violation( - new InheritDependency( - ClassLikeToken::fromFQCN('ClassA'), - ClassLikeToken::fromFQCN('ClassB'), - new Dependency( - ClassLikeToken::fromFQCN('OriginalA'), - ClassLikeToken::fromFQCN('OriginalB'), new FileOccurrence('ClassA.php', 12), DependencyType::PARAMETER - ), - (new AstInherit( - ClassLikeToken::fromFQCN('ClassInheritA'), new FileOccurrence('ClassA.php', 3), - AstInheritType::EXTENDS - ))->replacePath( - [ - new AstInherit( - ClassLikeToken::fromFQCN('ClassInheritB'), new FileOccurrence('ClassInheritA.php', 4), - AstInheritType::EXTENDS - ), - new AstInherit( - ClassLikeToken::fromFQCN('ClassInheritC'), new FileOccurrence('ClassInheritB.php', 5), - AstInheritType::EXTENDS - ), - new AstInherit( - ClassLikeToken::fromFQCN('ClassInheritD'), new FileOccurrence('ClassInheritC.php', 6), - AstInheritType::EXTENDS - ), - ] - ) - ), - 'LayerA', - 'LayerB', - new DummyViolationCreatingRule() - ), - new SkippedViolation( - new InheritDependency( - ClassLikeToken::fromFQCN('ClassA'), - ClassLikeToken::fromFQCN('ClassB'), - new Dependency( - ClassLikeToken::fromFQCN('OriginalA'), - ClassLikeToken::fromFQCN('OriginalB'), new FileOccurrence('ClassA.php', 15), DependencyType::PARAMETER - ), - (new AstInherit( - ClassLikeToken::fromFQCN('ClassInheritA'), new FileOccurrence('ClassA.php', 3), - AstInheritType::EXTENDS - ))->replacePath( - [ - new AstInherit( - ClassLikeToken::fromFQCN('ClassInheritB'), new FileOccurrence('ClassInheritA.php', 4), - AstInheritType::EXTENDS - ), - new AstInherit( - ClassLikeToken::fromFQCN('ClassInheritC'), new FileOccurrence('ClassInheritB.php', 5), - AstInheritType::EXTENDS - ), - new AstInherit( - ClassLikeToken::fromFQCN('ClassInheritD'), new FileOccurrence('ClassInheritC.php', 6), - AstInheritType::EXTENDS - ), - ] - ) - ), - 'LayerA', - 'LayerB' - ), - new SkippedViolation( - new InheritDependency( - ClassLikeToken::fromFQCN('ClassC'), - ClassLikeToken::fromFQCN('ClassD'), - new Dependency( - ClassLikeToken::fromFQCN('OriginalA'), - ClassLikeToken::fromFQCN('OriginalB'), new FileOccurrence('ClassC.php', 12), DependencyType::PARAMETER - ), - (new AstInherit( - ClassLikeToken::fromFQCN('ClassInheritA'), new FileOccurrence('ClassA.php', 3), - AstInheritType::EXTENDS - ))->replacePath( - [ - new AstInherit( - ClassLikeToken::fromFQCN('ClassInheritB'), new FileOccurrence('ClassInheritA.php', 4), - AstInheritType::EXTENDS - ), - new AstInherit( - ClassLikeToken::fromFQCN('ClassInheritC'), new FileOccurrence('ClassInheritB.php', 5), - AstInheritType::EXTENDS - ), - new AstInherit( - ClassLikeToken::fromFQCN('ClassInheritD'), new FileOccurrence('ClassInheritC.php', 6), - AstInheritType::EXTENDS - ), - ] - ) - ), - 'LayerA', - 'LayerB' - ), - new Uncovered( - new Dependency( - ClassLikeToken::fromFQCN('OriginalA'), - ClassLikeToken::fromFQCN('OriginalB'), new FileOccurrence('OriginalA.php', 12), DependencyType::PARAMETER - ), - 'LayerA' - ), - ]; - - yield 'Different violations types in one report' => [ - $multipleViolationTypes, - 'expected-codeclimate-report_5.json', - true, - true, - ]; - - yield 'Check custom severities for different violation types in one report' => [ - $multipleViolationTypes, - 'expected-codeclimate-report_6.json', - true, - true, - [ - 'severity' => [ - 'failure' => 'blocker', - 'skipped' => 'critical', - 'uncovered' => 'minor', - ], - ], - ]; - } - - /** - * @dataProvider basicDataProvider - */ - public function testFileOutput( - array $rules, - $expectedOutputFile, - bool $reportSkipped = false, - bool $reportUncovered = false, - array $inputConfig = [] - ): void { - $bufferedOutput = new BufferedOutput(); - - $analysisResult = new AnalysisResult(); - foreach ($rules as $rule) { - $analysisResult->addRule($rule); - } - - $formatter = new CodeclimateOutputFormatter(new FormatterConfiguration([ - 'codeclimate' => $inputConfig, - ])); - $formatter->finish( - OutputResult::fromAnalysisResult($analysisResult), - $this->createSymfonyOutput($bufferedOutput), - new OutputFormatterInput( - __DIR__.'/data/'.self::$actual_codeclimate_report_file, - $reportSkipped, - $reportUncovered, - false, - ) - ); - - self::assertJsonFileEqualsJsonFile( - __DIR__.'/data/'.self::$actual_codeclimate_report_file, - __DIR__.'/data/'.$expectedOutputFile - ); - } - - /** - * @dataProvider basicDataProvider - */ - public function testConsoleOutput( - array $rules, - $expectedOutputFile, - bool $reportSkipped = false, - bool $reportUncovered = false, - array $inputConfig = [] - ): void { - $bufferedOutput = new BufferedOutput(); - - $formatter = new CodeclimateOutputFormatter(new FormatterConfiguration([ - 'codeclimate' => $inputConfig, - ])); - - $analysisResult = new AnalysisResult(); - foreach ($rules as $rule) { - $analysisResult->addRule($rule); - } - - $formatter->finish( - OutputResult::fromAnalysisResult($analysisResult), - $this->createSymfonyOutput($bufferedOutput), - new OutputFormatterInput( - null, - $reportSkipped, - $reportUncovered, - false - ) - ); - - self::assertJsonStringEqualsJsonFile( - __DIR__.'/data/'.$expectedOutputFile, - $bufferedOutput->fetch() - ); - } - - public function testJsonRenderError(): void - { - $bufferedOutput = new BufferedOutput(); - $formatter = new CodeclimateOutputFormatter(new FormatterConfiguration([])); - - $malformedCharacters = "\xB1\x31"; - $violation = new Violation( - new Dependency( - ClassLikeToken::fromFQCN('OriginalA'), - ClassLikeToken::fromFQCN('OriginalB'.$malformedCharacters), new FileOccurrence('ClassA.php', 12), DependencyType::PARAMETER - ), - 'LayerA', - 'LayerB', - new DummyViolationCreatingRule() - ); - - $analysisResult = new AnalysisResult(); - $analysisResult->addRule($violation); - - self::expectException(Exception::class); - self::expectExceptionMessage('Unable to render codeclimate output. ' - .'Malformed UTF-8 characters, possibly incorrectly encoded'); - $formatter->finish( - OutputResult::fromAnalysisResult($analysisResult), - $this->createSymfonyOutput($bufferedOutput), - new OutputFormatterInput( - null, - false, - false, - false, - ) - ); - } - - private function createSymfonyOutput(BufferedOutput $bufferedOutput): SymfonyOutput - { - return new SymfonyOutput( - $bufferedOutput, - new Style(new SymfonyStyle($this->createMock(InputInterface::class), $bufferedOutput)) - ); - } -} diff --git a/tests/Supportive/OutputFormatter/ConfigurationCodeclimateTest.php b/tests/Supportive/OutputFormatter/ConfigurationCodeclimateTest.php deleted file mode 100644 index 778baa4a2..000000000 --- a/tests/Supportive/OutputFormatter/ConfigurationCodeclimateTest.php +++ /dev/null @@ -1,30 +0,0 @@ - [ - 'failure' => 'blocker', - 'skipped' => 'critical', - 'uncovered' => 'info', - ], - ]; - $config = ConfigurationCodeclimate::fromArray($arr); - - self::assertSame('blocker', $config->getSeverity('failure')); - self::assertSame('critical', $config->getSeverity('skipped')); - self::assertSame('info', $config->getSeverity('uncovered')); - } -} diff --git a/tests/Supportive/OutputFormatter/ConfigurationGraphVizTest.php b/tests/Supportive/OutputFormatter/ConfigurationGraphVizTest.php deleted file mode 100644 index b4072fac9..000000000 --- a/tests/Supportive/OutputFormatter/ConfigurationGraphVizTest.php +++ /dev/null @@ -1,36 +0,0 @@ - [ - 'layer1', - 'layer2', - ], - ]; - $pointToGroups = true; - $arr = [ - 'hidden_layers' => $hiddenLayers, - 'groups' => $groups, - 'point_to_groups' => $pointToGroups, - ]; - $configurationGraphViz = ConfigurationGraphViz::fromArray($arr); - - self::assertSame($hiddenLayers, $configurationGraphViz->hiddenLayers); - self::assertSame($groups, $configurationGraphViz->groupsLayerMap); - self::assertSame($pointToGroups, $configurationGraphViz->pointToGroups); - } -} diff --git a/tests/Supportive/OutputFormatter/ConsoleOutputFormatterTest.php b/tests/Supportive/OutputFormatter/ConsoleOutputFormatterTest.php deleted file mode 100644 index 70c56181b..000000000 --- a/tests/Supportive/OutputFormatter/ConsoleOutputFormatterTest.php +++ /dev/null @@ -1,294 +0,0 @@ -getName()); - } - - public static function basicDataProvider(): iterable - { - $originalA = ClassLikeToken::fromFQCN('OriginalA'); - $originalB = ClassLikeToken::fromFQCN('OriginalB'); - - yield [ - [ - new Violation( - new InheritDependency( - ClassLikeToken::fromFQCN('ClassA'), - ClassLikeToken::fromFQCN('ClassB'), - new Dependency($originalA, $originalB, new FileOccurrence('originalA.php', 12), DependencyType::PARAMETER), - (new AstInherit( - ClassLikeToken::fromFQCN('ClassInheritA'), new FileOccurrence('originalA.php', 3), - AstInheritType::EXTENDS - )) - ->replacePath([ - new AstInherit( - ClassLikeToken::fromFQCN('ClassInheritB'), - new FileOccurrence('originalA.php', 4), - AstInheritType::EXTENDS - ), - new AstInherit( - ClassLikeToken::fromFQCN('ClassInheritC'), - new FileOccurrence('originalA.php', 5), - AstInheritType::EXTENDS - ), - new AstInherit( - ClassLikeToken::fromFQCN('ClassInheritD'), - new FileOccurrence('originalA.php', 6), - AstInheritType::EXTENDS - ), - ]) - ), - 'LayerA', - 'LayerB', - new DummyViolationCreatingRule() - ), - ], - [], - 'warnings' => [], - ' - ClassA must not depend on ClassB (LayerA on LayerB) - originalA.php::12 - ClassInheritD::6 -> - ClassInheritC::5 -> - ClassInheritB::4 -> - ClassInheritA::3 -> - OriginalB::12 - - Report: - Violations: 1 - Skipped violations: 0 - Uncovered: 0 - Allowed: 0 - Warnings:0 - Errors:0 - ', - ]; - - yield [ - [ - new Violation( - new Dependency($originalA, $originalB, new FileOccurrence('originalA.php', 12), DependencyType::PARAMETER), - 'LayerA', - 'LayerB', - new DummyViolationCreatingRule() - ), - ], - [], - 'warnings' => [], - ' - OriginalA must not depend on OriginalB (LayerA on LayerB) - originalA.php::12 - - Report: - Violations: 1 - Skipped violations: 0 - Uncovered: 0 - Allowed: 0 - Warnings:0 - Errors:0 - ', - ]; - - yield [ - [], - [], - 'warnings' => [], - ' - - Report: - Violations: 0 - Skipped violations: 0 - Uncovered: 0 - Allowed: 0 - Warnings:0 - Errors:0 - ', - ]; - - yield [ - [ - new SkippedViolation( - new Dependency($originalA, $originalB, new FileOccurrence('originalA.php', 12), DependencyType::PARAMETER), - 'LayerA', - 'LayerB' - ), - ], - [], - 'warnings' => [], - '[SKIPPED] OriginalA must not depend on OriginalB (LayerA on LayerB) - originalA.php::12 - - Report: - Violations: 0 - Skipped violations: 1 - Uncovered: 0 - Allowed: 0 - Warnings:0 - Errors:0 - ', - ]; - - yield [ - [ - new Uncovered( - new Dependency($originalA, $originalB, new FileOccurrence('originalA.php', 12), DependencyType::PARAMETER), - 'LayerA' - ), - ], - [], - 'warnings' => [], - ' - Uncovered dependencies: - OriginalA has uncovered dependency on OriginalB (LayerA) - originalA.php::12 - Report: - Violations: 0 - Skipped violations: 0 - Uncovered: 1 - Allowed: 0 - Warnings:0 - Errors:0 - ', - ]; - - yield 'an error occurred' => [ - [], - [new Error('an error occurred')], - 'warnings' => [], - '[ERROR]anerroroccurredReport:Violations:0Skippedviolations:0Uncovered:0Allowed:0Warnings:0Errors:1', - ]; - - yield 'an warning occurred' => [ - [], - [], - 'warnings' => [Warning::tokenIsInMoreThanOneLayer(ClassLikeToken::fromFQCN('Foo\Bar')->toString(), ['Layer 1', 'Layer 2'])], - '[WARNING]Foo\Barisinmorethanonelayer["Layer1","Layer2"].Itisrecommendedthatonetokenshouldonlybeinonelayer.Report:Violations:0Skippedviolations:0Uncovered:0Allowed:0Warnings:1Errors:0', - ]; - } - - /** - * @dataProvider basicDataProvider - */ - public function testBasic(array $rules, array $errors, array $warnings, string $expectedOutput): void - { - $bufferedOutput = new BufferedOutput(); - $output = new SymfonyOutput( - $bufferedOutput, - new Style(new SymfonyStyle($this->createMock(InputInterface::class), $bufferedOutput)) - ); - - $analysisResult = new AnalysisResult(); - foreach ($rules as $rule) { - $analysisResult->addRule($rule); - } - foreach ($errors as $error) { - $analysisResult->addError($error); - } - foreach ($warnings as $warning) { - $analysisResult->addWarning($warning); - } - - $formatter = new ConsoleOutputFormatter(); - $formatter->finish( - OutputResult::fromAnalysisResult($analysisResult), - $output, - new OutputFormatterInput( - null, - true, - true, - false, - ) - ); - - $o = $bufferedOutput->fetch(); - self::assertSame( - $this->normalize($expectedOutput), - $this->normalize($o) - ); - } - - public function testWithoutSkippedViolations(): void - { - $originalA = ClassLikeToken::fromFQCN('OriginalA'); - $originalB = ClassLikeToken::fromFQCN('OriginalB'); - - $analysisResult = new AnalysisResult(); - $analysisResult->addRule(new SkippedViolation( - new Dependency($originalA, $originalB, new FileOccurrence('originalA.php', 12), DependencyType::PARAMETER), - 'LayerA', - 'LayerB' - )); - - $bufferedOutput = new BufferedOutput(); - $output = new SymfonyOutput( - $bufferedOutput, - new Style(new SymfonyStyle($this->createMock(InputInterface::class), $bufferedOutput)) - ); - - $formatter = new ConsoleOutputFormatter(); - $formatter->finish( - OutputResult::fromAnalysisResult($analysisResult), - $output, - new OutputFormatterInput( - null, - false, - true, - false, - ) - ); - - $o = $bufferedOutput->fetch(); - - $expectedOutput = ' - - Report: - Violations: 0 - Skipped violations: 1 - Uncovered: 0 - Allowed: 0 - Warnings:0 - Errors:0 - '; - - self::assertSame( - $this->normalize($expectedOutput), - $this->normalize($o) - ); - } - - private function normalize($str) - { - return str_replace(["\r", "\t", "\n", ' '], '', $str); - } -} diff --git a/tests/Supportive/OutputFormatter/FormatterProviderTest.php b/tests/Supportive/OutputFormatter/FormatterProviderTest.php deleted file mode 100644 index ad75c966a..000000000 --- a/tests/Supportive/OutputFormatter/FormatterProviderTest.php +++ /dev/null @@ -1,49 +0,0 @@ - static function () { return new ConsoleOutputFormatter(); }, - TableOutputFormatter::getName() => static function () { return new TableOutputFormatter(); }, - ])); - - self::assertTrue($formatterProvider->has(ConsoleOutputFormatter::getName())); - self::assertInstanceOf(ConsoleOutputFormatter::class, $formatterProvider->get(ConsoleOutputFormatter::getName())); - self::assertTrue($formatterProvider->has(TableOutputFormatter::getName())); - self::assertInstanceOf(TableOutputFormatter::class, $formatterProvider->get(TableOutputFormatter::getName())); - self::assertSame([ - ConsoleOutputFormatter::getName(), - TableOutputFormatter::getName(), - ], $formatterProvider->getKnownFormatters()); - } - - public function testContainerHasInvalidService(): void - { - $this->expectException(InvalidServiceInLocatorException::class); - $this->expectExceptionMessage('Trying to get unsupported service "formatter1" from locator (expected "Qossmic\\Deptrac\\Contract\\OutputFormatter\\OutputFormatterInterface", but is "stdClass").'); - - (new FormatterProvider(new ServiceLocator(['formatter1' => static fn () => new stdClass()])))->get('formatter1'); - } - - public function testContainerIsEmpty(): void - { - $this->expectException(ServiceNotFoundException::class); - - (new FormatterProvider(new ServiceLocator([])))->get('formatter1'); - } -} diff --git a/tests/Supportive/OutputFormatter/GithubActionsOutputFormatterTest.php b/tests/Supportive/OutputFormatter/GithubActionsOutputFormatterTest.php deleted file mode 100644 index 17f5b6038..000000000 --- a/tests/Supportive/OutputFormatter/GithubActionsOutputFormatterTest.php +++ /dev/null @@ -1,254 +0,0 @@ -getName()); - } - - /** - * @dataProvider finishProvider - */ - public function testFinish(array $rules, array $errors, array $warnings, string $expectedOutput): void - { - $bufferedOutput = new BufferedOutput(); - - $analysisResult = new AnalysisResult(); - foreach ($rules as $rule) { - $analysisResult->addRule($rule); - } - foreach ($errors as $error) { - $analysisResult->addError($error); - } - foreach ($warnings as $warning) { - $analysisResult->addWarning($warning); - } - - $formatter = new GithubActionsOutputFormatter(); - $formatter->finish( - OutputResult::fromAnalysisResult($analysisResult), - $this->createSymfonyOutput($bufferedOutput), - new OutputFormatterInput( - null, - true, - true, - false - ) - ); - - self::assertSame($expectedOutput, $bufferedOutput->fetch()); - } - - public static function finishProvider(): iterable - { - yield 'No Rules, No Output' => [ - 'rules' => [], - 'errors' => [], - 'warnings' => [], - '', - ]; - - $originalA = ClassLikeToken::fromFQCN('\ACME\OriginalA'); - $originalB = ClassLikeToken::fromFQCN('\ACME\OriginalB'); - $originalAOccurrence = new FileOccurrence('/home/testuser/originalA.php', 12); - - yield 'Simple Violation' => [ - 'violations' => [ - new Violation( - new Dependency($originalA, $originalB, $originalAOccurrence, DependencyType::PARAMETER), - 'LayerA', - 'LayerB', - new DummyViolationCreatingRule() - ), - ], - 'errors' => [], - 'warnings' => [], - "::error file=/home/testuser/originalA.php,line=12::ACME\OriginalA must not depend on ACME\OriginalB (LayerA on LayerB)".PHP_EOL, - ]; - - yield 'Skipped Violation' => [ - 'violations' => [ - new SkippedViolation( - new Dependency($originalA, $originalB, $originalAOccurrence, DependencyType::PARAMETER), - 'LayerA', - 'LayerB' - ), - ], - 'errors' => [], - 'warnings' => [], - "::warning file=/home/testuser/originalA.php,line=12::[SKIPPED] ACME\OriginalA must not depend on ACME\OriginalB (LayerA on LayerB)".PHP_EOL, - ]; - - yield 'Uncovered Dependency' => [ - 'violations' => [ - new Uncovered( - new Dependency($originalA, $originalB, $originalAOccurrence, DependencyType::PARAMETER), - 'LayerA' - ), - ], - 'errors' => [], - 'warnings' => [], - "::warning file=/home/testuser/originalA.php,line=12::ACME\OriginalA has uncovered dependency on ACME\OriginalB (LayerA)".PHP_EOL, - ]; - - yield 'Inherit dependency' => [ - 'violations' => [ - new Violation( - new InheritDependency( - ClassLikeToken::fromFQCN('ClassA'), - ClassLikeToken::fromFQCN('ClassB'), - new Dependency($originalA, $originalB, new FileOccurrence('originalA.php', 12), DependencyType::PARAMETER), - (new AstInherit( - ClassLikeToken::fromFQCN('ClassInheritA'), new FileOccurrence('originalA.php', 3), - AstInheritType::EXTENDS - )) - ->replacePath([ - new AstInherit( - ClassLikeToken::fromFQCN('ClassInheritB'), - new FileOccurrence('originalA.php', 4), - AstInheritType::EXTENDS - ), - new AstInherit( - ClassLikeToken::fromFQCN('ClassInheritC'), - new FileOccurrence('originalA.php', 5), - AstInheritType::EXTENDS - ), - new AstInherit( - ClassLikeToken::fromFQCN('ClassInheritD'), - new FileOccurrence('originalA.php', 6), - AstInheritType::EXTENDS - ), - ]) - ), - 'LayerA', - 'LayerB', - new DummyViolationCreatingRule() - ), - ], - 'errors' => [], - 'warnings' => [], - "::error file=originalA.php,line=12::ClassA must not depend on ClassB (LayerA on LayerB)%0AClassInheritD::6 ->%0AClassInheritC::5 ->%0AClassInheritB::4 ->%0AClassInheritA::3 ->%0AACME\OriginalB::12".PHP_EOL, - ]; - - yield 'an error occurred' => [ - 'violations' => [], - 'errors' => [new Error('an error occurred')], - 'warnings' => [], - '::error ::an error occurred'.PHP_EOL, - ]; - - yield 'an warning occurred' => [ - 'violations' => [], - 'errors' => [], - 'warnings' => [ - Warning::tokenIsInMoreThanOneLayer(ClassLikeToken::fromFQCN('Foo\Bar')->toString(), ['Layer 1', 'Layer 2']), - ], - "::warning ::Foo\Bar is in more than one layer [\"Layer 1\", \"Layer 2\"]. It is recommended that one token should only be in one layer.".PHP_EOL, - ]; - } - - public function testWithoutSkippedViolations(): void - { - $originalA = ClassLikeToken::fromFQCN('\ACME\OriginalA'); - $originalB = ClassLikeToken::fromFQCN('\ACME\OriginalB'); - $originalAOccurrence = new FileOccurrence('/home/testuser/originalA.php', 12); - - $analysisResult = new AnalysisResult(); - $analysisResult->addRule( - new SkippedViolation( - new Dependency($originalA, $originalB, $originalAOccurrence, DependencyType::PARAMETER), - 'LayerA', - 'LayerB' - ) - ); - - $bufferedOutput = new BufferedOutput(); - - $formatter = new GithubActionsOutputFormatter(); - $formatter->finish( - OutputResult::fromAnalysisResult($analysisResult), - $this->createSymfonyOutput($bufferedOutput), - new OutputFormatterInput( - null, - false, - true, - false, - ) - ); - - self::assertSame('', $bufferedOutput->fetch()); - } - - public function testUncoveredWithFailOnUncoveredAreReportedAsError(): void - { - $originalA = ClassLikeToken::fromFQCN('\ACME\OriginalA'); - $originalB = ClassLikeToken::fromFQCN('\ACME\OriginalB'); - $originalAOccurrence = new FileOccurrence('/home/testuser/originalA.php', 12); - - $analysisResult = new AnalysisResult(); - $analysisResult->addRule( - new Uncovered( - new Dependency($originalA, $originalB, $originalAOccurrence, DependencyType::PARAMETER), - 'LayerA' - ) - ); - - $bufferedOutput = new BufferedOutput(); - - $formatter = new GithubActionsOutputFormatter(); - $formatter->finish( - OutputResult::fromAnalysisResult($analysisResult), - $this->createSymfonyOutput($bufferedOutput), - new OutputFormatterInput( - null, - false, - true, - true, - ) - ); - - self::assertSame( - "::error file=/home/testuser/originalA.php,line=12::ACME\OriginalA has uncovered dependency on ACME\OriginalB (LayerA)".PHP_EOL, - $bufferedOutput->fetch() - ); - } - - private function createSymfonyOutput(BufferedOutput $bufferedOutput): SymfonyOutput - { - return new SymfonyOutput( - $bufferedOutput, - new Style(new SymfonyStyle($this->createMock(InputInterface::class), $bufferedOutput)) - ); - } -} diff --git a/tests/Supportive/OutputFormatter/GraphVizDotOutputFormatterTest.php b/tests/Supportive/OutputFormatter/GraphVizDotOutputFormatterTest.php deleted file mode 100644 index 57d637de9..000000000 --- a/tests/Supportive/OutputFormatter/GraphVizDotOutputFormatterTest.php +++ /dev/null @@ -1,188 +0,0 @@ -addRule(new Violation(new Dependency($classA, ClassLikeToken::fromFQCN('ClassB'), $fileOccurrenceA, DependencyType::PARAMETER), 'LayerA', 'LayerB', new DummyViolationCreatingRule())); - $analysisResult->addRule(new Violation(new Dependency($classA, ClassLikeToken::fromFQCN('ClassHidden'), $fileOccurrenceA, DependencyType::PARAMETER), 'LayerA', 'LayerHidden', new DummyViolationCreatingRule())); - $analysisResult->addRule(new Violation(new Dependency(ClassLikeToken::fromFQCN('ClassAB'), ClassLikeToken::fromFQCN('ClassBA'), - new FileOccurrence('classAB.php', 1), DependencyType::PARAMETER - ), 'LayerA', 'LayerB', new DummyViolationCreatingRule())); - $analysisResult->addRule(new Allowed(new Dependency($classA, ClassLikeToken::fromFQCN('ClassC'), $fileOccurrenceA, DependencyType::PARAMETER), 'LayerA', 'LayerC')); - $analysisResult->addRule(new Uncovered(new Dependency($classA, ClassLikeToken::fromFQCN('ClassD'), $fileOccurrenceA, DependencyType::PARAMETER), 'LayerC')); - - $bufferedOutput = new BufferedOutput(); - $input = new OutputFormatterInput( - $dotFile, - false, - false, - false, - ); - - (new GraphVizOutputDotFormatter(new FormatterConfiguration([ - 'graphviz' => [ - 'hidden_layers' => [ - 'LayerHidden', - ], - 'groups' => [], - 'point_to_groups' => false, - ], - ])))->finish(OutputResult::fromAnalysisResult($analysisResult), $this->createSymfonyOutput($bufferedOutput), $input); - - self::assertSame(sprintf('Script dumped to %s'.PHP_EOL, Path::normalize($dotFile)), Path::normalize($bufferedOutput->fetch())); - - $this->replaceWindowsLineEndings($dotFile); - - self::assertFileEquals(__DIR__.'/data/graphviz-expected.dot', $dotFile); - - unlink($dotFile); - } - - public function testGroups(): void - { - $dotFile = __DIR__.'/data/graphviz.dot'; - - $dependency = new Dependency( - ClassLikeToken::fromFQCN('ClassA'), - ClassLikeToken::fromFQCN('ClassC'), new FileOccurrence('classA.php', 0), DependencyType::PARAMETER - ); - - $analysisResult = new AnalysisResult(); - $analysisResult->addRule(new Allowed($dependency, 'User Frontend', 'User Backend')); - $analysisResult->addRule(new Allowed($dependency, 'Admin', 'Admin Backend')); - $analysisResult->addRule(new Allowed($dependency, 'User Frontend', 'Admin')); - $analysisResult->addRule(new Allowed($dependency, 'User Backend', 'Admin')); - - $bufferedOutput = new BufferedOutput(); - $input = new OutputFormatterInput( - $dotFile, - false, - false, - false, - ); - - (new GraphVizOutputDotFormatter(new FormatterConfiguration([ - 'graphviz' => [ - 'hidden_layers' => [], - 'groups' => [ - 'User' => [ - 'User Frontend', - 'User Backend', - ], - 'Admin' => [ - 'Admin', - 'Admin Backend', - ], - ], - 'point_to_groups' => false, - ], - ])))->finish(OutputResult::fromAnalysisResult($analysisResult), $this->createSymfonyOutput($bufferedOutput), $input); - - self::assertSame(sprintf('Script dumped to %s'.PHP_EOL, Path::normalize($dotFile)), Path::normalize($bufferedOutput->fetch())); - - $this->replaceWindowsLineEndings($dotFile); - - self::assertFileEquals(__DIR__.'/data/graphviz-groups.dot', $dotFile); - - unlink($dotFile); - } - - public function testPointToGroups(): void - { - $dotFile = __DIR__.'/data/graphviz.dot'; - - $dependency = new Dependency( - ClassLikeToken::fromFQCN('ClassA'), - ClassLikeToken::fromFQCN('ClassC'), new FileOccurrence('classA.php', 0), DependencyType::PARAMETER - ); - - $analysisResult = new AnalysisResult(); - $analysisResult->addRule(new Allowed($dependency, 'User Frontend', 'User Backend')); - $analysisResult->addRule(new Allowed($dependency, 'Admin', 'Admin Backend')); - $analysisResult->addRule(new Allowed($dependency, 'User Frontend', 'Admin')); - $analysisResult->addRule(new Allowed($dependency, 'User Backend', 'Admin')); - - $bufferedOutput = new BufferedOutput(); - $input = new OutputFormatterInput( - $dotFile, - false, - false, - false, - ); - - (new GraphVizOutputDotFormatter(new FormatterConfiguration([ - 'graphviz' => [ - 'hidden_layers' => [], - 'groups' => [ - 'User' => [ - 'User Frontend', - 'User Backend', - ], - 'Admin' => [ - 'Admin', - 'Admin Backend', - ], - ], - 'point_to_groups' => true, - ], - ])))->finish(OutputResult::fromAnalysisResult($analysisResult), $this->createSymfonyOutput($bufferedOutput), $input); - - self::assertSame(sprintf('Script dumped to %s'.PHP_EOL, Path::normalize($dotFile)), Path::normalize($bufferedOutput->fetch())); - - $this->replaceWindowsLineEndings($dotFile); - - self::assertFileEquals(__DIR__.'/data/graphviz-groups-point.dot', $dotFile); - - unlink($dotFile); - } - - private function createSymfonyOutput(BufferedOutput $bufferedOutput): SymfonyOutput - { - return new SymfonyOutput( - $bufferedOutput, - new Style(new SymfonyStyle($this->createMock(InputInterface::class), $bufferedOutput)) - ); - } - - private function replaceWindowsLineEndings($expectedFile): void - { - if ("\n" !== PHP_EOL) { - // fix line endings on windows to match with the files in git - file_put_contents($expectedFile, str_replace(PHP_EOL, "\n", file_get_contents($expectedFile))); - } - } -} diff --git a/tests/Supportive/OutputFormatter/JUnitOutputFormatterTest.php b/tests/Supportive/OutputFormatter/JUnitOutputFormatterTest.php deleted file mode 100644 index 31a689ce4..000000000 --- a/tests/Supportive/OutputFormatter/JUnitOutputFormatterTest.php +++ /dev/null @@ -1,214 +0,0 @@ -getName()); - } - - public static function basicDataProvider(): iterable - { - $originalA = ClassLikeToken::fromFQCN('OriginalA'); - $originalB = ClassLikeToken::fromFQCN('OriginalB'); - $classInheritA = ClassLikeToken::fromFQCN('ClassInheritA'); - $classInheritB = ClassLikeToken::fromFQCN('ClassInheritB'); - $classInheritC = ClassLikeToken::fromFQCN('ClassInheritC'); - $classInheritD = ClassLikeToken::fromFQCN('ClassInheritD'); - - yield [ - [ - new Violation( - new InheritDependency( - ClassLikeToken::fromFQCN('ClassA'), - ClassLikeToken::fromFQCN('ClassB'), - new Dependency($originalA, $originalB, new FileOccurrence('foo.php', 12), DependencyType::PARAMETER), - (new AstInherit( - $classInheritA, new FileOccurrence('foo.php', 3), - AstInheritType::EXTENDS - ))->replacePath([ - new AstInherit( - $classInheritB, new FileOccurrence('foo.php', 4), - AstInheritType::EXTENDS - ), - new AstInherit( - $classInheritC, new FileOccurrence('foo.php', 5), - AstInheritType::EXTENDS - ), - new AstInherit( - $classInheritD, new FileOccurrence('foo.php', 6), - AstInheritType::EXTENDS - ), - ]) - ), - 'LayerA', - 'LayerB', - new DummyViolationCreatingRule() - ), - ], - 'expected-junit-report_1.xml', - ]; - - yield [ - [ - new Violation( - new Dependency($originalA, $originalB, new FileOccurrence('foo.php', 12), DependencyType::PARAMETER), - 'LayerA', - 'LayerB', - new DummyViolationCreatingRule() - ), - ], - 'expected-junit-report_2.xml', - ]; - - yield [ - [], - 'expected-junit-report_3.xml', - ]; - - yield [ - [ - new SkippedViolation( - new InheritDependency( - ClassLikeToken::fromFQCN('ClassA'), - ClassLikeToken::fromFQCN('ClassB'), - new Dependency($originalA, $originalB, new FileOccurrence('foo.php', 12), DependencyType::PARAMETER), - (new AstInherit( - $classInheritA, new FileOccurrence('foo.php', 3), - AstInheritType::EXTENDS - ))->replacePath([ - new AstInherit( - $classInheritB, new FileOccurrence('foo.php', 4), - AstInheritType::EXTENDS - ), - new AstInherit( - $classInheritC, new FileOccurrence('foo.php', 5), - AstInheritType::EXTENDS - ), - new AstInherit( - $classInheritD, new FileOccurrence('foo.php', 6), - AstInheritType::EXTENDS - ), - ]) - ), - 'LayerA', - 'LayerB' - ), - new Violation( - new InheritDependency( - ClassLikeToken::fromFQCN('ClassC'), - ClassLikeToken::fromFQCN('ClassD'), - new Dependency($originalA, $originalB, new FileOccurrence('foo.php', 12), DependencyType::PARAMETER), - (new AstInherit( - $classInheritA, new FileOccurrence('foo.php', 3), - AstInheritType::EXTENDS - ))->replacePath([ - new AstInherit( - $classInheritB, new FileOccurrence('foo.php', 4), - AstInheritType::EXTENDS - ), - new AstInherit( - $classInheritC, new FileOccurrence('foo.php', 5), - AstInheritType::EXTENDS - ), - new AstInherit( - $classInheritD, new FileOccurrence('foo.php', 6), - AstInheritType::EXTENDS - ), - ]) - ), - 'LayerA', - 'LayerB', - new DummyViolationCreatingRule() - ), - ], - 'expected-junit-report-with-skipped-violations.xml', - ]; - } - - /** - * @dataProvider basicDataProvider - */ - public function testBasic(array $rules, string $expectedOutputFile): void - { - $analysisResult = new AnalysisResult(); - foreach ($rules as $rule) { - $analysisResult->addRule($rule); - } - - $formatter = new JUnitOutputFormatter(); - $formatter->finish( - OutputResult::fromAnalysisResult($analysisResult), - $this->createSymfonyOutput(new BufferedOutput()), - new OutputFormatterInput(__DIR__.'/data/'.self::$actual_junit_report_file, - false, false, false) - ); - - self::assertXmlFileEqualsXmlFile( - __DIR__.'/data/'.self::$actual_junit_report_file, - __DIR__.'/data/'.$expectedOutputFile - ); - } - - public function testUnmatchedSkipped(): void - { - $formatter = new JUnitOutputFormatter(); - $analysisResult = new AnalysisResult(); - $analysisResult->addError(new Error('Skipped violation "Class1" for "Class2" was not matched.')); - - $formatter->finish( - OutputResult::fromAnalysisResult($analysisResult), - $this->createSymfonyOutput(new BufferedOutput()), - new OutputFormatterInput(__DIR__.'/data/'.self::$actual_junit_report_file, - false, false, false) - ); - - self::assertXmlFileEqualsXmlFile( - __DIR__.'/data/'.self::$actual_junit_report_file, - __DIR__.'/data/expected-junit-report-with-unmatched-violations.xml' - ); - } - - private function createSymfonyOutput(BufferedOutput $bufferedOutput): SymfonyOutput - { - return new SymfonyOutput( - $bufferedOutput, - new Style(new SymfonyStyle($this->createMock(InputInterface::class), $bufferedOutput)) - ); - } -} diff --git a/tests/Supportive/OutputFormatter/JsonOutputFormatterTest.php b/tests/Supportive/OutputFormatter/JsonOutputFormatterTest.php deleted file mode 100644 index 2a6316dc9..000000000 --- a/tests/Supportive/OutputFormatter/JsonOutputFormatterTest.php +++ /dev/null @@ -1,482 +0,0 @@ -getName()); - } - - public static function basicDataProvider(): iterable - { - yield 'Multiple violations' => [ - [ - new Violation( - new InheritDependency( - ClassLikeToken::fromFQCN('ClassA'), - ClassLikeToken::fromFQCN('ClassB'), - new Dependency( - ClassLikeToken::fromFQCN('OriginalA'), - ClassLikeToken::fromFQCN('OriginalB'), new FileOccurrence('ClassA.php', 12), DependencyType::PARAMETER - ), - (new AstInherit( - ClassLikeToken::fromFQCN('ClassInheritA'), new FileOccurrence('ClassA.php', 3), - AstInheritType::EXTENDS - ))->replacePath( - [ - new AstInherit( - ClassLikeToken::fromFQCN('ClassInheritB'), - new FileOccurrence('ClassInheritA.php', 4), - AstInheritType::EXTENDS - ), - new AstInherit( - ClassLikeToken::fromFQCN('ClassInheritC'), - new FileOccurrence('ClassInheritB.php', 5), - AstInheritType::EXTENDS - ), - new AstInherit( - ClassLikeToken::fromFQCN('ClassInheritD'), - new FileOccurrence('ClassInheritC.php', 6), - AstInheritType::EXTENDS - ), - ] - ) - ), - 'LayerA', - 'LayerB', - new DummyViolationCreatingRule() - ), - new Violation( - new InheritDependency( - ClassLikeToken::fromFQCN('ClassC'), - ClassLikeToken::fromFQCN('ClassD'), - new Dependency( - ClassLikeToken::fromFQCN('OriginalA'), - ClassLikeToken::fromFQCN('OriginalB'), new FileOccurrence('ClassC.php', 12), DependencyType::PARAMETER - ), - (new AstInherit( - ClassLikeToken::fromFQCN('ClassInheritA'), new FileOccurrence('ClassA.php', 3), - AstInheritType::EXTENDS - ))->replacePath( - [ - new AstInherit( - ClassLikeToken::fromFQCN('ClassInheritB'), - new FileOccurrence('ClassInheritA.php', 4), - AstInheritType::EXTENDS - ), - new AstInherit( - ClassLikeToken::fromFQCN('ClassInheritC'), - new FileOccurrence('ClassInheritB.php', 5), - AstInheritType::EXTENDS - ), - new AstInherit( - ClassLikeToken::fromFQCN('ClassInheritD'), - new FileOccurrence('ClassInheritC.php', 6), - AstInheritType::EXTENDS - ), - ] - ) - ), - 'LayerA', - 'LayerC', - new DummyViolationCreatingRule() - ), - new Violation( - new InheritDependency( - ClassLikeToken::fromFQCN('ClassC'), - ClassLikeToken::fromFQCN('ClassE'), - new Dependency( - ClassLikeToken::fromFQCN('OriginalA'), - ClassLikeToken::fromFQCN('OriginalB'), new FileOccurrence('ClassC.php', 15), DependencyType::PARAMETER - ), - (new AstInherit( - ClassLikeToken::fromFQCN('ClassInheritA'), new FileOccurrence('ClassA.php', 3), - AstInheritType::EXTENDS - ))->replacePath( - [ - new AstInherit( - ClassLikeToken::fromFQCN('ClassInheritB'), - new FileOccurrence('ClassInheritA.php', 4), - AstInheritType::EXTENDS - ), - new AstInherit( - ClassLikeToken::fromFQCN('ClassInheritC'), - new FileOccurrence('ClassInheritB.php', 5), - AstInheritType::EXTENDS - ), - new AstInherit( - ClassLikeToken::fromFQCN('ClassInheritD'), - new FileOccurrence('ClassInheritC.php', 6), - AstInheritType::EXTENDS - ), - ] - ) - ), - 'LayerA', - 'LayerE', - new DummyViolationCreatingRule() - ), - ], - 'expected-json-report_1.json', - ]; - - yield [ - [ - new Violation( - new Dependency( - ClassLikeToken::fromFQCN('OriginalA'), - ClassLikeToken::fromFQCN('OriginalB'), new FileOccurrence('ClassA.php', 12), DependencyType::PARAMETER - ), - 'LayerA', - 'LayerB', - new DummyViolationCreatingRule() - ), - ], - 'expected-json-report_2.json', - ]; - - yield [ - [], - 'expected-json-report_3.json', - ]; - - yield [ - [ - new SkippedViolation( - new InheritDependency( - ClassLikeToken::fromFQCN('ClassA'), - ClassLikeToken::fromFQCN('ClassB'), - new Dependency( - ClassLikeToken::fromFQCN('OriginalA'), - ClassLikeToken::fromFQCN('OriginalB'), new FileOccurrence('ClassA.php', 12), DependencyType::PARAMETER - ), - (new AstInherit( - ClassLikeToken::fromFQCN('ClassInheritA'), new FileOccurrence('ClassA.php', 3), - AstInheritType::EXTENDS - ))->replacePath( - [ - new AstInherit( - ClassLikeToken::fromFQCN('ClassInheritB'), - new FileOccurrence('ClassInheritA.php', 4), - AstInheritType::EXTENDS - ), - new AstInherit( - ClassLikeToken::fromFQCN('ClassInheritC'), - new FileOccurrence('ClassInheritB.php', 5), - AstInheritType::EXTENDS - ), - new AstInherit( - ClassLikeToken::fromFQCN('ClassInheritD'), - new FileOccurrence('ClassInheritC.php', 6), - AstInheritType::EXTENDS - ), - ] - ) - ), - 'LayerA', - 'LayerB' - ), - new SkippedViolation( - new InheritDependency( - ClassLikeToken::fromFQCN('ClassC'), - ClassLikeToken::fromFQCN('ClassD'), - new Dependency( - ClassLikeToken::fromFQCN('OriginalA'), - ClassLikeToken::fromFQCN('OriginalB'), new FileOccurrence('ClassC.php', 12), DependencyType::PARAMETER - ), - (new AstInherit( - ClassLikeToken::fromFQCN('ClassInheritA'), new FileOccurrence('ClassA.php', 3), - AstInheritType::EXTENDS - ))->replacePath( - [ - new AstInherit( - ClassLikeToken::fromFQCN('ClassInheritB'), - new FileOccurrence('ClassInheritA.php', 4), - AstInheritType::EXTENDS - ), - new AstInherit( - ClassLikeToken::fromFQCN('ClassInheritC'), - new FileOccurrence('ClassInheritB.php', 5), - AstInheritType::EXTENDS - ), - new AstInherit( - ClassLikeToken::fromFQCN('ClassInheritD'), - new FileOccurrence('ClassInheritC.php', 6), - AstInheritType::EXTENDS - ), - ] - ) - ), - 'LayerA', - 'LayerB' - ), - ], - 'expected-json-report_4.json', - true, - ]; - - yield 'Different violations types in one report' => [ - [ - new Violation( - new InheritDependency( - ClassLikeToken::fromFQCN('ClassA'), - ClassLikeToken::fromFQCN('ClassB'), - new Dependency( - ClassLikeToken::fromFQCN('OriginalA'), - ClassLikeToken::fromFQCN('OriginalB'), new FileOccurrence('ClassA.php', 12), DependencyType::PARAMETER - ), - (new AstInherit( - ClassLikeToken::fromFQCN('ClassInheritA'), new FileOccurrence('ClassA.php', 3), - AstInheritType::EXTENDS - ))->replacePath( - [ - new AstInherit( - ClassLikeToken::fromFQCN('ClassInheritB'), - new FileOccurrence('ClassInheritA.php', 4), - AstInheritType::EXTENDS - ), - new AstInherit( - ClassLikeToken::fromFQCN('ClassInheritC'), - new FileOccurrence('ClassInheritB.php', 5), - AstInheritType::EXTENDS - ), - new AstInherit( - ClassLikeToken::fromFQCN('ClassInheritD'), - new FileOccurrence('ClassInheritC.php', 6), - AstInheritType::EXTENDS - ), - ] - ) - ), - 'LayerA', - 'LayerB', - new DummyViolationCreatingRule() - ), - new SkippedViolation( - new InheritDependency( - ClassLikeToken::fromFQCN('ClassA'), - ClassLikeToken::fromFQCN('ClassB'), - new Dependency( - ClassLikeToken::fromFQCN('OriginalA'), - ClassLikeToken::fromFQCN('OriginalB'), new FileOccurrence('ClassA.php', 15), DependencyType::PARAMETER - ), - (new AstInherit( - ClassLikeToken::fromFQCN('ClassInheritA'), new FileOccurrence('ClassA.php', 3), - AstInheritType::EXTENDS - ))->replacePath( - [ - new AstInherit( - ClassLikeToken::fromFQCN('ClassInheritB'), - new FileOccurrence('ClassInheritA.php', 4), - AstInheritType::EXTENDS - ), - new AstInherit( - ClassLikeToken::fromFQCN('ClassInheritC'), - new FileOccurrence('ClassInheritB.php', 5), - AstInheritType::EXTENDS - ), - new AstInherit( - ClassLikeToken::fromFQCN('ClassInheritD'), - new FileOccurrence('ClassInheritC.php', 6), - AstInheritType::EXTENDS - ), - ] - ) - ), - 'LayerA', - 'LayerB' - ), - new SkippedViolation( - new InheritDependency( - ClassLikeToken::fromFQCN('ClassC'), - ClassLikeToken::fromFQCN('ClassD'), - new Dependency( - ClassLikeToken::fromFQCN('OriginalA'), - ClassLikeToken::fromFQCN('OriginalB'), new FileOccurrence('ClassC.php', 12), DependencyType::PARAMETER - ), - (new AstInherit( - ClassLikeToken::fromFQCN('ClassInheritA'), new FileOccurrence('ClassA.php', 3), - AstInheritType::EXTENDS - ))->replacePath( - [ - new AstInherit( - ClassLikeToken::fromFQCN('ClassInheritB'), - new FileOccurrence('ClassInheritA.php', 4), - AstInheritType::EXTENDS - ), - new AstInherit( - ClassLikeToken::fromFQCN('ClassInheritC'), - new FileOccurrence('ClassInheritB.php', 5), - AstInheritType::EXTENDS - ), - new AstInherit( - ClassLikeToken::fromFQCN('ClassInheritD'), - new FileOccurrence('ClassInheritC.php', 6), - AstInheritType::EXTENDS - ), - ] - ) - ), - 'LayerA', - 'LayerB' - ), - new Uncovered( - new Dependency( - ClassLikeToken::fromFQCN('OriginalA'), - ClassLikeToken::fromFQCN('OriginalB'), new FileOccurrence('OriginalA.php', 12), DependencyType::PARAMETER - ), - 'LayerA' - ), - ], - 'expected-json-report_5.json', - true, - true, - ]; - } - - /** - * @dataProvider basicDataProvider - */ - public function testFileOutput( - array $rules, - $expectedOutputFile, - bool $reportSkipped = false, - bool $reportUncovered = false - ): void { - $bufferedOutput = new BufferedOutput(); - - $analysisResult = new AnalysisResult(); - foreach ($rules as $rule) { - $analysisResult->addRule($rule); - } - - $formatter = new JsonOutputFormatter(); - $formatter->finish( - OutputResult::fromAnalysisResult($analysisResult), - $this->createSymfonyOutput($bufferedOutput), - new OutputFormatterInput( - __DIR__.'/data/'.self::$actual_json_report_file, - $reportSkipped, - $reportUncovered, - false, - ) - ); - - self::assertJsonFileEqualsJsonFile( - __DIR__.'/data/'.self::$actual_json_report_file, - __DIR__.'/data/'.$expectedOutputFile - ); - } - - /** - * @dataProvider basicDataProvider - */ - public function testConsoleOutput( - array $rules, - $expectedOutputFile, - bool $reportSkipped = false, - bool $reportUncovered = false - ): void { - $bufferedOutput = new BufferedOutput(); - - $analysisResult = new AnalysisResult(); - foreach ($rules as $rule) { - $analysisResult->addRule($rule); - } - - $formatter = new JsonOutputFormatter(); - $formatter->finish( - OutputResult::fromAnalysisResult($analysisResult), - $this->createSymfonyOutput($bufferedOutput), - new OutputFormatterInput( - null, - $reportSkipped, - $reportUncovered, - false - ) - ); - - self::assertJsonStringEqualsJsonFile( - __DIR__.'/data/'.$expectedOutputFile, - $bufferedOutput->fetch() - ); - } - - public function testJsonRenderError(): void - { - $bufferedOutput = new BufferedOutput(); - $formatter = new JsonOutputFormatter(); - - $malformedCharacters = "\xB1\x31"; - $violation = new Violation( - new Dependency( - ClassLikeToken::fromFQCN('OriginalA'), - ClassLikeToken::fromFQCN('OriginalB'.$malformedCharacters), new FileOccurrence('ClassA.php', 12), DependencyType::PARAMETER - ), - 'LayerA', - 'LayerB', - new DummyViolationCreatingRule() - ); - - $analysisResult = new AnalysisResult(); - $analysisResult->addRule($violation); - - self::expectException(Exception::class); - self::expectExceptionMessage('Unable to render json output. ' - .'Malformed UTF-8 characters, possibly incorrectly encoded'); - $formatter->finish( - OutputResult::fromAnalysisResult($analysisResult), - $this->createSymfonyOutput($bufferedOutput), - new OutputFormatterInput( - null, - false, - false, - false, - ) - ); - } - - private function createSymfonyOutput(BufferedOutput $bufferedOutput): SymfonyOutput - { - return new SymfonyOutput( - $bufferedOutput, - new Style(new SymfonyStyle($this->createMock(InputInterface::class), $bufferedOutput)) - ); - } -} diff --git a/tests/Supportive/OutputFormatter/TableOutputFormatterTest.php b/tests/Supportive/OutputFormatter/TableOutputFormatterTest.php deleted file mode 100644 index e14d14e18..000000000 --- a/tests/Supportive/OutputFormatter/TableOutputFormatterTest.php +++ /dev/null @@ -1,366 +0,0 @@ -getName()); - } - - public static function basicDataProvider(): iterable - { - $originalA = ClassLikeToken::fromFQCN('OriginalA'); - $originalB = ClassLikeToken::fromFQCN('OriginalB'); - - yield [ - [ - new Violation( - new InheritDependency( - ClassLikeToken::fromFQCN('ClassA'), - ClassLikeToken::fromFQCN('ClassB'), - new Dependency($originalA, $originalB, new FileOccurrence('originalA.php', 12), DependencyType::PARAMETER), - (new AstInherit( - ClassLikeToken::fromFQCN('ClassInheritA'), new FileOccurrence('originalA.php', 3), - AstInheritType::EXTENDS - )) - ->replacePath( - [ - new AstInherit( - ClassLikeToken::fromFQCN('ClassInheritB'), - new FileOccurrence('originalA.php', 4), - AstInheritType::EXTENDS - ), - new AstInherit( - ClassLikeToken::fromFQCN('ClassInheritC'), - new FileOccurrence('originalA.php', 5), - AstInheritType::EXTENDS - ), - new AstInherit( - ClassLikeToken::fromFQCN('ClassInheritD'), - new FileOccurrence('originalA.php', 6), - AstInheritType::EXTENDS - ), - ] - ) - ), - 'LayerA', - 'LayerB', - new DummyViolationCreatingRule() - ), - ], - [], - 'warnings' => [], - ' ----------- ---------------------------------- - Reason LayerA - ----------- ---------------------------------- - DummyRule ClassA must not depend on ClassB - Why? Because! (LayerB) - ClassInheritD::6 -> - ClassInheritC::5 -> - ClassInheritB::4 -> - ClassInheritA::3 -> - OriginalB::12 - originalA.php:12 - ----------- ---------------------------------- - - - -------------------- ----- - Report - -------------------- ----- - Violations 1 - Skipped violations 0 - Uncovered 0 - Allowed 0 - Warnings 0 - Errors 0 - -------------------- ----- - -', - ]; - - yield [ - [ - new Violation( - new Dependency($originalA, $originalB, new FileOccurrence('originalA.php', 12), DependencyType::PARAMETER), - 'LayerA', - 'LayerB', - new DummyViolationCreatingRule() - ), - ], - [], - 'warnings' => [], - ' ----------- ---------------------------------------- - Reason LayerA - ----------- ---------------------------------------- - DummyRule OriginalA must not depend on OriginalB - Why? Because! (LayerB) - originalA.php:12 - ----------- ---------------------------------------- - - - -------------------- ----- - Report - -------------------- ----- - Violations 1 - Skipped violations 0 - Uncovered 0 - Allowed 0 - Warnings 0 - Errors 0 - -------------------- ----- - -', - ]; - - yield [ - [], - [], - 'warnings' => [], - ' - -------------------- ----- - Report - -------------------- ----- - Violations 0 - Skipped violations 0 - Uncovered 0 - Allowed 0 - Warnings 0 - Errors 0 - -------------------- ----- - -', - ]; - - yield 'skipped violations' => [ - [ - new SkippedViolation( - new Dependency($originalA, $originalB, new FileOccurrence('originalA.php', 12), DependencyType::PARAMETER), - 'LayerA', - 'LayerB' - ), - ], - [], - 'warnings' => [], - ' --------- ------------------------------------------------- - Reason LayerA - --------- ------------------------------------------------- - Skipped OriginalA must not depend on OriginalB (LayerB) - originalA.php:12 - --------- ------------------------------------------------- - - - -------------------- ----- - Report - -------------------- ----- - Violations 0 - Skipped violations 1 - Uncovered 0 - Allowed 0 - Warnings 0 - Errors 0 - -------------------- ----- - -', - ]; - - yield 'skipped violations without reporting' => [ - [ - new SkippedViolation( - new Dependency($originalA, $originalB, new FileOccurrence('originalA.php', 12), DependencyType::PARAMETER), - 'LayerA', - 'LayerB' - ), - ], - [], - 'warnings' => [], - ' - -------------------- ----- - Report - -------------------- ----- - Violations 0 - Skipped violations 1 - Uncovered 0 - Allowed 0 - Warnings 0 - Errors 0 - -------------------- ----- - -', - 'reportUncovered' => true, - 'reportSkipped' => false, - ]; - - yield 'uncovered' => [ - 'rules' => [ - new Uncovered( - new Dependency($originalA, $originalB, new FileOccurrence('originalA.php', 12), DependencyType::PARAMETER), - 'LayerA' - ), - ], - 'errors' => [], - 'warnings' => [], - 'expectedOutput' => ' ----------- ------------------------------------------------- - Reason LayerA - ----------- ------------------------------------------------- - Uncovered OriginalA has uncovered dependency on OriginalB - originalA.php:12 - ----------- ------------------------------------------------- - - - -------------------- ----- - Report - -------------------- ----- - Violations 0 - Skipped violations 0 - Uncovered 1 - Allowed 0 - Warnings 0 - Errors 0 - -------------------- ----- - -', - ]; - - yield 'uncovered without reporting' => [ - 'rules' => [ - new Uncovered( - new Dependency($originalA, $originalB, new FileOccurrence('originalA.php', 12), DependencyType::PARAMETER), - 'LayerA' - ), - ], - 'errors' => [], - 'warnings' => [], - 'expectedOutput' => ' - -------------------- ----- - Report - -------------------- ----- - Violations 0 - Skipped violations 0 - Uncovered 1 - Allowed 0 - Warnings 0 - Errors 0 - -------------------- ----- - -', - 'reportUncovered' => false, - ]; - - yield 'an error occurred' => [ - [], - [new Error('an error occurred')], - 'warnings' => [], - ' ------------------- - Errors - ------------------- - an error occurred - ------------------- - - - -------------------- ----- - Report - -------------------- ----- - Violations 0 - Skipped violations 0 - Uncovered 0 - Allowed 0 - Warnings 0 - Errors 1 - -------------------- ----- - -', - ]; - - yield 'an warning occurred' => [ - 'rules' => [], - 'errors' => [], - 'warnings' => [Warning::tokenIsInMoreThanOneLayer(ClassLikeToken::fromFQCN('Foo\Bar')->toString(), ['Layer 1', 'Layer 2'])], - ' ------------------------------------------------------------------------------------------------------------------------- - Warnings - ------------------------------------------------------------------------------------------------------------------------- - Foo\Bar is in more than one layer ["Layer 1", "Layer 2"]. It is recommended that one token should only be in one layer. - ------------------------------------------------------------------------------------------------------------------------- - - - -------------------- ----- - Report - -------------------- ----- - Violations 0 - Skipped violations 0 - Uncovered 0 - Allowed 0 - Warnings 1 - Errors 0 - -------------------- ----- - -', - ]; - } - - /** - * @dataProvider basicDataProvider - */ - public function testBasic(array $rules, array $errors, array $warnings, string $expectedOutput, bool $reportUncovered = true, bool $reportSkipped = true): void - { - $bufferedOutput = new BufferedOutput(); - $output = new SymfonyOutput( - $bufferedOutput, - new Style(new SymfonyStyle($this->createMock(InputInterface::class), $bufferedOutput)) - ); - - $analysisResult = new AnalysisResult(); - foreach ($rules as $rule) { - $analysisResult->addRule($rule); - } - foreach ($errors as $error) { - $analysisResult->addError($error); - } - foreach ($warnings as $warning) { - $analysisResult->addWarning($warning); - } - - $formatter = new TableOutputFormatter(); - $formatter->finish( - OutputResult::fromAnalysisResult($analysisResult), - $output, - new OutputFormatterInput( - null, - $reportSkipped, - $reportUncovered, - false - ) - ); - - static::assertSame(str_replace("\n", PHP_EOL, $expectedOutput), $bufferedOutput->fetch()); - } -} diff --git a/tests/Supportive/OutputFormatter/XMLOutputFormatterTest.php b/tests/Supportive/OutputFormatter/XMLOutputFormatterTest.php deleted file mode 100644 index 31ae363ae..000000000 --- a/tests/Supportive/OutputFormatter/XMLOutputFormatterTest.php +++ /dev/null @@ -1,204 +0,0 @@ -getName()); - } - - public static function basicDataProvider(): iterable - { - yield [ - [ - new Violation( - new InheritDependency( - ClassLikeToken::fromFQCN('ClassA'), - ClassLikeToken::fromFQCN('ClassB'), - new Dependency(ClassLikeToken::fromFQCN('OriginalA'), ClassLikeToken::fromFQCN('OriginalB'), - new FileOccurrence('ClassA.php', 12), DependencyType::PARAMETER - ), - (new AstInherit( - ClassLikeToken::fromFQCN('ClassInheritA'), new FileOccurrence('ClassA.php', 3), - AstInheritType::EXTENDS - ))->replacePath([ - new AstInherit( - ClassLikeToken::fromFQCN('ClassInheritB'), - new FileOccurrence('ClassInheritA.php', 4), - AstInheritType::EXTENDS - ), - new AstInherit( - ClassLikeToken::fromFQCN('ClassInheritC'), - new FileOccurrence('ClassInheritB.php', 5), - AstInheritType::EXTENDS - ), - new AstInherit( - ClassLikeToken::fromFQCN('ClassInheritD'), - new FileOccurrence('ClassInheritC.php', 6), - AstInheritType::EXTENDS - ), - ]) - ), - 'LayerA', - 'LayerB', - new DummyViolationCreatingRule() - ), - ], - 'expected-xml-report_1.xml', - ]; - - yield [ - [ - new Violation( - new Dependency(ClassLikeToken::fromFQCN('OriginalA'), ClassLikeToken::fromFQCN('OriginalB'), - new FileOccurrence('ClassA.php', 12), DependencyType::PARAMETER - ), - 'LayerA', - 'LayerB', - new DummyViolationCreatingRule() - ), - ], - 'expected-xml-report_2.xml', - ]; - - yield [ - [], - 'expected-xml-report_3.xml', - ]; - - yield [ - [ - $violations = new SkippedViolation( - new InheritDependency( - ClassLikeToken::fromFQCN('ClassA'), - ClassLikeToken::fromFQCN('ClassB'), - new Dependency(ClassLikeToken::fromFQCN('OriginalA'), ClassLikeToken::fromFQCN('OriginalB'), - new FileOccurrence('ClassA.php', 12), DependencyType::PARAMETER - ), - (new AstInherit( - ClassLikeToken::fromFQCN('ClassInheritA'), new FileOccurrence('ClassA.php', 3), - AstInheritType::EXTENDS - ))->replacePath([ - new AstInherit( - ClassLikeToken::fromFQCN('ClassInheritB'), - new FileOccurrence('ClassInheritA.php', 4), - AstInheritType::EXTENDS - ), - new AstInherit( - ClassLikeToken::fromFQCN('ClassInheritC'), - new FileOccurrence('ClassInheritB.php', 5), - AstInheritType::EXTENDS - ), - new AstInherit( - ClassLikeToken::fromFQCN('ClassInheritD'), - new FileOccurrence('ClassInheritC.php', 6), - AstInheritType::EXTENDS - ), - ]) - ), - 'LayerA', - 'LayerB' - ), - new SkippedViolation( - new InheritDependency( - ClassLikeToken::fromFQCN('ClassC'), - ClassLikeToken::fromFQCN('ClassD'), - new Dependency(ClassLikeToken::fromFQCN('OriginalA'), ClassLikeToken::fromFQCN('OriginalB'), - new FileOccurrence('ClassA.php', 12), DependencyType::PARAMETER - ), - (new AstInherit( - ClassLikeToken::fromFQCN('ClassInheritA'), new FileOccurrence('ClassA.php', 3), - AstInheritType::EXTENDS - ))->replacePath([ - new AstInherit( - ClassLikeToken::fromFQCN('ClassInheritB'), - new FileOccurrence('ClassInheritA.php', 4), - AstInheritType::EXTENDS - ), - new AstInherit( - ClassLikeToken::fromFQCN('ClassInheritC'), - new FileOccurrence('ClassInheritB.php', 5), - AstInheritType::EXTENDS - ), - new AstInherit( - ClassLikeToken::fromFQCN('ClassInheritD'), - new FileOccurrence('ClassInheritC.php', 6), - AstInheritType::EXTENDS - ), - ]) - ), - 'LayerA', - 'LayerB' - ), - ], - 'expected-xml-report-with-skipped-violations.xml', - ]; - } - - /** - * @dataProvider basicDataProvider - */ - public function testBasic(array $rules, $expectedOutputFile): void - { - $bufferedOutput = new BufferedOutput(); - - $analysisResult = new AnalysisResult(); - foreach ($rules as $rule) { - $analysisResult->addRule($rule); - } - - $formatter = new XMLOutputFormatter(); - $formatter->finish( - OutputResult::fromAnalysisResult($analysisResult), - $this->createSymfonyOutput($bufferedOutput), - new OutputFormatterInput(__DIR__.'/data/'.self::$actual_xml_report_file, false, false, false) - ); - - self::assertXmlFileEqualsXmlFile( - __DIR__.'/data/'.self::$actual_xml_report_file, - __DIR__.'/data/'.$expectedOutputFile - ); - } - - private function createSymfonyOutput(BufferedOutput $bufferedOutput): SymfonyOutput - { - return new SymfonyOutput( - $bufferedOutput, - new Style(new SymfonyStyle($this->createMock(InputInterface::class), $bufferedOutput)) - ); - } -} diff --git a/tests/Supportive/OutputFormatter/data/DummyViolationCreatingRule.php b/tests/Supportive/OutputFormatter/data/DummyViolationCreatingRule.php deleted file mode 100644 index 73e55547d..000000000 --- a/tests/Supportive/OutputFormatter/data/DummyViolationCreatingRule.php +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - - - - diff --git a/tests/Supportive/OutputFormatter/data/expected-junit-report-with-unmatched-violations.xml b/tests/Supportive/OutputFormatter/data/expected-junit-report-with-unmatched-violations.xml deleted file mode 100644 index dac541ba0..000000000 --- a/tests/Supportive/OutputFormatter/data/expected-junit-report-with-unmatched-violations.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/tests/Supportive/OutputFormatter/data/expected-junit-report_1.xml b/tests/Supportive/OutputFormatter/data/expected-junit-report_1.xml deleted file mode 100644 index e938376c1..000000000 --- a/tests/Supportive/OutputFormatter/data/expected-junit-report_1.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - diff --git a/tests/Supportive/OutputFormatter/data/expected-junit-report_2.xml b/tests/Supportive/OutputFormatter/data/expected-junit-report_2.xml deleted file mode 100644 index 9c3ed7062..000000000 --- a/tests/Supportive/OutputFormatter/data/expected-junit-report_2.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - diff --git a/tests/Supportive/OutputFormatter/data/expected-junit-report_3.xml b/tests/Supportive/OutputFormatter/data/expected-junit-report_3.xml deleted file mode 100644 index dfe641670..000000000 --- a/tests/Supportive/OutputFormatter/data/expected-junit-report_3.xml +++ /dev/null @@ -1,2 +0,0 @@ - - diff --git a/tests/Supportive/OutputFormatter/data/expected-xml-report-with-skipped-violations.xml b/tests/Supportive/OutputFormatter/data/expected-xml-report-with-skipped-violations.xml deleted file mode 100644 index 2fc4dc4e3..000000000 --- a/tests/Supportive/OutputFormatter/data/expected-xml-report-with-skipped-violations.xml +++ /dev/null @@ -1,17 +0,0 @@ - - - - LayerA - LayerB - ClassA - ClassB - - - - LayerA - LayerB - ClassC - ClassD - - - diff --git a/tests/Supportive/OutputFormatter/data/expected-xml-report_1.xml b/tests/Supportive/OutputFormatter/data/expected-xml-report_1.xml deleted file mode 100644 index dfd9053fe..000000000 --- a/tests/Supportive/OutputFormatter/data/expected-xml-report_1.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - LayerA - LayerB - ClassA - ClassB - - - diff --git a/tests/Supportive/OutputFormatter/data/expected-xml-report_2.xml b/tests/Supportive/OutputFormatter/data/expected-xml-report_2.xml deleted file mode 100644 index 411d7a16d..000000000 --- a/tests/Supportive/OutputFormatter/data/expected-xml-report_2.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - LayerA - LayerB - OriginalA - OriginalB - - - diff --git a/tests/Supportive/OutputFormatter/data/expected-xml-report_3.xml b/tests/Supportive/OutputFormatter/data/expected-xml-report_3.xml deleted file mode 100644 index 8803944dd..000000000 --- a/tests/Supportive/OutputFormatter/data/expected-xml-report_3.xml +++ /dev/null @@ -1,2 +0,0 @@ - - diff --git a/tests/Supportive/OutputFormatter/data/graphviz-expected.dot b/tests/Supportive/OutputFormatter/data/graphviz-expected.dot deleted file mode 100644 index f2a2c07bf..000000000 --- a/tests/Supportive/OutputFormatter/data/graphviz-expected.dot +++ /dev/null @@ -1,18 +0,0 @@ -digraph "" { -"LayerA" -> "LayerB" [ -label="2" -color="red" -] -"LayerA" -> "LayerC" [ -label="1" -] -"LayerA" [ - -] -"LayerB" [ - -] -"LayerC" [ - -] -} \ No newline at end of file diff --git a/tests/Supportive/OutputFormatter/data/graphviz-groups-point.dot b/tests/Supportive/OutputFormatter/data/graphviz-groups-point.dot deleted file mode 100644 index d3dbb2d77..000000000 --- a/tests/Supportive/OutputFormatter/data/graphviz-groups-point.dot +++ /dev/null @@ -1,35 +0,0 @@ -digraph "" { -subgraph "cluster_User" { -label="User" -"User Frontend" [ -group="User" -] -"User Backend" [ -group="User" -] -} -subgraph "cluster_Admin" { -label="Admin" -"Admin" [ -group="Admin" -] -"Admin Backend" [ -group="Admin" -] -} -compound="true" -"User Frontend" -> "User Backend" [ -label="1" -] -"User Frontend" -> "Admin" [ -lhead="cluster_Admin" -label="1" -] -"Admin" -> "Admin Backend" [ -label="1" -] -"User Backend" -> "Admin" [ -lhead="cluster_Admin" -label="1" -] -} \ No newline at end of file diff --git a/tests/Supportive/OutputFormatter/data/graphviz-groups.dot b/tests/Supportive/OutputFormatter/data/graphviz-groups.dot deleted file mode 100644 index 271a051dc..000000000 --- a/tests/Supportive/OutputFormatter/data/graphviz-groups.dot +++ /dev/null @@ -1,32 +0,0 @@ -digraph "" { -subgraph "cluster_User" { -label="User" -"User Frontend" [ -group="User" -] -"User Backend" [ -group="User" -] -} -subgraph "cluster_Admin" { -label="Admin" -"Admin" [ -group="Admin" -] -"Admin Backend" [ -group="Admin" -] -} -"User Frontend" -> "User Backend" [ -label="1" -] -"User Frontend" -> "Admin" [ -label="1" -] -"Admin" -> "Admin Backend" [ -label="1" -] -"User Backend" -> "Admin" [ -label="1" -] -} \ No newline at end of file diff --git a/tests/Supportive/ParsedYamlIsNotAnArrayExceptionTest.php b/tests/Supportive/ParsedYamlIsNotAnArrayExceptionTest.php deleted file mode 100644 index ad5137a55..000000000 --- a/tests/Supportive/ParsedYamlIsNotAnArrayExceptionTest.php +++ /dev/null @@ -1,36 +0,0 @@ -getMessage()); - } -} diff --git a/tests/Supportive/Time/StopwatchTest.php b/tests/Supportive/Time/StopwatchTest.php deleted file mode 100644 index 61d9b5b33..000000000 --- a/tests/Supportive/Time/StopwatchTest.php +++ /dev/null @@ -1,45 +0,0 @@ -stopwatch = new Stopwatch(); - } - - public function testEventCanNotBeStartedTwice(): void - { - $this->expectException(StopwatchException::class); - $this->expectExceptionMessage('Period "test" is already started'); - - $this->stopwatch->start('test'); - $this->stopwatch->start('test'); - } - - public function testEventCanNotBeStoppedWithoutBeingStarted(): void - { - $this->expectException(StopwatchException::class); - $this->expectExceptionMessage('Period "test" is not started'); - - $this->stopwatch->stop('test'); - } - - public function testEventFlowAndEventCanBeStartedAgain(): void - { - $this->stopwatch->start('test'); - $this->stopwatch->stop('test'); - $this->stopwatch->start('test'); - - $this->expectNotToPerformAssertions(); - } -} diff --git a/tests/Supportive/YmlFileLoaderTest.php b/tests/Supportive/YmlFileLoaderTest.php deleted file mode 100644 index c2b3b5e8c..000000000 --- a/tests/Supportive/YmlFileLoaderTest.php +++ /dev/null @@ -1,62 +0,0 @@ -expectException(CouldNotReadFileException::class); - - $loader->parseFile($file); - } - - public function testLoadThrowsFileCannotBeParsedAsYamlExceptionWhenFileDoesNotContainYaml(): void - { - $file = __FILE__; - - $loader = new YmlFileLoader(); - - $this->expectException(FileCannotBeParsedAsYamlException::class); - - $loader->parseFile($file); - } - - public function testSyntaxErrorDetailsPrinted(): void - { - $file = __DIR__.'/Fixtures/depfile-syntax-error.yaml'; - - $loader = new YmlFileLoader(); - - $this->expectException(FileCannotBeParsedAsYamlException::class); - $this->expectExceptionMessageMatches('/.*Duplicate key "ViewModel" detected at line.*/'); - - $loader->parseFile($file); - } - - public function testLoadThrowsParsedYamlIsNotAnArrayExceptionWhenFileDoesNotContainYamlThatCanBeParsedToAnArray(): void - { - $file = __DIR__.'/Fixtures/does-not-contain-array.yml'; - - $loader = new YmlFileLoader(); - - $this->expectException(ParsedYamlIsNotAnArrayException::class); - - $loader->parseFile($file); - } -}