diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index da3181acf..22fb245c4 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -34,7 +34,7 @@ jobs: - name: Run test suite run: composer phpstan - phpcs: + code-style: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -63,5 +63,5 @@ jobs: if: steps.composer-cache.outputs.cache-hit != 'true' run: composer install --prefer-dist --no-progress - - name: Run PHP_CodeSniffer - run: composer phpcs + - name: Run php-cs-fixer + run: composer check diff --git a/.gitignore b/.gitignore index a8419a718..6822a2688 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ *.phar .phpunit.result.cache docker-compose.override.yml +.php-cs-fixer.cache diff --git a/.php-cs-fixer.dist.php b/.php-cs-fixer.dist.php new file mode 100644 index 000000000..1a7f83995 --- /dev/null +++ b/.php-cs-fixer.dist.php @@ -0,0 +1,13 @@ +in(__DIR__ . '/src') + ->in(__DIR__ . '/recipe') + ->in(__DIR__ . '/contrib') + ->in(__DIR__ . '/tests'); + +return (new PhpCsFixer\Config()) + ->setRules([ + '@PER-CS' => true, + ]) + ->setFinder($finder); diff --git a/composer.json b/composer.json index 1850b4ca8..9be8bb2f4 100644 --- a/composer.json +++ b/composer.json @@ -33,8 +33,8 @@ "scripts": { "test": "pest", "test:e2e": "pest --config tests/e2e/phpunit-e2e.xml", - "phpcs": "phpcs", - "fix": "phpcbf", + "check": "php-cs-fixer check", + "fix": "php-cs-fixer fix", "phpstan": "phpstan analyse -c phpstan.neon", "phpstan:baseline": "@phpstan --generate-baseline tests/phpstan-baseline.neon" }, @@ -46,12 +46,11 @@ "ext-json": "*" }, "require-dev": { + "friendsofphp/php-cs-fixer": "^3.64", "pestphp/pest": "^3.3", "phpstan/phpstan": "^1.4", "phpunit/php-code-coverage": "^11.0", - "phpunit/phpunit": "^11.4", - "slevomat/coding-standard": "^8.0", - "squizlabs/php_codesniffer": "^3.5" + "phpunit/phpunit": "^11.4" }, "config": { "sort-packages": true, diff --git a/composer.lock b/composer.lock index a4caa9cd4..55eab858c 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "ae5d11b0ea7cc56546d8fe7c62a57e58", + "content-hash": "590c5d88b1f7bf2c252e807ad78087b5", "packages": [], "packages-dev": [ { @@ -102,39 +102,178 @@ "time": "2024-10-07T06:27:54+00:00" }, { - "name": "dealerdirect/phpcodesniffer-composer-installer", - "version": "v1.0.0", + "name": "clue/ndjson-react", + "version": "v1.3.0", "source": { "type": "git", - "url": "https://github.com/PHPCSStandards/composer-installer.git", - "reference": "4be43904336affa5c2f70744a348312336afd0da" + "url": "https://github.com/clue/reactphp-ndjson.git", + "reference": "392dc165fce93b5bb5c637b67e59619223c931b0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHPCSStandards/composer-installer/zipball/4be43904336affa5c2f70744a348312336afd0da", - "reference": "4be43904336affa5c2f70744a348312336afd0da", + "url": "https://api.github.com/repos/clue/reactphp-ndjson/zipball/392dc165fce93b5bb5c637b67e59619223c931b0", + "reference": "392dc165fce93b5bb5c637b67e59619223c931b0", "shasum": "" }, "require": { - "composer-plugin-api": "^1.0 || ^2.0", - "php": ">=5.4", - "squizlabs/php_codesniffer": "^2.0 || ^3.1.0 || ^4.0" + "php": ">=5.3", + "react/stream": "^1.2" }, "require-dev": { - "composer/composer": "*", - "ext-json": "*", - "ext-zip": "*", - "php-parallel-lint/php-parallel-lint": "^1.3.1", - "phpcompatibility/php-compatibility": "^9.0", - "yoast/phpunit-polyfills": "^1.0" + "phpunit/phpunit": "^9.5 || ^5.7 || ^4.8.35", + "react/event-loop": "^1.2" }, - "type": "composer-plugin", + "type": "library", + "autoload": { + "psr-4": { + "Clue\\React\\NDJson\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Christian Lück", + "email": "christian@clue.engineering" + } + ], + "description": "Streaming newline-delimited JSON (NDJSON) parser and encoder for ReactPHP.", + "homepage": "https://github.com/clue/reactphp-ndjson", + "keywords": [ + "NDJSON", + "json", + "jsonlines", + "newline", + "reactphp", + "streaming" + ], + "support": { + "issues": "https://github.com/clue/reactphp-ndjson/issues", + "source": "https://github.com/clue/reactphp-ndjson/tree/v1.3.0" + }, + "funding": [ + { + "url": "https://clue.engineering/support", + "type": "custom" + }, + { + "url": "https://github.com/clue", + "type": "github" + } + ], + "time": "2022-12-23T10:58:28+00:00" + }, + { + "name": "composer/pcre", + "version": "3.3.1", + "source": { + "type": "git", + "url": "https://github.com/composer/pcre.git", + "reference": "63aaeac21d7e775ff9bc9d45021e1745c97521c4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/composer/pcre/zipball/63aaeac21d7e775ff9bc9d45021e1745c97521c4", + "reference": "63aaeac21d7e775ff9bc9d45021e1745c97521c4", + "shasum": "" + }, + "require": { + "php": "^7.4 || ^8.0" + }, + "conflict": { + "phpstan/phpstan": "<1.11.10" + }, + "require-dev": { + "phpstan/phpstan": "^1.11.10", + "phpstan/phpstan-strict-rules": "^1.1", + "phpunit/phpunit": "^8 || ^9" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "3.x-dev" + }, + "phpstan": { + "includes": [ + "extension.neon" + ] + } + }, + "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.3.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": "2024-08-27T18:44:43+00:00" + }, + { + "name": "composer/semver", + "version": "3.4.3", + "source": { + "type": "git", + "url": "https://github.com/composer/semver.git", + "reference": "4313d26ada5e0c4edfbd1dc481a92ff7bff91f12" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/composer/semver/zipball/4313d26ada5e0c4edfbd1dc481a92ff7bff91f12", + "reference": "4313d26ada5e0c4edfbd1dc481a92ff7bff91f12", + "shasum": "" + }, + "require": { + "php": "^5.3.2 || ^7.0 || ^8.0" + }, + "require-dev": { + "phpstan/phpstan": "^1.11", + "symfony/phpunit-bridge": "^3 || ^7" + }, + "type": "library", "extra": { - "class": "PHPCSStandards\\Composer\\Plugin\\Installers\\PHPCodeSniffer\\Plugin" + "branch-alias": { + "dev-main": "3.x-dev" + } }, "autoload": { "psr-4": { - "PHPCSStandards\\Composer\\Plugin\\Installers\\PHPCodeSniffer\\": "src/" + "Composer\\Semver\\": "src" } }, "notification-url": "https://packagist.org/downloads/", @@ -143,41 +282,114 @@ ], "authors": [ { - "name": "Franck Nijhof", - "email": "franck.nijhof@dealerdirect.com", - "homepage": "http://www.frenck.nl", - "role": "Developer / IT Manager" + "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": "Contributors", - "homepage": "https://github.com/PHPCSStandards/composer-installer/graphs/contributors" + "name": "Rob Bast", + "email": "rob.bast@gmail.com", + "homepage": "http://robbast.nl" } ], - "description": "PHP_CodeSniffer Standards Composer Installer Plugin", - "homepage": "http://www.dealerdirect.com", + "description": "Semver library that offers utilities, version constraint parsing and validation.", "keywords": [ - "PHPCodeSniffer", - "PHP_CodeSniffer", - "code quality", - "codesniffer", - "composer", - "installer", - "phpcbf", - "phpcs", - "plugin", - "qa", - "quality", - "standard", - "standards", - "style guide", - "stylecheck", - "tests" + "semantic", + "semver", + "validation", + "versioning" + ], + "support": { + "irc": "ircs://irc.libera.chat:6697/composer", + "issues": "https://github.com/composer/semver/issues", + "source": "https://github.com/composer/semver/tree/3.4.3" + }, + "funding": [ + { + "url": "https://packagist.com", + "type": "custom" + }, + { + "url": "https://github.com/composer", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/composer/composer", + "type": "tidelift" + } + ], + "time": "2024-09-19T14:15:21+00:00" + }, + { + "name": "composer/xdebug-handler", + "version": "3.0.5", + "source": { + "type": "git", + "url": "https://github.com/composer/xdebug-handler.git", + "reference": "6c1925561632e83d60a44492e0b344cf48ab85ef" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/composer/xdebug-handler/zipball/6c1925561632e83d60a44492e0b344cf48ab85ef", + "reference": "6c1925561632e83d60a44492e0b344cf48ab85ef", + "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", + "phpunit/phpunit": "^8.5 || ^9.6 || ^10.5" + }, + "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": { - "issues": "https://github.com/PHPCSStandards/composer-installer/issues", - "source": "https://github.com/PHPCSStandards/composer-installer" + "irc": "ircs://irc.libera.chat:6697/composer", + "issues": "https://github.com/composer/xdebug-handler/issues", + "source": "https://github.com/composer/xdebug-handler/tree/3.0.5" }, - "time": "2023-01-05T11:28:13+00:00" + "funding": [ + { + "url": "https://packagist.com", + "type": "custom" + }, + { + "url": "https://github.com/composer", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/composer/composer", + "type": "tidelift" + } + ], + "time": "2024-05-06T16:37:16+00:00" }, { "name": "doctrine/deprecations", @@ -226,6 +438,53 @@ }, "time": "2024-01-30T19:34:25+00:00" }, + { + "name": "evenement/evenement", + "version": "v3.0.2", + "source": { + "type": "git", + "url": "https://github.com/igorw/evenement.git", + "reference": "0a16b0d71ab13284339abb99d9d2bd813640efbc" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/igorw/evenement/zipball/0a16b0d71ab13284339abb99d9d2bd813640efbc", + "reference": "0a16b0d71ab13284339abb99d9d2bd813640efbc", + "shasum": "" + }, + "require": { + "php": ">=7.0" + }, + "require-dev": { + "phpunit/phpunit": "^9 || ^6" + }, + "type": "library", + "autoload": { + "psr-4": { + "Evenement\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Igor Wiedler", + "email": "igor@wiedler.ch" + } + ], + "description": "Événement is a very simple event dispatching library for PHP", + "keywords": [ + "event-dispatcher", + "event-emitter" + ], + "support": { + "issues": "https://github.com/igorw/evenement/issues", + "source": "https://github.com/igorw/evenement/tree/v3.0.2" + }, + "time": "2023-08-08T05:53:35+00:00" + }, { "name": "fidry/cpu-core-counter", "version": "1.2.0", @@ -358,6 +617,109 @@ ], "time": "2024-09-25T12:00:00+00:00" }, + { + "name": "friendsofphp/php-cs-fixer", + "version": "v3.64.0", + "source": { + "type": "git", + "url": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer.git", + "reference": "58dd9c931c785a79739310aef5178928305ffa67" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/PHP-CS-Fixer/PHP-CS-Fixer/zipball/58dd9c931c785a79739310aef5178928305ffa67", + "reference": "58dd9c931c785a79739310aef5178928305ffa67", + "shasum": "" + }, + "require": { + "clue/ndjson-react": "^1.0", + "composer/semver": "^3.4", + "composer/xdebug-handler": "^3.0.3", + "ext-filter": "*", + "ext-json": "*", + "ext-tokenizer": "*", + "fidry/cpu-core-counter": "^1.0", + "php": "^7.4 || ^8.0", + "react/child-process": "^0.6.5", + "react/event-loop": "^1.0", + "react/promise": "^2.0 || ^3.0", + "react/socket": "^1.0", + "react/stream": "^1.0", + "sebastian/diff": "^4.0 || ^5.0 || ^6.0", + "symfony/console": "^5.4 || ^6.0 || ^7.0", + "symfony/event-dispatcher": "^5.4 || ^6.0 || ^7.0", + "symfony/filesystem": "^5.4 || ^6.0 || ^7.0", + "symfony/finder": "^5.4 || ^6.0 || ^7.0", + "symfony/options-resolver": "^5.4 || ^6.0 || ^7.0", + "symfony/polyfill-mbstring": "^1.28", + "symfony/polyfill-php80": "^1.28", + "symfony/polyfill-php81": "^1.28", + "symfony/process": "^5.4 || ^6.0 || ^7.0", + "symfony/stopwatch": "^5.4 || ^6.0 || ^7.0" + }, + "require-dev": { + "facile-it/paraunit": "^1.3 || ^2.3", + "infection/infection": "^0.29.5", + "justinrainbow/json-schema": "^5.2", + "keradus/cli-executor": "^2.1", + "mikey179/vfsstream": "^1.6.11", + "php-coveralls/php-coveralls": "^2.7", + "php-cs-fixer/accessible-object": "^1.1", + "php-cs-fixer/phpunit-constraint-isidenticalstring": "^1.5", + "php-cs-fixer/phpunit-constraint-xmlmatchesxsd": "^1.5", + "phpunit/phpunit": "^9.6.19 || ^10.5.21 || ^11.2", + "symfony/var-dumper": "^5.4 || ^6.0 || ^7.0", + "symfony/yaml": "^5.4 || ^6.0 || ^7.0" + }, + "suggest": { + "ext-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/" + }, + "exclude-from-classmap": [ + "src/Fixer/Internal/*" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Dariusz Rumiński", + "email": "dariusz.ruminski@gmail.com" + } + ], + "description": "A tool to automatically fix PHP code style", + "keywords": [ + "Static code analysis", + "fixer", + "standards", + "static analysis" + ], + "support": { + "issues": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues", + "source": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/tree/v3.64.0" + }, + "funding": [ + { + "url": "https://github.com/keradus", + "type": "github" + } + ], + "time": "2024-08-30T23:09:38+00:00" + }, { "name": "jean85/pretty-package-versions", "version": "2.0.6", @@ -1338,16 +1700,16 @@ }, { "name": "phpstan/phpdoc-parser", - "version": "1.32.0", + "version": "1.33.0", "source": { "type": "git", "url": "https://github.com/phpstan/phpdoc-parser.git", - "reference": "6ca22b154efdd9e3c68c56f5d94670920a1c19a4" + "reference": "82a311fd3690fb2bf7b64d5c98f912b3dd746140" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/6ca22b154efdd9e3c68c56f5d94670920a1c19a4", - "reference": "6ca22b154efdd9e3c68c56f5d94670920a1c19a4", + "url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/82a311fd3690fb2bf7b64d5c98f912b3dd746140", + "reference": "82a311fd3690fb2bf7b64d5c98f912b3dd746140", "shasum": "" }, "require": { @@ -1379,9 +1741,9 @@ "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.32.0" + "source": "https://github.com/phpstan/phpdoc-parser/tree/1.33.0" }, - "time": "2024-09-26T07:23:32+00:00" + "time": "2024-10-13T11:25:22+00:00" }, { "name": "phpstan/phpstan", @@ -1918,31 +2280,31 @@ "time": "2021-11-05T16:47:00+00:00" }, { - "name": "psr/log", - "version": "3.0.2", + "name": "psr/event-dispatcher", + "version": "1.0.0", "source": { "type": "git", - "url": "https://github.com/php-fig/log.git", - "reference": "f16e1d5863e37f8d8c2a01719f5b34baa2b714d3" + "url": "https://github.com/php-fig/event-dispatcher.git", + "reference": "dbefd12671e8a14ec7f180cab83036ed26714bb0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/log/zipball/f16e1d5863e37f8d8c2a01719f5b34baa2b714d3", - "reference": "f16e1d5863e37f8d8c2a01719f5b34baa2b714d3", + "url": "https://api.github.com/repos/php-fig/event-dispatcher/zipball/dbefd12671e8a14ec7f180cab83036ed26714bb0", + "reference": "dbefd12671e8a14ec7f180cab83036ed26714bb0", "shasum": "" }, "require": { - "php": ">=8.0.0" + "php": ">=7.2.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.x-dev" + "dev-master": "1.0.x-dev" } }, "autoload": { "psr-4": { - "Psr\\Log\\": "src" + "Psr\\EventDispatcher\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", @@ -1952,33 +2314,33 @@ "authors": [ { "name": "PHP-FIG", - "homepage": "https://www.php-fig.org/" + "homepage": "http://www.php-fig.org/" } ], - "description": "Common interface for logging libraries", - "homepage": "https://github.com/php-fig/log", + "description": "Standard interfaces for event handling.", "keywords": [ - "log", + "events", "psr", - "psr-3" + "psr-14" ], "support": { - "source": "https://github.com/php-fig/log/tree/3.0.2" + "issues": "https://github.com/php-fig/event-dispatcher/issues", + "source": "https://github.com/php-fig/event-dispatcher/tree/1.0.0" }, - "time": "2024-09-11T13:17:53+00:00" + "time": "2019-01-08T18:20:26+00:00" }, { - "name": "psr/simple-cache", - "version": "3.0.0", + "name": "psr/log", + "version": "3.0.2", "source": { "type": "git", - "url": "https://github.com/php-fig/simple-cache.git", - "reference": "764e0b3939f5ca87cb904f570ef9be2d78a07865" - }, + "url": "https://github.com/php-fig/log.git", + "reference": "f16e1d5863e37f8d8c2a01719f5b34baa2b714d3" + }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/simple-cache/zipball/764e0b3939f5ca87cb904f570ef9be2d78a07865", - "reference": "764e0b3939f5ca87cb904f570ef9be2d78a07865", + "url": "https://api.github.com/repos/php-fig/log/zipball/f16e1d5863e37f8d8c2a01719f5b34baa2b714d3", + "reference": "f16e1d5863e37f8d8c2a01719f5b34baa2b714d3", "shasum": "" }, "require": { @@ -1987,12 +2349,12 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "3.0.x-dev" + "dev-master": "3.x-dev" } }, "autoload": { "psr-4": { - "Psr\\SimpleCache\\": "src/" + "Psr\\Log\\": "src" } }, "notification-url": "https://packagist.org/downloads/", @@ -2005,560 +2367,623 @@ "homepage": "https://www.php-fig.org/" } ], - "description": "Common interfaces for simple caching", + "description": "Common interface for logging libraries", + "homepage": "https://github.com/php-fig/log", "keywords": [ - "cache", - "caching", + "log", "psr", - "psr-16", - "simple-cache" + "psr-3" ], "support": { - "source": "https://github.com/php-fig/simple-cache/tree/3.0.0" + "source": "https://github.com/php-fig/log/tree/3.0.2" }, - "time": "2021-10-29T13:26:27+00:00" + "time": "2024-09-11T13:17:53+00:00" }, { - "name": "sebastian/cli-parser", - "version": "3.0.2", + "name": "psr/simple-cache", + "version": "3.0.0", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/cli-parser.git", - "reference": "15c5dd40dc4f38794d383bb95465193f5e0ae180" + "url": "https://github.com/php-fig/simple-cache.git", + "reference": "764e0b3939f5ca87cb904f570ef9be2d78a07865" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/cli-parser/zipball/15c5dd40dc4f38794d383bb95465193f5e0ae180", - "reference": "15c5dd40dc4f38794d383bb95465193f5e0ae180", + "url": "https://api.github.com/repos/php-fig/simple-cache/zipball/764e0b3939f5ca87cb904f570ef9be2d78a07865", + "reference": "764e0b3939f5ca87cb904f570ef9be2d78a07865", "shasum": "" }, "require": { - "php": ">=8.2" - }, - "require-dev": { - "phpunit/phpunit": "^11.0" + "php": ">=8.0.0" }, "type": "library", "extra": { "branch-alias": { - "dev-main": "3.0-dev" + "dev-master": "3.0.x-dev" } }, "autoload": { - "classmap": [ - "src/" - ] + "psr-4": { + "Psr\\SimpleCache\\": "src/" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ - "BSD-3-Clause" + "MIT" ], "authors": [ { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" } ], - "description": "Library for parsing CLI options", - "homepage": "https://github.com/sebastianbergmann/cli-parser", + "description": "Common interfaces for simple caching", + "keywords": [ + "cache", + "caching", + "psr", + "psr-16", + "simple-cache" + ], "support": { - "issues": "https://github.com/sebastianbergmann/cli-parser/issues", - "security": "https://github.com/sebastianbergmann/cli-parser/security/policy", - "source": "https://github.com/sebastianbergmann/cli-parser/tree/3.0.2" + "source": "https://github.com/php-fig/simple-cache/tree/3.0.0" }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2024-07-03T04:41:36+00:00" + "time": "2021-10-29T13:26:27+00:00" }, { - "name": "sebastian/code-unit", - "version": "3.0.1", + "name": "react/cache", + "version": "v1.2.0", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/code-unit.git", - "reference": "6bb7d09d6623567178cf54126afa9c2310114268" + "url": "https://github.com/reactphp/cache.git", + "reference": "d47c472b64aa5608225f47965a484b75c7817d5b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/code-unit/zipball/6bb7d09d6623567178cf54126afa9c2310114268", - "reference": "6bb7d09d6623567178cf54126afa9c2310114268", + "url": "https://api.github.com/repos/reactphp/cache/zipball/d47c472b64aa5608225f47965a484b75c7817d5b", + "reference": "d47c472b64aa5608225f47965a484b75c7817d5b", "shasum": "" }, "require": { - "php": ">=8.2" + "php": ">=5.3.0", + "react/promise": "^3.0 || ^2.0 || ^1.1" }, "require-dev": { - "phpunit/phpunit": "^11.0" + "phpunit/phpunit": "^9.5 || ^5.7 || ^4.8.35" }, "type": "library", - "extra": { - "branch-alias": { - "dev-main": "3.0-dev" - } - }, "autoload": { - "classmap": [ - "src/" - ] + "psr-4": { + "React\\Cache\\": "src/" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ - "BSD-3-Clause" + "MIT" ], "authors": [ { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" + "name": "Christian Lück", + "email": "christian@clue.engineering", + "homepage": "https://clue.engineering/" + }, + { + "name": "Cees-Jan Kiewiet", + "email": "reactphp@ceesjankiewiet.nl", + "homepage": "https://wyrihaximus.net/" + }, + { + "name": "Jan Sorgalla", + "email": "jsorgalla@gmail.com", + "homepage": "https://sorgalla.com/" + }, + { + "name": "Chris Boden", + "email": "cboden@gmail.com", + "homepage": "https://cboden.dev/" } ], - "description": "Collection of value objects that represent the PHP code units", - "homepage": "https://github.com/sebastianbergmann/code-unit", + "description": "Async, Promise-based cache interface for ReactPHP", + "keywords": [ + "cache", + "caching", + "promise", + "reactphp" + ], "support": { - "issues": "https://github.com/sebastianbergmann/code-unit/issues", - "security": "https://github.com/sebastianbergmann/code-unit/security/policy", - "source": "https://github.com/sebastianbergmann/code-unit/tree/3.0.1" + "issues": "https://github.com/reactphp/cache/issues", + "source": "https://github.com/reactphp/cache/tree/v1.2.0" }, "funding": [ { - "url": "https://github.com/sebastianbergmann", - "type": "github" + "url": "https://opencollective.com/reactphp", + "type": "open_collective" } ], - "time": "2024-07-03T04:44:28+00:00" + "time": "2022-11-30T15:59:55+00:00" }, { - "name": "sebastian/code-unit-reverse-lookup", - "version": "4.0.1", + "name": "react/child-process", + "version": "v0.6.5", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/code-unit-reverse-lookup.git", - "reference": "183a9b2632194febd219bb9246eee421dad8d45e" + "url": "https://github.com/reactphp/child-process.git", + "reference": "e71eb1aa55f057c7a4a0d08d06b0b0a484bead43" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/183a9b2632194febd219bb9246eee421dad8d45e", - "reference": "183a9b2632194febd219bb9246eee421dad8d45e", + "url": "https://api.github.com/repos/reactphp/child-process/zipball/e71eb1aa55f057c7a4a0d08d06b0b0a484bead43", + "reference": "e71eb1aa55f057c7a4a0d08d06b0b0a484bead43", "shasum": "" }, "require": { - "php": ">=8.2" + "evenement/evenement": "^3.0 || ^2.0 || ^1.0", + "php": ">=5.3.0", + "react/event-loop": "^1.2", + "react/stream": "^1.2" }, "require-dev": { - "phpunit/phpunit": "^11.0" + "phpunit/phpunit": "^9.3 || ^5.7 || ^4.8.35", + "react/socket": "^1.8", + "sebastian/environment": "^5.0 || ^3.0 || ^2.0 || ^1.0" }, "type": "library", - "extra": { - "branch-alias": { - "dev-main": "4.0-dev" - } - }, "autoload": { - "classmap": [ - "src/" - ] + "psr-4": { + "React\\ChildProcess\\": "src" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ - "BSD-3-Clause" + "MIT" ], "authors": [ { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" + "name": "Christian Lück", + "email": "christian@clue.engineering", + "homepage": "https://clue.engineering/" + }, + { + "name": "Cees-Jan Kiewiet", + "email": "reactphp@ceesjankiewiet.nl", + "homepage": "https://wyrihaximus.net/" + }, + { + "name": "Jan Sorgalla", + "email": "jsorgalla@gmail.com", + "homepage": "https://sorgalla.com/" + }, + { + "name": "Chris Boden", + "email": "cboden@gmail.com", + "homepage": "https://cboden.dev/" } ], - "description": "Looks up which function or method a line of code belongs to", - "homepage": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/", + "description": "Event-driven library for executing child processes with ReactPHP.", + "keywords": [ + "event-driven", + "process", + "reactphp" + ], "support": { - "issues": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/issues", - "security": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/security/policy", - "source": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/tree/4.0.1" + "issues": "https://github.com/reactphp/child-process/issues", + "source": "https://github.com/reactphp/child-process/tree/v0.6.5" }, "funding": [ { - "url": "https://github.com/sebastianbergmann", + "url": "https://github.com/WyriHaximus", + "type": "github" + }, + { + "url": "https://github.com/clue", "type": "github" } ], - "time": "2024-07-03T04:45:54+00:00" + "time": "2022-09-16T13:41:56+00:00" }, { - "name": "sebastian/comparator", - "version": "6.1.0", + "name": "react/dns", + "version": "v1.13.0", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/comparator.git", - "reference": "fa37b9e2ca618cb051d71b60120952ee8ca8b03d" + "url": "https://github.com/reactphp/dns.git", + "reference": "eb8ae001b5a455665c89c1df97f6fb682f8fb0f5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/fa37b9e2ca618cb051d71b60120952ee8ca8b03d", - "reference": "fa37b9e2ca618cb051d71b60120952ee8ca8b03d", + "url": "https://api.github.com/repos/reactphp/dns/zipball/eb8ae001b5a455665c89c1df97f6fb682f8fb0f5", + "reference": "eb8ae001b5a455665c89c1df97f6fb682f8fb0f5", "shasum": "" }, "require": { - "ext-dom": "*", - "ext-mbstring": "*", - "php": ">=8.2", - "sebastian/diff": "^6.0", - "sebastian/exporter": "^6.0" + "php": ">=5.3.0", + "react/cache": "^1.0 || ^0.6 || ^0.5", + "react/event-loop": "^1.2", + "react/promise": "^3.2 || ^2.7 || ^1.2.1" }, "require-dev": { - "phpunit/phpunit": "^11.3" + "phpunit/phpunit": "^9.6 || ^5.7 || ^4.8.36", + "react/async": "^4.3 || ^3 || ^2", + "react/promise-timer": "^1.11" }, "type": "library", - "extra": { - "branch-alias": { - "dev-main": "6.1-dev" - } - }, "autoload": { - "classmap": [ - "src/" - ] + "psr-4": { + "React\\Dns\\": "src/" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ - "BSD-3-Clause" + "MIT" ], "authors": [ { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" + "name": "Christian Lück", + "email": "christian@clue.engineering", + "homepage": "https://clue.engineering/" }, { - "name": "Jeff Welch", - "email": "whatthejeff@gmail.com" + "name": "Cees-Jan Kiewiet", + "email": "reactphp@ceesjankiewiet.nl", + "homepage": "https://wyrihaximus.net/" }, { - "name": "Volker Dusch", - "email": "github@wallbash.com" + "name": "Jan Sorgalla", + "email": "jsorgalla@gmail.com", + "homepage": "https://sorgalla.com/" }, { - "name": "Bernhard Schussek", - "email": "bschussek@2bepublished.at" + "name": "Chris Boden", + "email": "cboden@gmail.com", + "homepage": "https://cboden.dev/" } ], - "description": "Provides the functionality to compare PHP values for equality", - "homepage": "https://github.com/sebastianbergmann/comparator", + "description": "Async DNS resolver for ReactPHP", "keywords": [ - "comparator", - "compare", - "equality" + "async", + "dns", + "dns-resolver", + "reactphp" ], "support": { - "issues": "https://github.com/sebastianbergmann/comparator/issues", - "security": "https://github.com/sebastianbergmann/comparator/security/policy", - "source": "https://github.com/sebastianbergmann/comparator/tree/6.1.0" + "issues": "https://github.com/reactphp/dns/issues", + "source": "https://github.com/reactphp/dns/tree/v1.13.0" }, "funding": [ { - "url": "https://github.com/sebastianbergmann", - "type": "github" + "url": "https://opencollective.com/reactphp", + "type": "open_collective" } ], - "time": "2024-09-11T15:42:56+00:00" + "time": "2024-06-13T14:18:03+00:00" }, { - "name": "sebastian/complexity", - "version": "4.0.1", + "name": "react/event-loop", + "version": "v1.5.0", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/complexity.git", - "reference": "ee41d384ab1906c68852636b6de493846e13e5a0" + "url": "https://github.com/reactphp/event-loop.git", + "reference": "bbe0bd8c51ffc05ee43f1729087ed3bdf7d53354" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/complexity/zipball/ee41d384ab1906c68852636b6de493846e13e5a0", - "reference": "ee41d384ab1906c68852636b6de493846e13e5a0", + "url": "https://api.github.com/repos/reactphp/event-loop/zipball/bbe0bd8c51ffc05ee43f1729087ed3bdf7d53354", + "reference": "bbe0bd8c51ffc05ee43f1729087ed3bdf7d53354", "shasum": "" }, "require": { - "nikic/php-parser": "^5.0", - "php": ">=8.2" + "php": ">=5.3.0" }, "require-dev": { - "phpunit/phpunit": "^11.0" + "phpunit/phpunit": "^9.6 || ^5.7 || ^4.8.36" }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "4.0-dev" - } + "suggest": { + "ext-pcntl": "For signal handling support when using the StreamSelectLoop" }, + "type": "library", "autoload": { - "classmap": [ - "src/" - ] + "psr-4": { + "React\\EventLoop\\": "src/" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ - "BSD-3-Clause" + "MIT" ], "authors": [ { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" + "name": "Christian Lück", + "email": "christian@clue.engineering", + "homepage": "https://clue.engineering/" + }, + { + "name": "Cees-Jan Kiewiet", + "email": "reactphp@ceesjankiewiet.nl", + "homepage": "https://wyrihaximus.net/" + }, + { + "name": "Jan Sorgalla", + "email": "jsorgalla@gmail.com", + "homepage": "https://sorgalla.com/" + }, + { + "name": "Chris Boden", + "email": "cboden@gmail.com", + "homepage": "https://cboden.dev/" } ], - "description": "Library for calculating the complexity of PHP code units", - "homepage": "https://github.com/sebastianbergmann/complexity", + "description": "ReactPHP's core reactor event loop that libraries can use for evented I/O.", + "keywords": [ + "asynchronous", + "event-loop" + ], "support": { - "issues": "https://github.com/sebastianbergmann/complexity/issues", - "security": "https://github.com/sebastianbergmann/complexity/security/policy", - "source": "https://github.com/sebastianbergmann/complexity/tree/4.0.1" + "issues": "https://github.com/reactphp/event-loop/issues", + "source": "https://github.com/reactphp/event-loop/tree/v1.5.0" }, "funding": [ { - "url": "https://github.com/sebastianbergmann", - "type": "github" + "url": "https://opencollective.com/reactphp", + "type": "open_collective" } ], - "time": "2024-07-03T04:49:50+00:00" + "time": "2023-11-13T13:48:05+00:00" }, { - "name": "sebastian/diff", - "version": "6.0.2", + "name": "react/promise", + "version": "v3.2.0", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/diff.git", - "reference": "b4ccd857127db5d41a5b676f24b51371d76d8544" + "url": "https://github.com/reactphp/promise.git", + "reference": "8a164643313c71354582dc850b42b33fa12a4b63" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/b4ccd857127db5d41a5b676f24b51371d76d8544", - "reference": "b4ccd857127db5d41a5b676f24b51371d76d8544", + "url": "https://api.github.com/repos/reactphp/promise/zipball/8a164643313c71354582dc850b42b33fa12a4b63", + "reference": "8a164643313c71354582dc850b42b33fa12a4b63", "shasum": "" }, "require": { - "php": ">=8.2" + "php": ">=7.1.0" }, "require-dev": { - "phpunit/phpunit": "^11.0", - "symfony/process": "^4.2 || ^5" + "phpstan/phpstan": "1.10.39 || 1.4.10", + "phpunit/phpunit": "^9.6 || ^7.5" }, "type": "library", - "extra": { - "branch-alias": { - "dev-main": "6.0-dev" - } - }, "autoload": { - "classmap": [ - "src/" - ] + "files": [ + "src/functions_include.php" + ], + "psr-4": { + "React\\Promise\\": "src/" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ - "BSD-3-Clause" + "MIT" ], "authors": [ { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" + "name": "Jan Sorgalla", + "email": "jsorgalla@gmail.com", + "homepage": "https://sorgalla.com/" }, { - "name": "Kore Nordmann", - "email": "mail@kore-nordmann.de" + "name": "Christian Lück", + "email": "christian@clue.engineering", + "homepage": "https://clue.engineering/" + }, + { + "name": "Cees-Jan Kiewiet", + "email": "reactphp@ceesjankiewiet.nl", + "homepage": "https://wyrihaximus.net/" + }, + { + "name": "Chris Boden", + "email": "cboden@gmail.com", + "homepage": "https://cboden.dev/" } ], - "description": "Diff implementation", - "homepage": "https://github.com/sebastianbergmann/diff", + "description": "A lightweight implementation of CommonJS Promises/A for PHP", "keywords": [ - "diff", - "udiff", - "unidiff", - "unified diff" + "promise", + "promises" ], "support": { - "issues": "https://github.com/sebastianbergmann/diff/issues", - "security": "https://github.com/sebastianbergmann/diff/security/policy", - "source": "https://github.com/sebastianbergmann/diff/tree/6.0.2" + "issues": "https://github.com/reactphp/promise/issues", + "source": "https://github.com/reactphp/promise/tree/v3.2.0" }, "funding": [ { - "url": "https://github.com/sebastianbergmann", - "type": "github" + "url": "https://opencollective.com/reactphp", + "type": "open_collective" } ], - "time": "2024-07-03T04:53:05+00:00" + "time": "2024-05-24T10:39:05+00:00" }, { - "name": "sebastian/environment", - "version": "7.2.0", + "name": "react/socket", + "version": "v1.16.0", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/environment.git", - "reference": "855f3ae0ab316bbafe1ba4e16e9f3c078d24a0c5" + "url": "https://github.com/reactphp/socket.git", + "reference": "23e4ff33ea3e160d2d1f59a0e6050e4b0fb0eac1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/855f3ae0ab316bbafe1ba4e16e9f3c078d24a0c5", - "reference": "855f3ae0ab316bbafe1ba4e16e9f3c078d24a0c5", + "url": "https://api.github.com/repos/reactphp/socket/zipball/23e4ff33ea3e160d2d1f59a0e6050e4b0fb0eac1", + "reference": "23e4ff33ea3e160d2d1f59a0e6050e4b0fb0eac1", "shasum": "" }, "require": { - "php": ">=8.2" + "evenement/evenement": "^3.0 || ^2.0 || ^1.0", + "php": ">=5.3.0", + "react/dns": "^1.13", + "react/event-loop": "^1.2", + "react/promise": "^3.2 || ^2.6 || ^1.2.1", + "react/stream": "^1.4" }, "require-dev": { - "phpunit/phpunit": "^11.0" - }, - "suggest": { - "ext-posix": "*" + "phpunit/phpunit": "^9.6 || ^5.7 || ^4.8.36", + "react/async": "^4.3 || ^3.3 || ^2", + "react/promise-stream": "^1.4", + "react/promise-timer": "^1.11" }, "type": "library", - "extra": { - "branch-alias": { - "dev-main": "7.2-dev" - } - }, "autoload": { - "classmap": [ - "src/" - ] + "psr-4": { + "React\\Socket\\": "src/" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ - "BSD-3-Clause" + "MIT" ], "authors": [ { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" + "name": "Christian Lück", + "email": "christian@clue.engineering", + "homepage": "https://clue.engineering/" + }, + { + "name": "Cees-Jan Kiewiet", + "email": "reactphp@ceesjankiewiet.nl", + "homepage": "https://wyrihaximus.net/" + }, + { + "name": "Jan Sorgalla", + "email": "jsorgalla@gmail.com", + "homepage": "https://sorgalla.com/" + }, + { + "name": "Chris Boden", + "email": "cboden@gmail.com", + "homepage": "https://cboden.dev/" } ], - "description": "Provides functionality to handle HHVM/PHP environments", - "homepage": "https://github.com/sebastianbergmann/environment", + "description": "Async, streaming plaintext TCP/IP and secure TLS socket server and client connections for ReactPHP", "keywords": [ - "Xdebug", - "environment", - "hhvm" + "Connection", + "Socket", + "async", + "reactphp", + "stream" ], "support": { - "issues": "https://github.com/sebastianbergmann/environment/issues", - "security": "https://github.com/sebastianbergmann/environment/security/policy", - "source": "https://github.com/sebastianbergmann/environment/tree/7.2.0" + "issues": "https://github.com/reactphp/socket/issues", + "source": "https://github.com/reactphp/socket/tree/v1.16.0" }, "funding": [ { - "url": "https://github.com/sebastianbergmann", - "type": "github" + "url": "https://opencollective.com/reactphp", + "type": "open_collective" } ], - "time": "2024-07-03T04:54:44+00:00" + "time": "2024-07-26T10:38:09+00:00" }, { - "name": "sebastian/exporter", - "version": "6.1.3", + "name": "react/stream", + "version": "v1.4.0", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/exporter.git", - "reference": "c414673eee9a8f9d51bbf8d61fc9e3ef1e85b20e" + "url": "https://github.com/reactphp/stream.git", + "reference": "1e5b0acb8fe55143b5b426817155190eb6f5b18d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/c414673eee9a8f9d51bbf8d61fc9e3ef1e85b20e", - "reference": "c414673eee9a8f9d51bbf8d61fc9e3ef1e85b20e", + "url": "https://api.github.com/repos/reactphp/stream/zipball/1e5b0acb8fe55143b5b426817155190eb6f5b18d", + "reference": "1e5b0acb8fe55143b5b426817155190eb6f5b18d", "shasum": "" }, "require": { - "ext-mbstring": "*", - "php": ">=8.2", - "sebastian/recursion-context": "^6.0" + "evenement/evenement": "^3.0 || ^2.0 || ^1.0", + "php": ">=5.3.8", + "react/event-loop": "^1.2" }, "require-dev": { - "phpunit/phpunit": "^11.2" + "clue/stream-filter": "~1.2", + "phpunit/phpunit": "^9.6 || ^5.7 || ^4.8.36" }, "type": "library", - "extra": { - "branch-alias": { - "dev-main": "6.1-dev" - } - }, "autoload": { - "classmap": [ - "src/" - ] + "psr-4": { + "React\\Stream\\": "src/" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ - "BSD-3-Clause" + "MIT" ], "authors": [ { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - }, - { - "name": "Jeff Welch", - "email": "whatthejeff@gmail.com" + "name": "Christian Lück", + "email": "christian@clue.engineering", + "homepage": "https://clue.engineering/" }, { - "name": "Volker Dusch", - "email": "github@wallbash.com" + "name": "Cees-Jan Kiewiet", + "email": "reactphp@ceesjankiewiet.nl", + "homepage": "https://wyrihaximus.net/" }, { - "name": "Adam Harvey", - "email": "aharvey@php.net" + "name": "Jan Sorgalla", + "email": "jsorgalla@gmail.com", + "homepage": "https://sorgalla.com/" }, { - "name": "Bernhard Schussek", - "email": "bschussek@gmail.com" + "name": "Chris Boden", + "email": "cboden@gmail.com", + "homepage": "https://cboden.dev/" } ], - "description": "Provides the functionality to export PHP variables for visualization", - "homepage": "https://www.github.com/sebastianbergmann/exporter", + "description": "Event-driven readable and writable streams for non-blocking I/O in ReactPHP", "keywords": [ - "export", - "exporter" + "event-driven", + "io", + "non-blocking", + "pipe", + "reactphp", + "readable", + "stream", + "writable" ], "support": { - "issues": "https://github.com/sebastianbergmann/exporter/issues", - "security": "https://github.com/sebastianbergmann/exporter/security/policy", - "source": "https://github.com/sebastianbergmann/exporter/tree/6.1.3" + "issues": "https://github.com/reactphp/stream/issues", + "source": "https://github.com/reactphp/stream/tree/v1.4.0" }, "funding": [ { - "url": "https://github.com/sebastianbergmann", - "type": "github" + "url": "https://opencollective.com/reactphp", + "type": "open_collective" } ], - "time": "2024-07-03T04:56:19+00:00" + "time": "2024-06-11T12:45:25+00:00" }, { - "name": "sebastian/global-state", - "version": "7.0.2", + "name": "sebastian/cli-parser", + "version": "3.0.2", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/global-state.git", - "reference": "3be331570a721f9a4b5917f4209773de17f747d7" + "url": "https://github.com/sebastianbergmann/cli-parser.git", + "reference": "15c5dd40dc4f38794d383bb95465193f5e0ae180" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/3be331570a721f9a4b5917f4209773de17f747d7", - "reference": "3be331570a721f9a4b5917f4209773de17f747d7", + "url": "https://api.github.com/repos/sebastianbergmann/cli-parser/zipball/15c5dd40dc4f38794d383bb95465193f5e0ae180", + "reference": "15c5dd40dc4f38794d383bb95465193f5e0ae180", "shasum": "" }, "require": { - "php": ">=8.2", - "sebastian/object-reflector": "^4.0", - "sebastian/recursion-context": "^6.0" + "php": ">=8.2" }, "require-dev": { - "ext-dom": "*", "phpunit/phpunit": "^11.0" }, "type": "library", "extra": { "branch-alias": { - "dev-main": "7.0-dev" + "dev-main": "3.0-dev" } }, "autoload": { @@ -2573,18 +2998,16 @@ "authors": [ { "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" + "email": "sebastian@phpunit.de", + "role": "lead" } ], - "description": "Snapshotting of global state", - "homepage": "https://www.github.com/sebastianbergmann/global-state", - "keywords": [ - "global state" - ], + "description": "Library for parsing CLI options", + "homepage": "https://github.com/sebastianbergmann/cli-parser", "support": { - "issues": "https://github.com/sebastianbergmann/global-state/issues", - "security": "https://github.com/sebastianbergmann/global-state/security/policy", - "source": "https://github.com/sebastianbergmann/global-state/tree/7.0.2" + "issues": "https://github.com/sebastianbergmann/cli-parser/issues", + "security": "https://github.com/sebastianbergmann/cli-parser/security/policy", + "source": "https://github.com/sebastianbergmann/cli-parser/tree/3.0.2" }, "funding": [ { @@ -2592,24 +3015,23 @@ "type": "github" } ], - "time": "2024-07-03T04:57:36+00:00" + "time": "2024-07-03T04:41:36+00:00" }, { - "name": "sebastian/lines-of-code", + "name": "sebastian/code-unit", "version": "3.0.1", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/lines-of-code.git", - "reference": "d36ad0d782e5756913e42ad87cb2890f4ffe467a" + "url": "https://github.com/sebastianbergmann/code-unit.git", + "reference": "6bb7d09d6623567178cf54126afa9c2310114268" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/lines-of-code/zipball/d36ad0d782e5756913e42ad87cb2890f4ffe467a", - "reference": "d36ad0d782e5756913e42ad87cb2890f4ffe467a", + "url": "https://api.github.com/repos/sebastianbergmann/code-unit/zipball/6bb7d09d6623567178cf54126afa9c2310114268", + "reference": "6bb7d09d6623567178cf54126afa9c2310114268", "shasum": "" }, "require": { - "nikic/php-parser": "^5.0", "php": ">=8.2" }, "require-dev": { @@ -2637,12 +3059,12 @@ "role": "lead" } ], - "description": "Library for counting the lines of code in PHP source code", - "homepage": "https://github.com/sebastianbergmann/lines-of-code", + "description": "Collection of value objects that represent the PHP code units", + "homepage": "https://github.com/sebastianbergmann/code-unit", "support": { - "issues": "https://github.com/sebastianbergmann/lines-of-code/issues", - "security": "https://github.com/sebastianbergmann/lines-of-code/security/policy", - "source": "https://github.com/sebastianbergmann/lines-of-code/tree/3.0.1" + "issues": "https://github.com/sebastianbergmann/code-unit/issues", + "security": "https://github.com/sebastianbergmann/code-unit/security/policy", + "source": "https://github.com/sebastianbergmann/code-unit/tree/3.0.1" }, "funding": [ { @@ -2650,26 +3072,24 @@ "type": "github" } ], - "time": "2024-07-03T04:58:38+00:00" + "time": "2024-07-03T04:44:28+00:00" }, { - "name": "sebastian/object-enumerator", - "version": "6.0.1", + "name": "sebastian/code-unit-reverse-lookup", + "version": "4.0.1", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/object-enumerator.git", - "reference": "f5b498e631a74204185071eb41f33f38d64608aa" + "url": "https://github.com/sebastianbergmann/code-unit-reverse-lookup.git", + "reference": "183a9b2632194febd219bb9246eee421dad8d45e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/f5b498e631a74204185071eb41f33f38d64608aa", - "reference": "f5b498e631a74204185071eb41f33f38d64608aa", + "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/183a9b2632194febd219bb9246eee421dad8d45e", + "reference": "183a9b2632194febd219bb9246eee421dad8d45e", "shasum": "" }, "require": { - "php": ">=8.2", - "sebastian/object-reflector": "^4.0", - "sebastian/recursion-context": "^6.0" + "php": ">=8.2" }, "require-dev": { "phpunit/phpunit": "^11.0" @@ -2677,7 +3097,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "6.0-dev" + "dev-main": "4.0-dev" } }, "autoload": { @@ -2695,12 +3115,12 @@ "email": "sebastian@phpunit.de" } ], - "description": "Traverses array structures and object graphs to enumerate all referenced objects", - "homepage": "https://github.com/sebastianbergmann/object-enumerator/", + "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/object-enumerator/issues", - "security": "https://github.com/sebastianbergmann/object-enumerator/security/policy", - "source": "https://github.com/sebastianbergmann/object-enumerator/tree/6.0.1" + "issues": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/issues", + "security": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/security/policy", + "source": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/tree/4.0.1" }, "funding": [ { @@ -2708,32 +3128,36 @@ "type": "github" } ], - "time": "2024-07-03T05:00:13+00:00" + "time": "2024-07-03T04:45:54+00:00" }, { - "name": "sebastian/object-reflector", - "version": "4.0.1", + "name": "sebastian/comparator", + "version": "6.1.0", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/object-reflector.git", - "reference": "6e1a43b411b2ad34146dee7524cb13a068bb35f9" + "url": "https://github.com/sebastianbergmann/comparator.git", + "reference": "fa37b9e2ca618cb051d71b60120952ee8ca8b03d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/object-reflector/zipball/6e1a43b411b2ad34146dee7524cb13a068bb35f9", - "reference": "6e1a43b411b2ad34146dee7524cb13a068bb35f9", + "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/fa37b9e2ca618cb051d71b60120952ee8ca8b03d", + "reference": "fa37b9e2ca618cb051d71b60120952ee8ca8b03d", "shasum": "" }, "require": { - "php": ">=8.2" + "ext-dom": "*", + "ext-mbstring": "*", + "php": ">=8.2", + "sebastian/diff": "^6.0", + "sebastian/exporter": "^6.0" }, "require-dev": { - "phpunit/phpunit": "^11.0" + "phpunit/phpunit": "^11.3" }, "type": "library", "extra": { "branch-alias": { - "dev-main": "4.0-dev" + "dev-main": "6.1-dev" } }, "autoload": { @@ -2749,14 +3173,31 @@ { "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": "Allows reflection of object attributes, including inherited and non-public ones", - "homepage": "https://github.com/sebastianbergmann/object-reflector/", + "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/object-reflector/issues", - "security": "https://github.com/sebastianbergmann/object-reflector/security/policy", - "source": "https://github.com/sebastianbergmann/object-reflector/tree/4.0.1" + "issues": "https://github.com/sebastianbergmann/comparator/issues", + "security": "https://github.com/sebastianbergmann/comparator/security/policy", + "source": "https://github.com/sebastianbergmann/comparator/tree/6.1.0" }, "funding": [ { @@ -2764,23 +3205,24 @@ "type": "github" } ], - "time": "2024-07-03T05:01:32+00:00" + "time": "2024-09-11T15:42:56+00:00" }, { - "name": "sebastian/recursion-context", - "version": "6.0.2", + "name": "sebastian/complexity", + "version": "4.0.1", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/recursion-context.git", - "reference": "694d156164372abbd149a4b85ccda2e4670c0e16" + "url": "https://github.com/sebastianbergmann/complexity.git", + "reference": "ee41d384ab1906c68852636b6de493846e13e5a0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/694d156164372abbd149a4b85ccda2e4670c0e16", - "reference": "694d156164372abbd149a4b85ccda2e4670c0e16", + "url": "https://api.github.com/repos/sebastianbergmann/complexity/zipball/ee41d384ab1906c68852636b6de493846e13e5a0", + "reference": "ee41d384ab1906c68852636b6de493846e13e5a0", "shasum": "" }, "require": { + "nikic/php-parser": "^5.0", "php": ">=8.2" }, "require-dev": { @@ -2789,7 +3231,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "6.0-dev" + "dev-main": "4.0-dev" } }, "autoload": { @@ -2804,23 +3246,16 @@ "authors": [ { "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - }, - { - "name": "Jeff Welch", - "email": "whatthejeff@gmail.com" - }, - { - "name": "Adam Harvey", - "email": "aharvey@php.net" + "email": "sebastian@phpunit.de", + "role": "lead" } ], - "description": "Provides functionality to recursively process PHP variables", - "homepage": "https://github.com/sebastianbergmann/recursion-context", + "description": "Library for calculating the complexity of PHP code units", + "homepage": "https://github.com/sebastianbergmann/complexity", "support": { - "issues": "https://github.com/sebastianbergmann/recursion-context/issues", - "security": "https://github.com/sebastianbergmann/recursion-context/security/policy", - "source": "https://github.com/sebastianbergmann/recursion-context/tree/6.0.2" + "issues": "https://github.com/sebastianbergmann/complexity/issues", + "security": "https://github.com/sebastianbergmann/complexity/security/policy", + "source": "https://github.com/sebastianbergmann/complexity/tree/4.0.1" }, "funding": [ { @@ -2828,32 +3263,33 @@ "type": "github" } ], - "time": "2024-07-03T05:10:34+00:00" + "time": "2024-07-03T04:49:50+00:00" }, { - "name": "sebastian/type", - "version": "5.1.0", + "name": "sebastian/diff", + "version": "6.0.2", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/type.git", - "reference": "461b9c5da241511a2a0e8f240814fb23ce5c0aac" + "url": "https://github.com/sebastianbergmann/diff.git", + "reference": "b4ccd857127db5d41a5b676f24b51371d76d8544" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/461b9c5da241511a2a0e8f240814fb23ce5c0aac", - "reference": "461b9c5da241511a2a0e8f240814fb23ce5c0aac", + "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/b4ccd857127db5d41a5b676f24b51371d76d8544", + "reference": "b4ccd857127db5d41a5b676f24b51371d76d8544", "shasum": "" }, "require": { "php": ">=8.2" }, "require-dev": { - "phpunit/phpunit": "^11.3" + "phpunit/phpunit": "^11.0", + "symfony/process": "^4.2 || ^5" }, "type": "library", "extra": { "branch-alias": { - "dev-main": "5.1-dev" + "dev-main": "6.0-dev" } }, "autoload": { @@ -2868,16 +3304,25 @@ "authors": [ { "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" + "email": "sebastian@phpunit.de" + }, + { + "name": "Kore Nordmann", + "email": "mail@kore-nordmann.de" } ], - "description": "Collection of value objects that represent the types of the PHP type system", - "homepage": "https://github.com/sebastianbergmann/type", + "description": "Diff implementation", + "homepage": "https://github.com/sebastianbergmann/diff", + "keywords": [ + "diff", + "udiff", + "unidiff", + "unified diff" + ], "support": { - "issues": "https://github.com/sebastianbergmann/type/issues", - "security": "https://github.com/sebastianbergmann/type/security/policy", - "source": "https://github.com/sebastianbergmann/type/tree/5.1.0" + "issues": "https://github.com/sebastianbergmann/diff/issues", + "security": "https://github.com/sebastianbergmann/diff/security/policy", + "source": "https://github.com/sebastianbergmann/diff/tree/6.0.2" }, "funding": [ { @@ -2885,29 +3330,35 @@ "type": "github" } ], - "time": "2024-09-17T13:12:04+00:00" + "time": "2024-07-03T04:53:05+00:00" }, { - "name": "sebastian/version", - "version": "5.0.2", + "name": "sebastian/environment", + "version": "7.2.0", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/version.git", - "reference": "c687e3387b99f5b03b6caa64c74b63e2936ff874" + "url": "https://github.com/sebastianbergmann/environment.git", + "reference": "855f3ae0ab316bbafe1ba4e16e9f3c078d24a0c5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/c687e3387b99f5b03b6caa64c74b63e2936ff874", - "reference": "c687e3387b99f5b03b6caa64c74b63e2936ff874", + "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/855f3ae0ab316bbafe1ba4e16e9f3c078d24a0c5", + "reference": "855f3ae0ab316bbafe1ba4e16e9f3c078d24a0c5", "shasum": "" }, "require": { "php": ">=8.2" }, + "require-dev": { + "phpunit/phpunit": "^11.0" + }, + "suggest": { + "ext-posix": "*" + }, "type": "library", "extra": { "branch-alias": { - "dev-main": "5.0-dev" + "dev-main": "7.2-dev" } }, "autoload": { @@ -2922,16 +3373,20 @@ "authors": [ { "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" + "email": "sebastian@phpunit.de" } ], - "description": "Library that helps with managing the version number of Git-hosted PHP projects", - "homepage": "https://github.com/sebastianbergmann/version", + "description": "Provides functionality to handle HHVM/PHP environments", + "homepage": "https://github.com/sebastianbergmann/environment", + "keywords": [ + "Xdebug", + "environment", + "hhvm" + ], "support": { - "issues": "https://github.com/sebastianbergmann/version/issues", - "security": "https://github.com/sebastianbergmann/version/security/policy", - "source": "https://github.com/sebastianbergmann/version/tree/5.0.2" + "issues": "https://github.com/sebastianbergmann/environment/issues", + "security": "https://github.com/sebastianbergmann/environment/security/policy", + "source": "https://github.com/sebastianbergmann/environment/tree/7.2.0" }, "funding": [ { @@ -2939,182 +3394,524 @@ "type": "github" } ], - "time": "2024-10-09T05:16:32+00:00" + "time": "2024-07-03T04:54:44+00:00" }, { - "name": "slevomat/coding-standard", - "version": "8.15.0", + "name": "sebastian/exporter", + "version": "6.1.3", "source": { "type": "git", - "url": "https://github.com/slevomat/coding-standard.git", - "reference": "7d1d957421618a3803b593ec31ace470177d7817" + "url": "https://github.com/sebastianbergmann/exporter.git", + "reference": "c414673eee9a8f9d51bbf8d61fc9e3ef1e85b20e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/slevomat/coding-standard/zipball/7d1d957421618a3803b593ec31ace470177d7817", - "reference": "7d1d957421618a3803b593ec31ace470177d7817", + "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/c414673eee9a8f9d51bbf8d61fc9e3ef1e85b20e", + "reference": "c414673eee9a8f9d51bbf8d61fc9e3ef1e85b20e", "shasum": "" }, "require": { - "dealerdirect/phpcodesniffer-composer-installer": "^0.6.2 || ^0.7 || ^1.0", - "php": "^7.2 || ^8.0", - "phpstan/phpdoc-parser": "^1.23.1", - "squizlabs/php_codesniffer": "^3.9.0" + "ext-mbstring": "*", + "php": ">=8.2", + "sebastian/recursion-context": "^6.0" }, "require-dev": { - "phing/phing": "2.17.4", - "php-parallel-lint/php-parallel-lint": "1.3.2", - "phpstan/phpstan": "1.10.60", - "phpstan/phpstan-deprecation-rules": "1.1.4", - "phpstan/phpstan-phpunit": "1.3.16", - "phpstan/phpstan-strict-rules": "1.5.2", - "phpunit/phpunit": "8.5.21|9.6.8|10.5.11" - }, - "type": "phpcodesniffer-standard", + "phpunit/phpunit": "^11.2" + }, + "type": "library", "extra": { "branch-alias": { - "dev-master": "8.x-dev" + "dev-main": "6.1-dev" } }, "autoload": { - "psr-4": { - "SlevomatCodingStandard\\": "SlevomatCodingStandard/" - } + "classmap": [ + "src/" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ - "MIT" + "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": "Slevomat Coding Standard for PHP_CodeSniffer complements Consistence Coding Standard by providing sniffs with additional checks.", + "description": "Provides the functionality to export PHP variables for visualization", + "homepage": "https://www.github.com/sebastianbergmann/exporter", "keywords": [ - "dev", - "phpcs" + "export", + "exporter" ], "support": { - "issues": "https://github.com/slevomat/coding-standard/issues", - "source": "https://github.com/slevomat/coding-standard/tree/8.15.0" + "issues": "https://github.com/sebastianbergmann/exporter/issues", + "security": "https://github.com/sebastianbergmann/exporter/security/policy", + "source": "https://github.com/sebastianbergmann/exporter/tree/6.1.3" }, "funding": [ { - "url": "https://github.com/kukulich", + "url": "https://github.com/sebastianbergmann", "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/slevomat/coding-standard", - "type": "tidelift" } ], - "time": "2024-03-09T15:20:58+00:00" + "time": "2024-07-03T04:56:19+00:00" }, { - "name": "squizlabs/php_codesniffer", - "version": "3.10.3", + "name": "sebastian/global-state", + "version": "7.0.2", "source": { "type": "git", - "url": "https://github.com/PHPCSStandards/PHP_CodeSniffer.git", - "reference": "62d32998e820bddc40f99f8251958aed187a5c9c" + "url": "https://github.com/sebastianbergmann/global-state.git", + "reference": "3be331570a721f9a4b5917f4209773de17f747d7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHPCSStandards/PHP_CodeSniffer/zipball/62d32998e820bddc40f99f8251958aed187a5c9c", - "reference": "62d32998e820bddc40f99f8251958aed187a5c9c", + "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/3be331570a721f9a4b5917f4209773de17f747d7", + "reference": "3be331570a721f9a4b5917f4209773de17f747d7", "shasum": "" }, "require": { - "ext-simplexml": "*", - "ext-tokenizer": "*", - "ext-xmlwriter": "*", - "php": ">=5.4.0" + "php": ">=8.2", + "sebastian/object-reflector": "^4.0", + "sebastian/recursion-context": "^6.0" }, "require-dev": { - "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0 || ^8.0 || ^9.3.4" + "ext-dom": "*", + "phpunit/phpunit": "^11.0" }, - "bin": [ - "bin/phpcbf", - "bin/phpcs" - ], "type": "library", "extra": { "branch-alias": { - "dev-master": "3.x-dev" + "dev-main": "7.0-dev" } }, + "autoload": { + "classmap": [ + "src/" + ] + }, "notification-url": "https://packagist.org/downloads/", "license": [ "BSD-3-Clause" ], "authors": [ { - "name": "Greg Sherwood", - "role": "Former lead" - }, - { - "name": "Juliette Reinders Folmer", - "role": "Current lead" - }, - { - "name": "Contributors", - "homepage": "https://github.com/PHPCSStandards/PHP_CodeSniffer/graphs/contributors" + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" } ], - "description": "PHP_CodeSniffer tokenizes PHP, JavaScript and CSS files and detects violations of a defined set of coding standards.", - "homepage": "https://github.com/PHPCSStandards/PHP_CodeSniffer", + "description": "Snapshotting of global state", + "homepage": "https://www.github.com/sebastianbergmann/global-state", "keywords": [ - "phpcs", - "standards", - "static analysis" + "global state" ], "support": { - "issues": "https://github.com/PHPCSStandards/PHP_CodeSniffer/issues", - "security": "https://github.com/PHPCSStandards/PHP_CodeSniffer/security/policy", - "source": "https://github.com/PHPCSStandards/PHP_CodeSniffer", - "wiki": "https://github.com/PHPCSStandards/PHP_CodeSniffer/wiki" + "issues": "https://github.com/sebastianbergmann/global-state/issues", + "security": "https://github.com/sebastianbergmann/global-state/security/policy", + "source": "https://github.com/sebastianbergmann/global-state/tree/7.0.2" }, "funding": [ { - "url": "https://github.com/PHPCSStandards", - "type": "github" - }, - { - "url": "https://github.com/jrfnl", + "url": "https://github.com/sebastianbergmann", "type": "github" - }, - { - "url": "https://opencollective.com/php_codesniffer", - "type": "open_collective" } ], - "time": "2024-09-18T10:38:58+00:00" + "time": "2024-07-03T04:57:36+00:00" }, { - "name": "symfony/console", - "version": "v7.1.5", + "name": "sebastian/lines-of-code", + "version": "3.0.1", "source": { "type": "git", - "url": "https://github.com/symfony/console.git", - "reference": "0fa539d12b3ccf068a722bbbffa07ca7079af9ee" + "url": "https://github.com/sebastianbergmann/lines-of-code.git", + "reference": "d36ad0d782e5756913e42ad87cb2890f4ffe467a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/0fa539d12b3ccf068a722bbbffa07ca7079af9ee", - "reference": "0fa539d12b3ccf068a722bbbffa07ca7079af9ee", + "url": "https://api.github.com/repos/sebastianbergmann/lines-of-code/zipball/d36ad0d782e5756913e42ad87cb2890f4ffe467a", + "reference": "d36ad0d782e5756913e42ad87cb2890f4ffe467a", "shasum": "" }, "require": { - "php": ">=8.2", - "symfony/polyfill-mbstring": "~1.0", - "symfony/service-contracts": "^2.5|^3", - "symfony/string": "^6.4|^7.0" - }, - "conflict": { - "symfony/dependency-injection": "<6.4", - "symfony/dotenv": "<6.4", - "symfony/event-dispatcher": "<6.4", - "symfony/lock": "<6.4", - "symfony/process": "<6.4" - }, - "provide": { - "psr/log-implementation": "1.0|2.0|3.0" + "nikic/php-parser": "^5.0", + "php": ">=8.2" + }, + "require-dev": { + "phpunit/phpunit": "^11.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "3.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Library for counting the lines of code in PHP source code", + "homepage": "https://github.com/sebastianbergmann/lines-of-code", + "support": { + "issues": "https://github.com/sebastianbergmann/lines-of-code/issues", + "security": "https://github.com/sebastianbergmann/lines-of-code/security/policy", + "source": "https://github.com/sebastianbergmann/lines-of-code/tree/3.0.1" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2024-07-03T04:58:38+00:00" + }, + { + "name": "sebastian/object-enumerator", + "version": "6.0.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/object-enumerator.git", + "reference": "f5b498e631a74204185071eb41f33f38d64608aa" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/f5b498e631a74204185071eb41f33f38d64608aa", + "reference": "f5b498e631a74204185071eb41f33f38d64608aa", + "shasum": "" + }, + "require": { + "php": ">=8.2", + "sebastian/object-reflector": "^4.0", + "sebastian/recursion-context": "^6.0" + }, + "require-dev": { + "phpunit/phpunit": "^11.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": "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", + "security": "https://github.com/sebastianbergmann/object-enumerator/security/policy", + "source": "https://github.com/sebastianbergmann/object-enumerator/tree/6.0.1" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2024-07-03T05:00:13+00:00" + }, + { + "name": "sebastian/object-reflector", + "version": "4.0.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/object-reflector.git", + "reference": "6e1a43b411b2ad34146dee7524cb13a068bb35f9" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/object-reflector/zipball/6e1a43b411b2ad34146dee7524cb13a068bb35f9", + "reference": "6e1a43b411b2ad34146dee7524cb13a068bb35f9", + "shasum": "" + }, + "require": { + "php": ">=8.2" + }, + "require-dev": { + "phpunit/phpunit": "^11.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "4.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "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", + "security": "https://github.com/sebastianbergmann/object-reflector/security/policy", + "source": "https://github.com/sebastianbergmann/object-reflector/tree/4.0.1" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2024-07-03T05:01:32+00:00" + }, + { + "name": "sebastian/recursion-context", + "version": "6.0.2", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/recursion-context.git", + "reference": "694d156164372abbd149a4b85ccda2e4670c0e16" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/694d156164372abbd149a4b85ccda2e4670c0e16", + "reference": "694d156164372abbd149a4b85ccda2e4670c0e16", + "shasum": "" + }, + "require": { + "php": ">=8.2" + }, + "require-dev": { + "phpunit/phpunit": "^11.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" + }, + { + "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", + "security": "https://github.com/sebastianbergmann/recursion-context/security/policy", + "source": "https://github.com/sebastianbergmann/recursion-context/tree/6.0.2" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2024-07-03T05:10:34+00:00" + }, + { + "name": "sebastian/type", + "version": "5.1.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/type.git", + "reference": "461b9c5da241511a2a0e8f240814fb23ce5c0aac" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/461b9c5da241511a2a0e8f240814fb23ce5c0aac", + "reference": "461b9c5da241511a2a0e8f240814fb23ce5c0aac", + "shasum": "" + }, + "require": { + "php": ">=8.2" + }, + "require-dev": { + "phpunit/phpunit": "^11.3" + }, + "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", + "role": "lead" + } + ], + "description": "Collection of value objects that represent the types of the PHP type system", + "homepage": "https://github.com/sebastianbergmann/type", + "support": { + "issues": "https://github.com/sebastianbergmann/type/issues", + "security": "https://github.com/sebastianbergmann/type/security/policy", + "source": "https://github.com/sebastianbergmann/type/tree/5.1.0" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2024-09-17T13:12:04+00:00" + }, + { + "name": "sebastian/version", + "version": "5.0.2", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/version.git", + "reference": "c687e3387b99f5b03b6caa64c74b63e2936ff874" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/c687e3387b99f5b03b6caa64c74b63e2936ff874", + "reference": "c687e3387b99f5b03b6caa64c74b63e2936ff874", + "shasum": "" + }, + "require": { + "php": ">=8.2" + }, + "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", + "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", + "security": "https://github.com/sebastianbergmann/version/security/policy", + "source": "https://github.com/sebastianbergmann/version/tree/5.0.2" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2024-10-09T05:16:32+00:00" + }, + { + "name": "symfony/console", + "version": "v7.1.5", + "source": { + "type": "git", + "url": "https://github.com/symfony/console.git", + "reference": "0fa539d12b3ccf068a722bbbffa07ca7079af9ee" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/console/zipball/0fa539d12b3ccf068a722bbbffa07ca7079af9ee", + "reference": "0fa539d12b3ccf068a722bbbffa07ca7079af9ee", + "shasum": "" + }, + "require": { + "php": ">=8.2", + "symfony/polyfill-mbstring": "~1.0", + "symfony/service-contracts": "^2.5|^3", + "symfony/string": "^6.4|^7.0" + }, + "conflict": { + "symfony/dependency-injection": "<6.4", + "symfony/dotenv": "<6.4", + "symfony/event-dispatcher": "<6.4", + "symfony/lock": "<6.4", + "symfony/process": "<6.4" + }, + "provide": { + "psr/log-implementation": "1.0|2.0|3.0" }, "require-dev": { "psr/log": "^1|^2|^3", @@ -3161,7 +3958,296 @@ "terminal" ], "support": { - "source": "https://github.com/symfony/console/tree/v7.1.5" + "source": "https://github.com/symfony/console/tree/v7.1.5" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-09-20T08:28:38+00:00" + }, + { + "name": "symfony/deprecation-contracts", + "version": "v3.5.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/deprecation-contracts.git", + "reference": "0e0d29ce1f20deffb4ab1b016a7257c4f1e789a1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/0e0d29ce1f20deffb4ab1b016a7257c4f1e789a1", + "reference": "0e0d29ce1f20deffb4ab1b016a7257c4f1e789a1", + "shasum": "" + }, + "require": { + "php": ">=8.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "3.5-dev" + }, + "thanks": { + "name": "symfony/contracts", + "url": "https://github.com/symfony/contracts" + } + }, + "autoload": { + "files": [ + "function.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "A generic function and convention to trigger deprecation notices", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/deprecation-contracts/tree/v3.5.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-04-18T09:32:20+00:00" + }, + { + "name": "symfony/event-dispatcher", + "version": "v7.1.1", + "source": { + "type": "git", + "url": "https://github.com/symfony/event-dispatcher.git", + "reference": "9fa7f7a21beb22a39a8f3f28618b29e50d7a55a7" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/9fa7f7a21beb22a39a8f3f28618b29e50d7a55a7", + "reference": "9fa7f7a21beb22a39a8f3f28618b29e50d7a55a7", + "shasum": "" + }, + "require": { + "php": ">=8.2", + "symfony/event-dispatcher-contracts": "^2.5|^3" + }, + "conflict": { + "symfony/dependency-injection": "<6.4", + "symfony/service-contracts": "<2.5" + }, + "provide": { + "psr/event-dispatcher-implementation": "1.0", + "symfony/event-dispatcher-implementation": "2.0|3.0" + }, + "require-dev": { + "psr/log": "^1|^2|^3", + "symfony/config": "^6.4|^7.0", + "symfony/dependency-injection": "^6.4|^7.0", + "symfony/error-handler": "^6.4|^7.0", + "symfony/expression-language": "^6.4|^7.0", + "symfony/http-foundation": "^6.4|^7.0", + "symfony/service-contracts": "^2.5|^3", + "symfony/stopwatch": "^6.4|^7.0" + }, + "type": "library", + "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/v7.1.1" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-05-31T14:57:53+00:00" + }, + { + "name": "symfony/event-dispatcher-contracts", + "version": "v3.5.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/event-dispatcher-contracts.git", + "reference": "8f93aec25d41b72493c6ddff14e916177c9efc50" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/event-dispatcher-contracts/zipball/8f93aec25d41b72493c6ddff14e916177c9efc50", + "reference": "8f93aec25d41b72493c6ddff14e916177c9efc50", + "shasum": "" + }, + "require": { + "php": ">=8.1", + "psr/event-dispatcher": "^1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "3.5-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.5.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-04-18T09:32:20+00:00" + }, + { + "name": "symfony/filesystem", + "version": "v7.1.5", + "source": { + "type": "git", + "url": "https://github.com/symfony/filesystem.git", + "reference": "61fe0566189bf32e8cfee78335d8776f64a66f5a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/61fe0566189bf32e8cfee78335d8776f64a66f5a", + "reference": "61fe0566189bf32e8cfee78335d8776f64a66f5a", + "shasum": "" + }, + "require": { + "php": ">=8.2", + "symfony/polyfill-ctype": "~1.8", + "symfony/polyfill-mbstring": "~1.8" + }, + "require-dev": { + "symfony/process": "^6.4|^7.0" + }, + "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/v7.1.5" }, "funding": [ { @@ -3177,38 +4263,35 @@ "type": "tidelift" } ], - "time": "2024-09-20T08:28:38+00:00" + "time": "2024-09-17T09:16:35+00:00" }, { - "name": "symfony/deprecation-contracts", - "version": "v3.5.0", + "name": "symfony/finder", + "version": "v7.1.4", "source": { "type": "git", - "url": "https://github.com/symfony/deprecation-contracts.git", - "reference": "0e0d29ce1f20deffb4ab1b016a7257c4f1e789a1" + "url": "https://github.com/symfony/finder.git", + "reference": "d95bbf319f7d052082fb7af147e0f835a695e823" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/0e0d29ce1f20deffb4ab1b016a7257c4f1e789a1", - "reference": "0e0d29ce1f20deffb4ab1b016a7257c4f1e789a1", + "url": "https://api.github.com/repos/symfony/finder/zipball/d95bbf319f7d052082fb7af147e0f835a695e823", + "reference": "d95bbf319f7d052082fb7af147e0f835a695e823", "shasum": "" }, "require": { - "php": ">=8.1" + "php": ">=8.2" }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "3.5-dev" - }, - "thanks": { - "name": "symfony/contracts", - "url": "https://github.com/symfony/contracts" - } + "require-dev": { + "symfony/filesystem": "^6.4|^7.0" }, + "type": "library", "autoload": { - "files": [ - "function.php" + "psr-4": { + "Symfony\\Component\\Finder\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" ] }, "notification-url": "https://packagist.org/downloads/", @@ -3217,18 +4300,18 @@ ], "authors": [ { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" + "name": "Fabien Potencier", + "email": "fabien@symfony.com" }, { "name": "Symfony Community", "homepage": "https://symfony.com/contributors" } ], - "description": "A generic function and convention to trigger deprecation notices", + "description": "Finds files and directories via an intuitive fluent interface", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/deprecation-contracts/tree/v3.5.0" + "source": "https://github.com/symfony/finder/tree/v7.1.4" }, "funding": [ { @@ -3244,32 +4327,30 @@ "type": "tidelift" } ], - "time": "2024-04-18T09:32:20+00:00" + "time": "2024-08-13T14:28:19+00:00" }, { - "name": "symfony/finder", - "version": "v7.1.4", + "name": "symfony/options-resolver", + "version": "v7.1.1", "source": { "type": "git", - "url": "https://github.com/symfony/finder.git", - "reference": "d95bbf319f7d052082fb7af147e0f835a695e823" + "url": "https://github.com/symfony/options-resolver.git", + "reference": "47aa818121ed3950acd2b58d1d37d08a94f9bf55" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/d95bbf319f7d052082fb7af147e0f835a695e823", - "reference": "d95bbf319f7d052082fb7af147e0f835a695e823", + "url": "https://api.github.com/repos/symfony/options-resolver/zipball/47aa818121ed3950acd2b58d1d37d08a94f9bf55", + "reference": "47aa818121ed3950acd2b58d1d37d08a94f9bf55", "shasum": "" }, "require": { - "php": ">=8.2" - }, - "require-dev": { - "symfony/filesystem": "^6.4|^7.0" + "php": ">=8.2", + "symfony/deprecation-contracts": "^2.5|^3" }, "type": "library", "autoload": { "psr-4": { - "Symfony\\Component\\Finder\\": "" + "Symfony\\Component\\OptionsResolver\\": "" }, "exclude-from-classmap": [ "/Tests/" @@ -3289,10 +4370,15 @@ "homepage": "https://symfony.com/contributors" } ], - "description": "Finds files and directories via an intuitive fluent interface", + "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/finder/tree/v7.1.4" + "source": "https://github.com/symfony/options-resolver/tree/v7.1.1" }, "funding": [ { @@ -3308,7 +4394,7 @@ "type": "tidelift" } ], - "time": "2024-08-13T14:28:19+00:00" + "time": "2024-05-31T14:57:53+00:00" }, { "name": "symfony/polyfill-ctype", @@ -3628,6 +4714,162 @@ ], "time": "2024-09-09T11:45:10+00:00" }, + { + "name": "symfony/polyfill-php80", + "version": "v1.31.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-php80.git", + "reference": "60328e362d4c2c802a54fcbf04f9d3fb892b4cf8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/60328e362d4c2c802a54fcbf04f9d3fb892b4cf8", + "reference": "60328e362d4c2c802a54fcbf04f9d3fb892b4cf8", + "shasum": "" + }, + "require": { + "php": ">=7.2" + }, + "type": "library", + "extra": { + "thanks": { + "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.31.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-09-09T11:45:10+00:00" + }, + { + "name": "symfony/polyfill-php81", + "version": "v1.31.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-php81.git", + "reference": "4a4cfc2d253c21a5ad0e53071df248ed48c6ce5c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-php81/zipball/4a4cfc2d253c21a5ad0e53071df248ed48c6ce5c", + "reference": "4a4cfc2d253c21a5ad0e53071df248ed48c6ce5c", + "shasum": "" + }, + "require": { + "php": ">=7.2" + }, + "type": "library", + "extra": { + "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.31.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-09-09T11:45:10+00:00" + }, { "name": "symfony/process", "version": "v7.1.5", @@ -3772,6 +5014,68 @@ ], "time": "2024-04-18T09:32:20+00:00" }, + { + "name": "symfony/stopwatch", + "version": "v7.1.1", + "source": { + "type": "git", + "url": "https://github.com/symfony/stopwatch.git", + "reference": "5b75bb1ac2ba1b9d05c47fc4b3046a625377d23d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/stopwatch/zipball/5b75bb1ac2ba1b9d05c47fc4b3046a625377d23d", + "reference": "5b75bb1ac2ba1b9d05c47fc4b3046a625377d23d", + "shasum": "" + }, + "require": { + "php": ">=8.2", + "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/v7.1.1" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-05-31T14:57:53+00:00" + }, { "name": "symfony/string", "version": "v7.1.5", @@ -4029,13 +5333,13 @@ ], "aliases": [], "minimum-stability": "stable", - "stability-flags": {}, + "stability-flags": [], "prefer-stable": false, "prefer-lowest": false, "platform": { "php": "^8.0|^7.3", "ext-json": "*" }, - "platform-dev": {}, + "platform-dev": [], "plugin-api-version": "2.6.0" } diff --git a/contrib/bugsnag.php b/contrib/bugsnag.php index d3d9f4fa0..f87a697b7 100644 --- a/contrib/bugsnag.php +++ b/contrib/bugsnag.php @@ -15,6 +15,7 @@ after('deploy', 'bugsnag:notify'); ``` */ + namespace Deployer; use Deployer\Utility\Httpie; diff --git a/contrib/cachetool.php b/contrib/cachetool.php index f9c8d7ab7..b3335e0d8 100644 --- a/contrib/cachetool.php +++ b/contrib/cachetool.php @@ -45,6 +45,7 @@ Read more information about cachetool on the website: http://gordalina.github.io/cachetool/ */ + namespace Deployer; set('cachetool', ''); @@ -64,8 +65,8 @@ return '{{release_or_current_path}}/cachetool.phar'; }); set('cachetool_options', function () { - $options = (array)get('cachetool'); - $fullOptions = (string)get('cachetool_args'); + $options = (array) get('cachetool'); + $fullOptions = (string) get('cachetool_args'); $return = []; if ($fullOptions !== '') { diff --git a/contrib/chatwork.php b/contrib/chatwork.php index bd4f5ce6d..342f3930c 100644 --- a/contrib/chatwork.php +++ b/contrib/chatwork.php @@ -16,14 +16,14 @@ ``` Add hook on deploy: - + ```php before('deploy', 'chatwork:notify'); ``` ## Configuration -- `chatwork_token` – chatwork bot token, **required** +- `chatwork_token` – chatwork bot token, **required** - `chatwork_room_id` — chatwork room to push messages to **required** - `chatwork_notify_text` – notification message template ``` @@ -84,7 +84,9 @@ after('deploy:failed', 'chatwork:notify:failure'); ``` */ + namespace Deployer; + use Deployer\Utility\Httpie; // Chatwork settings @@ -95,7 +97,7 @@ throw new \RuntimeException('Please configure "chatwork_room_id" parameter.'); }); set('chatwork_api', function () { - return 'https://api.chatwork.com/v2/rooms/' . get('chatwork_room_id') . '/messages'; + return 'https://api.chatwork.com/v2/rooms/' . get('chatwork_room_id') . '/messages'; }); // The Messages @@ -104,7 +106,7 @@ set('chatwork_failure_text', "[info]\n[title](*) Deployment Status: Failed[/title]\nRepo: {{repository}}\nBranch: {{branch}}\nServer: {{hostname}}\nRelease Path: {{release_path}}\nCurrent Path: {{current_path}}\n[/info]"); // Helpers -task('chatwork_send_message', function() { +task('chatwork_send_message', function () { Httpie::post(get('chatwork_api')) ->query(['body' => get('chatwork_message'),]) ->header("X-ChatWorkToken", get('chatwork_token')) @@ -128,7 +130,7 @@ if (!get('chatwork_token', false)) { return; } - + if (!get('chatwork_room_id', false)) { return; } @@ -143,7 +145,7 @@ if (!get('chatwork_token', false)) { return; } - + if (!get('chatwork_room_id', false)) { return; } @@ -159,7 +161,7 @@ if (!get('chatwork_token', false)) { return; } - + if (!get('chatwork_room_id', false)) { return; } diff --git a/contrib/cimonitor.php b/contrib/cimonitor.php index 42a083e52..6d3723748 100644 --- a/contrib/cimonitor.php +++ b/contrib/cimonitor.php @@ -55,6 +55,7 @@ after('deploy:failed', 'cimonitor:notify:failure'); ``` */ + namespace Deployer; use Deployer\Utility\Httpie; @@ -67,8 +68,8 @@ }); set('cimonitor_user', function () { return [ - 'name' => runLocally('git config --get user.name'), - 'email' => runLocally('git config --get user.email'), + 'name' => runLocally('git config --get user.name'), + 'email' => runLocally('git config --get user.email'), ]; }); @@ -101,7 +102,7 @@ 'name' => 'Deploying...', 'stage' => '', 'state' => get('cimonitor_job_state_running'), - ] + ], ], ]; @@ -116,7 +117,7 @@ return; } - $depstage = 'Deployed to '.get('stage', ''); + $depstage = 'Deployed to ' . get('stage', ''); $body = [ 'state' => get('cimonitor_status_success'), @@ -129,7 +130,7 @@ 'name' => 'Deploy', 'stage' => $depstage, 'state' => get('cimonitor_job_state_success'), - ] + ], ], ]; @@ -155,7 +156,7 @@ 'name' => 'Deploy', 'stage' => '', 'state' => get('cimonitor_job_state_error'), - ] + ], ], ]; @@ -163,4 +164,3 @@ }) ->once() ->hidden(); - diff --git a/contrib/cloudflare.php b/contrib/cloudflare.php index 4986654c9..1f81d554c 100644 --- a/contrib/cloudflare.php +++ b/contrib/cloudflare.php @@ -17,6 +17,7 @@ if not the, last tasks before cleanup */ + namespace Deployer; desc('Clears Cloudflare Cache'); @@ -27,16 +28,16 @@ // validate config and set headers if (!empty($config['service_key'])) { $headers = [ - 'X-Auth-User-Service-Key' => $config['service_key'] + 'X-Auth-User-Service-Key' => $config['service_key'], ]; } elseif (!empty($config['email']) && !empty($config['api_key'])) { $headers = [ 'X-Auth-Key' => $config['api_key'], - 'X-Auth-Email' => $config['email'] + 'X-Auth-Email' => $config['email'], ]; - } else if (!empty($config['api_token'])) { + } elseif (!empty($config['api_token'])) { $headers = [ - 'Authorization' => 'Bearer '.$config['api_token'] + 'Authorization' => 'Bearer ' . $config['api_token'], ]; } else { throw new \RuntimeException("Set a service key or email / api key"); @@ -48,13 +49,13 @@ $ch = curl_init("https://api.cloudflare.com/client/v4/$url"); $parsedHeaders = []; - foreach($headers as $key => $value){ + foreach ($headers as $key => $value) { $parsedHeaders[] = "$key: $value"; } curl_setopt_array($ch, [ CURLOPT_HTTPHEADER => $parsedHeaders, - CURLOPT_RETURNTRANSFER => true + CURLOPT_RETURNTRANSFER => true, ]); curl_setopt_array($ch, $opts); @@ -78,7 +79,7 @@ // get the mysterious zone id from Cloud Flare $zones = json_decode($makeRequest( - "zones?name={$config['domain']}" + "zones?name={$config['domain']}", ), true); if (!empty($zones['errors'])) { @@ -95,9 +96,9 @@ CURLOPT_CUSTOMREQUEST => 'DELETE', CURLOPT_POSTFIELDS => json_encode( [ - 'purge_everything' => true - ] + 'purge_everything' => true, + ], ), - ] + ], ); }); diff --git a/contrib/cpanel.php b/contrib/cpanel.php index 9c1ba9a8f..0d5fb6e26 100644 --- a/contrib/cpanel.php +++ b/contrib/cpanel.php @@ -133,10 +133,11 @@ after('deploy:prepare', 'cpanel:createdb'); ``` */ + namespace Deployer; use Deployer\Task\Context; -use \Gufy\CpanelPhp\Cpanel; +use Gufy\CpanelPhp\Cpanel; /** * @return Cpanel @@ -162,7 +163,7 @@ function getCpanel() !isset($config['port']) || !isset($config['username']) || !isset($config['token']) || - !isset($config['user']) ) { + !isset($config['user'])) { throw new \RuntimeException("Please configure CPanel config: set('cpanel', array('host' => 'xxx.xxx.xxx.xxx:', 'port' => 2087 , 'username' => 'root', 'token' => 'asdfasdf', 'cpaneluser' => 'guy'));"); } @@ -187,7 +188,7 @@ function getDomainInfo() return [ 'domain' => $domain, 'subDomain' => $subDomain, - 'subDomainWithSuffix' => $subDomain . get('cpanel')['subdomain_suffix'] + 'subDomainWithSuffix' => $subDomain . get('cpanel')['subdomain_suffix'], ]; } @@ -201,7 +202,7 @@ function getDomainInfo() } $createDbDataResult = $cpanel->cpanel('MysqlFE', 'createdb', $config['user'], ['db' => get('cpanel_createdb')]); - $addPrivilegesDataResult = $cpanel->cpanel('MysqlFE', 'setdbuserprivileges', $config['user'], ['privileges' => $config['db_user_privileges'], 'db'=> get('cpanel_createdb'), 'dbuser' => $config['db_user']]); + $addPrivilegesDataResult = $cpanel->cpanel('MysqlFE', 'setdbuserprivileges', $config['user'], ['privileges' => $config['db_user_privileges'], 'db' => get('cpanel_createdb'), 'dbuser' => $config['db_user']]); $createDbData = json_decode($createDbDataResult, true); $addPrivilegesData = json_decode($addPrivilegesDataResult, true); @@ -231,7 +232,7 @@ function getDomainInfo() writeln(sprintf('Creates addon domain %s and pointing it to %s', $domain, get('addondir'))); - $addAddonDomainResult = $cpanel->cpanel('AddonDomain', 'addaddondomain', $config['user'], ['dir' => get('addondir'), 'newdomain'=> $domain, 'subdomain' => $subDomain]); + $addAddonDomainResult = $cpanel->cpanel('AddonDomain', 'addaddondomain', $config['user'], ['dir' => get('addondir'), 'newdomain' => $domain, 'subdomain' => $subDomain]); $addAddonDomainData = json_decode($addAddonDomainResult, true); if (isset($addAddonDomainResult['cpanelresult']['error'])) { @@ -256,7 +257,7 @@ function getDomainInfo() writeln(sprintf('Deleting addon domain %s', $domain)); - $delAddonDomainResult = $cpanel->cpanel('AddonDomain', 'deladdondomain', $config['user'], ['domain'=> $domain, 'subdomain' => $subDomainWithSuffix]); + $delAddonDomainResult = $cpanel->cpanel('AddonDomain', 'deladdondomain', $config['user'], ['domain' => $domain, 'subdomain' => $subDomainWithSuffix]); $delAddonDomainResult = json_decode($delAddonDomainResult, true); if (isset($delAddonDomainResult['cpanelresult']['error'])) { diff --git a/contrib/crontab.php b/contrib/crontab.php index 2717135df..92cece25a 100644 --- a/contrib/crontab.php +++ b/contrib/crontab.php @@ -41,7 +41,7 @@ task('crontab:sync', function () { $cronJobsLocal = array_map( fn($job) => parse($job), - get('crontab:jobs', []) + get('crontab:jobs', []), ); if (count($cronJobsLocal) == 0) { @@ -109,4 +109,3 @@ function getRemoteCrontab(): array return explode(PHP_EOL, run("$sudo {{bin/crontab}} -l")); } - diff --git a/contrib/directadmin.php b/contrib/directadmin.php index 6057f3cd3..ffc9cfcd0 100644 --- a/contrib/directadmin.php +++ b/contrib/directadmin.php @@ -17,7 +17,9 @@ - `domain_php_version` – Domain PHP Version, default: 1 (required when using directadmin:php-version) */ + namespace Deployer; + use Deployer\Task\Context; use Deployer\Utility\Httpie; @@ -33,7 +35,7 @@ function getDirectAdminConfig() if (!is_array($config) || !isset($config['host']) || !isset($config['username']) || - !isset($config['password']) ) { + !isset($config['password'])) { throw new \RuntimeException("Please set the following DirectAdmin config:" . PHP_EOL . "set('directadmin', ['host' => '127.0.0.1', 'port' => 2222, 'username' => 'admin', 'password' => 'password']);"); } @@ -77,7 +79,7 @@ function DirectAdmin(string $action, array $data = []) if (!is_array($config) || !isset($config['db_name']) || !isset($config['db_user']) || - !isset($config['db_password']) ) { + !isset($config['db_password'])) { throw new \RuntimeException("Please add the following DirectAdmin config:" . PHP_EOL . "add('directadmin', ['db_name' => 'test', 'db_user' => 'test', 'db_password' => '123456']);"); } diff --git a/contrib/discord.php b/contrib/discord.php index ec1b771bc..d2f646dfa 100644 --- a/contrib/discord.php +++ b/contrib/discord.php @@ -45,6 +45,7 @@ after('deploy:failed', 'discord:notify:failure'); ``` */ + namespace Deployer; use Deployer\Task\Context; @@ -55,17 +56,17 @@ }); // Deploy messages -set('discord_notify_text', function() { +set('discord_notify_text', function () { return [ 'text' => parse(':information_source: **{{user}}** is deploying branch `{{branch}}` to _{{target}}_'), ]; }); -set('discord_success_text', function() { +set('discord_success_text', function () { return [ 'text' => parse(':white_check_mark: Branch `{{branch}}` deployed to _{{target}}_ successfully'), ]; }); -set('discord_failure_text', function() { +set('discord_failure_text', function () { return [ 'text' => parse(':no_entry_sign: Branch `{{branch}}` has failed to deploy to _{{target}}_'), ]; @@ -75,7 +76,7 @@ set('discord_message', 'discord_notify_text'); // Helpers -task('discord_send_message', function(){ +task('discord_send_message', function () { $message = get(get('discord_message')); Httpie::post(get('discord_webhook'))->jsonBody($message)->send(); diff --git a/contrib/grafana.php b/contrib/grafana.php index e34454e7d..eba5c6aa3 100644 --- a/contrib/grafana.php +++ b/contrib/grafana.php @@ -29,11 +29,11 @@ ``` */ + namespace Deployer; use Deployer\Utility\Httpie; - desc('Creates Grafana annotation of deployment'); task('grafana:annotation', function () { $defaultConfig = [ diff --git a/contrib/hangouts.php b/contrib/hangouts.php index 5d9eee9af..1eca01f21 100644 --- a/contrib/hangouts.php +++ b/contrib/hangouts.php @@ -37,6 +37,7 @@ ``` */ + namespace Deployer; use Deployer\Utility\Httpie; @@ -66,7 +67,7 @@ 'title' => get('chat_title'), 'subtitle' => get('chat_subtitle'), 'imageUrl' => get('favicon'), - 'imageStyle' => 'IMAGE' + 'imageStyle' => 'IMAGE', ], 'sections' => [ 'widgets' => [ @@ -82,14 +83,14 @@ 'text' => 'Visit site', 'onClick' => [ 'openLink' => [ - 'url' => get('hostname') - ] - ] - ] - ] - ] - ] - ] + 'url' => get('hostname'), + ], + ], + ], + ], + ], + ], + ], ]; Httpie::post(get('chat_webhook'))->jsonBody(['cards' => $card])->send(); @@ -108,7 +109,7 @@ 'title' => get('chat_title'), 'subtitle' => get('chat_subtitle'), 'imageUrl' => get('favicon'), - 'imageStyle' => 'IMAGE' + 'imageStyle' => 'IMAGE', ], 'sections' => [ 'widgets' => [ @@ -124,14 +125,14 @@ 'text' => 'Visit site', 'onClick' => [ 'openLink' => [ - 'url' => get('hostname') - ] - ] - ] - ] - ] - ] - ] + 'url' => get('hostname'), + ], + ], + ], + ], + ], + ], + ], ]; Httpie::post(get('chat_webhook'))->jsonBody(['cards' => $card])->send(); @@ -150,7 +151,7 @@ 'title' => get('chat_title'), 'subtitle' => get('chat_subtitle'), 'imageUrl' => get('favicon'), - 'imageStyle' => 'IMAGE' + 'imageStyle' => 'IMAGE', ], 'sections' => [ 'widgets' => [ @@ -167,14 +168,14 @@ 'text' => 'Visit site', 'onClick' => [ 'openLink' => [ - 'url' => get('hostname') - ] - ] - ] - ] - ] - ] - ] + 'url' => get('hostname'), + ], + ], + ], + ], + ], + ], + ], ]; Httpie::post(get('chat_webhook'))->jsonBody(['cards' => $card])->send(); diff --git a/contrib/hipchat.php b/contrib/hipchat.php index cb3e1cfb1..9f57a94e1 100644 --- a/contrib/hipchat.php +++ b/contrib/hipchat.php @@ -18,6 +18,7 @@ ``` */ + namespace Deployer; use Deployer\Utility\Httpie; diff --git a/contrib/ispmanager.php b/contrib/ispmanager.php index 620bc9f6c..238712269 100644 --- a/contrib/ispmanager.php +++ b/contrib/ispmanager.php @@ -2,6 +2,7 @@ /* * This recipe for work with ISPManager Lite panel by API. */ + namespace Deployer; use Deployer\Exception\Exception; @@ -16,14 +17,14 @@ 'dsn' => 'https://root:password@localhost:1500/ispmgr', 'secure' => true, ], - 'createDomain' => NULL, - 'updateDomain' => NULL, - 'deleteDomain' => NULL, - 'createDatabase' => NULL, - 'deleteDatabase' => NULL, - 'phpSelect' => NULL, - 'createAlias' => NULL, - 'deleteAlias' => NULL, + 'createDomain' => null, + 'updateDomain' => null, + 'deleteDomain' => null, + 'createDatabase' => null, + 'deleteDatabase' => null, + 'phpSelect' => null, + 'createAlias' => null, + 'deleteAlias' => null, ]); // Vhost default configuration @@ -90,7 +91,7 @@ $hostList = []; $serverList = []; - if (isset ($response['doc']['elem']) && count($response['doc']['elem']) > 0) { + if (isset($response['doc']['elem']) && count($response['doc']['elem']) > 0) { foreach ($response['doc']['elem'] as $dbServer) { $serverList[$dbServer['name']['$']] = [ 'host' => $dbServer['host']['$'], @@ -125,7 +126,7 @@ ]); $dbList = []; - if (isset ($response['doc']['elem']) && count($response['doc']['elem']) > 0) { + if (isset($response['doc']['elem']) && count($response['doc']['elem']) > 0) { foreach ($response['doc']['elem'] as $db) { $dbList[$db['pair']['$']] = [ 'name' => $db['name']['$'], @@ -136,7 +137,7 @@ } add('ispmanager_databases', [ - 'dblist' => $dbList + 'dblist' => $dbList, ]); }); @@ -147,7 +148,7 @@ ]); $domainList = []; - if (isset ($response['doc']['elem']) && count($response['doc']['elem']) > 0) { + if (isset($response['doc']['elem']) && count($response['doc']['elem']) > 0) { foreach ($response['doc']['elem'] as $domain) { $domainList[] = $domain['name']['$']; } @@ -169,7 +170,7 @@ $dbInfo = get('ispmanager_databases'); - $hostInfo = NULL; + $hostInfo = null; foreach ($dbInfo['hosts'] as $hostData) { if ($hostData['host'] == $dsnData['host'] . ':' . $dsnData['port']) { $hostInfo = $hostData; @@ -185,8 +186,8 @@ $dbLocation = $dbName . '->' . $hostInfo['name']; - if (isset ($dbInfo['dblist'][$dbLocation])) { - if (!isset ($config['createDatabase']['skipIfExist']) || !$config['createDatabase']['skipIfExist']) { + if (isset($dbInfo['dblist'][$dbLocation])) { + if (!isset($config['createDatabase']['skipIfExist']) || !$config['createDatabase']['skipIfExist']) { throw new Exception('Database already exists!'); } else { warning('Database already exists - skipping'); @@ -219,7 +220,7 @@ $response = ispmanagerRequest('post', $dbCreateRequest); - if (isset ($response['doc']['error']['msg']['$'])) { + if (isset($response['doc']['error']['msg']['$'])) { throw new Exception($response['doc']['error']['msg']['$']); } else { info('Database successfully created'); @@ -238,7 +239,7 @@ $dbInfo = get('ispmanager_databases'); $dsnData = parse_url($config['deleteDatabase']['dsn']); - $hostInfo = NULL; + $hostInfo = null; foreach ($dbInfo['hosts'] as $hostData) { if ($hostData['host'] == $dsnData['host'] . ':' . $dsnData['port']) { $hostInfo = $hostData; @@ -254,8 +255,8 @@ $dbLocation = $dbName . '->' . $hostInfo['name']; - if (!isset ($dbInfo['dblist'][$dbLocation])) { - if (!isset ($config['deleteDatabase']['skipIfNotExist']) || !$config['deleteDatabase']['skipIfNotExist']) { + if (!isset($dbInfo['dblist'][$dbLocation])) { + if (!isset($config['deleteDatabase']['skipIfNotExist']) || !$config['deleteDatabase']['skipIfNotExist']) { throw new Exception('Database not exist!'); } else { warning('Database not exist - skipping'); @@ -270,7 +271,7 @@ $response = ispmanagerRequest('post', $dbDeleteRequest); - if (isset ($response['doc']['error']['msg']['$'])) { + if (isset($response['doc']['error']['msg']['$'])) { throw new Exception($response['doc']['error']['msg']['$']); } else { info('Database successfully deleted'); @@ -286,7 +287,7 @@ return; } - if (!isset ($config['createDomain']['name']) || $config['createDomain']['name'] == '') { + if (!isset($config['createDomain']['name']) || $config['createDomain']['name'] == '') { throw new Exception('Invalid domain name!'); } @@ -294,7 +295,7 @@ $existDomains = get('ispmanager_domains'); if (in_array($config['createDomain']['name'], $existDomains)) { - if (!isset ($config['createDomain']['skipIfExist']) || !$config['createDomain']['skipIfExist']) { + if (!isset($config['createDomain']['skipIfExist']) || !$config['createDomain']['skipIfExist']) { throw new Exception('Domain already exists!'); } else { warning('Domain already exists - skipping'); @@ -316,7 +317,7 @@ $response = ispmanagerRequest('post', $domainCreateRequest); - if (isset ($response['doc']['error']['msg']['$'])) { + if (isset($response['doc']['error']['msg']['$'])) { throw new Exception($response['doc']['error']['msg']['$']); } else { info('Domain successfully created'); @@ -332,10 +333,10 @@ 'elname' => get('ispmanager_owner'), ]); - $userFPMVersion = isset ($response['doc']['limit_php_fpm_version']['$']) ? $response['doc']['limit_php_fpm_version']['$'] : NULL; + $userFPMVersion = $response['doc']['limit_php_fpm_version']['$'] ?? null; $response = ispmanagerRequest('get', [ - 'func' => 'phpversions' + 'func' => 'phpversions', ]); $versions = []; @@ -348,19 +349,19 @@ 'php_mode_fcgi_nginxfpm' => false, ]; - if (isset ($phpVersion['default_apache']) && $phpVersion['default_apache']['$'] == 'on') { + if (isset($phpVersion['default_apache']) && $phpVersion['default_apache']['$'] == 'on') { $versions[$phpVersion['key']['$']]['php_mode_mod'] = true; } - if (isset ($phpVersion['cgi']) && $phpVersion['cgi']['$'] == 'on') { + if (isset($phpVersion['cgi']) && $phpVersion['cgi']['$'] == 'on') { $versions[$phpVersion['key']['$']]['php_mode_cgi'] = true; } - if (isset ($phpVersion['apache']) && $phpVersion['apache']['$'] == 'on') { + if (isset($phpVersion['apache']) && $phpVersion['apache']['$'] == 'on') { $versions[$phpVersion['key']['$']]['php_mode_fcgi_apache'] = true; } - if (isset ($phpVersion['fpm']) && $phpVersion['fpm']['$'] == 'on' && $phpVersion['key']['$'] == $userFPMVersion) { + if (isset($phpVersion['fpm']) && $phpVersion['fpm']['$'] == 'on' && $phpVersion['key']['$'] == $userFPMVersion) { $versions[$phpVersion['key']['$']]['php_mode_fcgi_nginxfpm'] = true; } @@ -416,7 +417,7 @@ return; } - if (!isset ($config['phpSelect']['name']) || $config['phpSelect']['name'] == '') { + if (!isset($config['phpSelect']['name']) || $config['phpSelect']['name'] == '') { throw new Exception('Invalid domain name!'); } @@ -426,7 +427,7 @@ throw new Exception('Domain not exist!'); } - if (!isset ($config['phpSelect']['mode']) || !isset ($config['phpSelect']['version'])) { + if (!isset($config['phpSelect']['mode']) || !isset($config['phpSelect']['version'])) { throw new Exception('Incorrect settings for select php version'); } @@ -435,13 +436,13 @@ $newVersion = $config['phpSelect']['version']; $newMode = $config['phpSelect']['mode']; - if (!isset ($phpVersions[$newVersion])) { + if (!isset($phpVersions[$newVersion])) { throw new Exception('Incorrect php version'); } $versionData = $phpVersions[$newVersion]; - if (!isset ($versionData[$newMode]) || !$versionData[$newMode]) { + if (!isset($versionData[$newMode]) || !$versionData[$newMode]) { throw new Exception('Incorrect php mode'); } @@ -469,7 +470,7 @@ $response = ispmanagerRequest('post', $domainUpdateRequest); - if (isset ($response['doc']['error']['msg']['$'])) { + if (isset($response['doc']['error']['msg']['$'])) { throw new Exception($response['doc']['error']['msg']['$']); } else { info('PHP successfully selected'); @@ -485,7 +486,7 @@ return; } - if (!isset ($config['createAlias']['name']) || $config['createAlias']['name'] == '') { + if (!isset($config['createAlias']['name']) || $config['createAlias']['name'] == '') { throw new Exception('Invalid domain name!'); } @@ -495,7 +496,7 @@ throw new Exception('Domain not exist!'); } - if (!isset ($config['createAlias']['alias']) || $config['createAlias']['alias'] == '') { + if (!isset($config['createAlias']['alias']) || $config['createAlias']['alias'] == '') { throw new Exception('Invalid alias name!'); } @@ -507,7 +508,7 @@ ]); $existAliases = []; - if (isset ($response['doc']['aliases']['$'])) { + if (isset($response['doc']['aliases']['$'])) { $existAliases = explode(' ', $response['doc']['aliases']['$']); } @@ -515,7 +516,7 @@ $createAliasList = explode(' ', $config['createAlias']['alias']); foreach ($createAliasList as $createAlias) { if (in_array($createAlias, $existAliases)) { - if (!isset ($config['createAlias']['skipIfExist']) || !$config['createAlias']['skipIfExist']) { + if (!isset($config['createAlias']['skipIfExist']) || !$config['createAlias']['skipIfExist']) { throw new Exception('Alias already exists!'); } else { warning('Alias ' . $createAlias . ' already exists - skipping'); @@ -538,7 +539,7 @@ $response = ispmanagerRequest('post', $domainUpdateRequest); - if (isset ($response['doc']['error']['msg']['$'])) { + if (isset($response['doc']['error']['msg']['$'])) { throw new Exception($response['doc']['error']['msg']['$']); } else { info('Alias successfully created'); @@ -554,7 +555,7 @@ return; } - if (!isset ($config['deleteAlias']['name']) || $config['deleteAlias']['name'] == '') { + if (!isset($config['deleteAlias']['name']) || $config['deleteAlias']['name'] == '') { throw new Exception('Invalid domain name!'); } @@ -564,7 +565,7 @@ throw new Exception('Domain not exist!'); } - if (!isset ($config['deleteAlias']['alias']) || $config['deleteAlias']['alias'] == '') { + if (!isset($config['deleteAlias']['alias']) || $config['deleteAlias']['alias'] == '') { throw new Exception('Invalid alias name!'); } @@ -576,14 +577,14 @@ ]); $existAliases = []; - if (isset ($response['doc']['aliases']['$'])) { + if (isset($response['doc']['aliases']['$'])) { $existAliases = explode(' ', $response['doc']['aliases']['$']); } $deleteAliasList = explode(' ', $config['deleteAlias']['alias']); foreach ($deleteAliasList as $deleteAlias) { if (!in_array($deleteAlias, $existAliases)) { - if (!isset ($config['deleteAlias']['skipIfNotExist']) || !$config['deleteAlias']['skipIfNotExist']) { + if (!isset($config['deleteAlias']['skipIfNotExist']) || !$config['deleteAlias']['skipIfNotExist']) { throw new Exception('Alias not exist!'); } else { warning('Alias ' . $deleteAlias . ' not exist - skipping'); @@ -591,8 +592,8 @@ } } - if (($index = array_search($deleteAlias, $existAliases)) !== FALSE) { - unset ($existAliases[$index]); + if (($index = array_search($deleteAlias, $existAliases)) !== false) { + unset($existAliases[$index]); } } @@ -606,7 +607,7 @@ $response = ispmanagerRequest('post', $domainUpdateRequest); - if (isset ($response['doc']['error']['msg']['$'])) { + if (isset($response['doc']['error']['msg']['$'])) { throw new Exception($response['doc']['error']['msg']['$']); } else { info('Alias successfully deleted'); @@ -622,7 +623,7 @@ return; } - if (!isset ($config['deleteDomain']['name']) || $config['deleteDomain']['name'] == '') { + if (!isset($config['deleteDomain']['name']) || $config['deleteDomain']['name'] == '') { throw new Exception('Invalid domain name!'); } @@ -630,7 +631,7 @@ $existDomains = get('ispmanager_domains'); if (!in_array($config['deleteDomain']['name'], $existDomains)) { - if (!isset ($config['deleteDomain']['skipIfNotExist']) || !$config['deleteDomain']['skipIfNotExist']) { + if (!isset($config['deleteDomain']['skipIfNotExist']) || !$config['deleteDomain']['skipIfNotExist']) { throw new Exception('Domain not exist!'); } else { warning('Domain not exist - skipping'); @@ -645,7 +646,7 @@ 'sok' => 'ok', ]; - if (!isset ($config['deleteDomain']['removeDir']) || !$config['deleteDomain']['removeDir']) { + if (!isset($config['deleteDomain']['removeDir']) || !$config['deleteDomain']['removeDir']) { $domainDeleteRequest['remove_directory'] = 'off'; } else { $domainDeleteRequest['remove_directory'] = 'on'; @@ -653,7 +654,7 @@ $response = ispmanagerRequest('post', $domainDeleteRequest); - if (isset ($response['doc']['error']['msg']['$'])) { + if (isset($response['doc']['error']['msg']['$'])) { throw new Exception($response['doc']['error']['msg']['$']); } else { info('Domain successfully deleted'); @@ -735,7 +736,7 @@ function ispmanagerAuthRequest($url, $login, $pass) ->formBody(prepareRequest($authRequestData)) ->getJson(); - if (isset ($responseData['doc']['auth']['$id'])) { + if (isset($responseData['doc']['auth']['$id'])) { set('ispmanager_session', $responseData['doc']['auth']['$id']); } else { throw new Exception('Error while create auth session'); @@ -747,7 +748,7 @@ function prepareRequest($requestData) $config = get('ispmanager'); $dsnData = parse_url($config['api']['dsn']); - if (!isset ($requestData['out'])) { + if (!isset($requestData['out'])) { $requestData['out'] = 'json'; } diff --git a/contrib/mattermost.php b/contrib/mattermost.php index d820bd309..d4a673f72 100644 --- a/contrib/mattermost.php +++ b/contrib/mattermost.php @@ -73,6 +73,7 @@ ``` */ + namespace Deployer; use Deployer\Utility\Httpie; @@ -90,7 +91,7 @@ set('mattermost_failure_text', 'Deploy to **{{target}}** failed {{mattermost_failure_emoji}}'); desc('Notifies mattermost'); -task('mattermost:notify', function() { +task('mattermost:notify', function () { if (null === get('mattermost_webhook')) { return; } @@ -111,7 +112,7 @@ }); desc('Notifies mattermost about deploy finish'); -task('mattermost:notify:success', function() { +task('mattermost:notify:success', function () { if (null === get('mattermost_webhook')) { return; } @@ -132,7 +133,7 @@ }); desc('Notifies mattermost about deploy failure'); -task('mattermost:notify:failure', function() { +task('mattermost:notify:failure', function () { if (null === get('mattermost_webhook')) { return; } diff --git a/contrib/ms-teams.php b/contrib/ms-teams.php index a9185bd46..1d8b998a4 100644 --- a/contrib/ms-teams.php +++ b/contrib/ms-teams.php @@ -70,6 +70,7 @@ after('deploy:failed', 'teams:notify:failure'); ``` */ + namespace Deployer; use Deployer\Utility\Httpie; @@ -98,7 +99,7 @@ Httpie::post(get('teams_webhook'))->jsonBody([ "themeColor" => get('teams_color'), - 'text' => get('teams_text') + 'text' => get('teams_text'), ])->send(); }) ->once() @@ -113,7 +114,7 @@ Httpie::post(get('teams_webhook'))->jsonBody([ "themeColor" => get('teams_success_color'), - 'text' => get('teams_success_text') + 'text' => get('teams_success_text'), ])->send(); }) ->once() @@ -128,7 +129,7 @@ Httpie::post(get('teams_webhook'))->jsonBody([ "themeColor" => get('teams_failure_color'), - 'text' => get('teams_failure_text') + 'text' => get('teams_failure_text'), ])->send(); }) ->once() diff --git a/contrib/newrelic.php b/contrib/newrelic.php index d08c0ebc4..b2c39b106 100644 --- a/contrib/newrelic.php +++ b/contrib/newrelic.php @@ -16,6 +16,7 @@ ``` */ + namespace Deployer; use Deployer\Utility\Httpie; diff --git a/contrib/npm.php b/contrib/npm.php index 65b01ce4e..8122887c0 100644 --- a/contrib/npm.php +++ b/contrib/npm.php @@ -11,6 +11,7 @@ ``` */ + namespace Deployer; set('bin/npm', function () { diff --git a/contrib/ntfy.php b/contrib/ntfy.php index 9c0d64055..3e816dad0 100644 --- a/contrib/ntfy.php +++ b/contrib/ntfy.php @@ -82,6 +82,7 @@ after('deploy:failed', 'ntfy:notify:failure'); ``` */ + namespace Deployer; use Deployer\Utility\Httpie; diff --git a/contrib/phinx.php b/contrib/phinx.php index d5add2d3a..2e37c4374 100644 --- a/contrib/phinx.php +++ b/contrib/phinx.php @@ -56,6 +56,7 @@ For further reading see [phinx.org](https://phinx.org). Complete descriptions of all possible options can be found on the [commands page](http://docs.phinx.org/en/latest/commands.html). */ + namespace Deployer; use Deployer\Exception\RunException; @@ -86,9 +87,9 @@ if ($phinxPath !== null) { return "phinx"; - } else if (test('[ -f {{release_path}}/vendor/bin/phinx ]')) { + } elseif (test('[ -f {{release_path}}/vendor/bin/phinx ]')) { return "{{release_path}}/vendor/bin/phinx"; - } else if (test('[ -f ~/.composer/vendor/bin/phinx ]')) { + } elseif (test('[ -f ~/.composer/vendor/bin/phinx ]')) { return '~/.composer/vendor/bin/phinx'; } else { throw new \RuntimeException('Cannot find phinx. Please specify path to phinx manually'); @@ -151,7 +152,7 @@ function phinx_get_allowed_config($allowedOptions) 'date', 'environment', 'target', - 'parser' + 'parser', ]; $conf = phinx_get_allowed_config($ALLOWED_OPTIONS); @@ -172,7 +173,7 @@ function phinx_get_allowed_config($allowedOptions) 'date', 'environment', 'target', - 'parser' + 'parser', ]; $conf = phinx_get_allowed_config($ALLOWED_OPTIONS); @@ -192,7 +193,7 @@ function phinx_get_allowed_config($allowedOptions) 'configuration', 'environment', 'parser', - 'seed' + 'seed', ]; $conf = phinx_get_allowed_config($ALLOWED_OPTIONS); @@ -212,7 +213,7 @@ function phinx_get_allowed_config($allowedOptions) 'configuration', 'environment', 'remove-all', - 'target' + 'target', ]; $conf = phinx_get_allowed_config($ALLOWED_OPTIONS); diff --git a/contrib/php-fpm.php b/contrib/php-fpm.php index 5ab6739c3..da6899d94 100644 --- a/contrib/php-fpm.php +++ b/contrib/php-fpm.php @@ -28,6 +28,7 @@ ``` */ + namespace Deployer; // Automatically detects by using {{bin/php}}. diff --git a/contrib/rabbit.php b/contrib/rabbit.php index 2cecc733b..9b4b0b8c6 100644 --- a/contrib/rabbit.php +++ b/contrib/rabbit.php @@ -47,13 +47,13 @@ before('deploy:end', 'deploy:rabbit'); ``` */ + namespace Deployer; use Deployer\Task\Context; use PhpAmqpLib\Connection\AMQPConnection; use PhpAmqpLib\Message\AMQPMessage; - desc('Notifies RabbitMQ channel about deployment'); task('deploy:rabbit', function () { @@ -75,17 +75,17 @@ $message, $host->getHostname(), $stageInfo, - $releasePath + $releasePath, ); } - $defaultConfig = array( + $defaultConfig = [ 'host' => 'localhost', 'port' => 5672, 'username' => 'guest', 'password' => 'guest', 'vhost' => '/', - ); + ]; $config = array_merge($defaultConfig, $config); @@ -95,8 +95,7 @@ !isset($config['port']) || !isset($config['username']) || !isset($config['password']) || - !isset($config['vhost']) ) - { + !isset($config['vhost'])) { throw new \RuntimeException("Please configure rabbit config: set('rabbit', array('channel' => 'channel', 'host' => 'host', 'port' => 'port', 'username' => 'username', 'password' => 'password'));"); } diff --git a/contrib/raygun.php b/contrib/raygun.php index 77e84ef15..f4088dd53 100644 --- a/contrib/raygun.php +++ b/contrib/raygun.php @@ -19,6 +19,7 @@ after('deploy', 'raygun:notify'); ``` */ + namespace Deployer; use Deployer\Utility\Httpie; @@ -32,7 +33,7 @@ 'emailAddress' => get('raygun_email'), 'comment' => get('raygun_comment'), 'scmIdentifier' => get('raygun_scm_identifier'), - 'scmType' => get('raygun_scm_type') + 'scmType' => get('raygun_scm_type'), ]; Httpie::post('https://app.raygun.io/deployments') diff --git a/contrib/rocketchat.php b/contrib/rocketchat.php index 299de65c2..df6d3412f 100644 --- a/contrib/rocketchat.php +++ b/contrib/rocketchat.php @@ -57,11 +57,12 @@ ``` */ + namespace Deployer; use Deployer\Utility\Httpie; -set('rockchat_title', function() { +set('rockchat_title', function () { return get('application', 'Project'); }); @@ -82,7 +83,7 @@ set('rocketchat_failure_text', 'Deploy to *{{target}}* failed'); desc('Notifies RocketChat'); -task('rocketchat:notify', function() { +task('rocketchat:notify', function () { if (null === get('rocketchat_webhook')) { return; } @@ -93,7 +94,7 @@ 'attachments' => [[ 'text' => get('rocketchat_text'), 'color' => get('rocketchat_color'), - ]] + ]], ]; if (get('rocketchat_channel')) { @@ -112,7 +113,7 @@ }); desc('Notifies RocketChat about deploy finish'); -task('rocketchat:notify:success', function() { +task('rocketchat:notify:success', function () { if (null === get('rocketchat_webhook')) { return; } @@ -123,7 +124,7 @@ 'attachments' => [[ 'text' => get('rocketchat_success_text'), 'color' => get('rocketchat_success_color'), - ]] + ]], ]; if (get('rocketchat_channel')) { @@ -142,7 +143,7 @@ }); desc('Notifies RocketChat about deploy failure'); -task('rocketchat:notify:failure', function() { +task('rocketchat:notify:failure', function () { if (null === get('rocketchat_webhook')) { return; } @@ -152,8 +153,8 @@ 'username' => get('rocketchat_username'), 'attachments' => [[ 'color' => get('rocketchat_failure_color'), - 'text' => get('rocketchat_failure_text') - ]] + 'text' => get('rocketchat_failure_text'), + ]], ]; if (get('rocketchat_channel')) { @@ -170,4 +171,3 @@ Httpie::post(get('rocketchat_webhook'))->jsonBody($body)->send(); }); - diff --git a/contrib/rollbar.php b/contrib/rollbar.php index 973cb6a5b..385091caf 100644 --- a/contrib/rollbar.php +++ b/contrib/rollbar.php @@ -19,6 +19,7 @@ ``` */ + namespace Deployer; use Deployer\Utility\Httpie; diff --git a/contrib/rsync.php b/contrib/rsync.php index d93cd2acc..cbdc03628 100644 --- a/contrib/rsync.php +++ b/contrib/rsync.php @@ -110,6 +110,7 @@ And Your `rsync_dest` is set to `{{release_path}}` then You could add this task to run before `rsync` task or after `deploy:release`, whatever is more convenient. */ + namespace Deployer; use Deployer\Component\Ssh\Client; @@ -141,7 +142,7 @@ $excludeFile = $config['exclude-file']; $excludesRsync = ''; foreach ($excludes as $exclude) { - $excludesRsync.=' --exclude=' . escapeshellarg($exclude); + $excludesRsync .= ' --exclude=' . escapeshellarg($exclude); } if (!empty($excludeFile) && file_exists($excludeFile) && is_file($excludeFile) && is_readable($excludeFile)) { $excludesRsync .= ' --exclude-from=' . escapeshellarg($excludeFile); @@ -156,7 +157,7 @@ $includeFile = $config['include-file']; $includesRsync = ''; foreach ($includes as $include) { - $includesRsync.=' --include=' . escapeshellarg($include); + $includesRsync .= ' --include=' . escapeshellarg($include); } if (!empty($includeFile) && file_exists($includeFile) && is_file($includeFile) && is_readable($includeFile)) { $includesRsync .= ' --include-from=' . escapeshellarg($includeFile); @@ -172,7 +173,7 @@ $filterPerDir = $config['filter-perdir']; $filtersRsync = ''; foreach ($filters as $filter) { - $filtersRsync.=" --filter='$filter'"; + $filtersRsync .= " --filter='$filter'"; } if (!empty($filterFile)) { $filtersRsync .= " --filter='merge $filterFile'"; @@ -195,7 +196,7 @@ desc('Warmups remote Rsync target'); -task('rsync:warmup', function() { +task('rsync:warmup', function () { $config = get('rsync'); $source = "{{current_path}}"; @@ -210,7 +211,7 @@ desc('Rsync local->remote'); -task('rsync', function() { +task('rsync', function () { $config = get('rsync'); $src = get('rsync_src'); diff --git a/contrib/sentry.php b/contrib/sentry.php index f84450950..93dae794c 100644 --- a/contrib/sentry.php +++ b/contrib/sentry.php @@ -54,6 +54,7 @@ ``` */ + namespace Deployer; use Closure; @@ -90,7 +91,7 @@ static function (&$value) use ($config) { if (is_callable($value)) { $value = $value($config); } - } + }, ); if ( @@ -99,19 +100,19 @@ static function (&$value) use ($config) { ) { throw new \RuntimeException( << 'exampleorg', - 'projects' => [ - 'exampleproj', - 'exampleproje2' - ], - 'token' => 'd47828...', - ] -);" -EXAMPLE + Required data missing. Please configure sentry: + set( + 'sentry', + [ + 'organization' => 'exampleorg', + 'projects' => [ + 'exampleproj', + 'exampleproje2' + ], + 'token' => 'd47828...', + ] + );" + EXAMPLE, ); } @@ -125,12 +126,12 @@ static function (&$value) use ($config) { 'dateReleased' => $config['date_released'], 'projects' => $config['projects'], 'previousCommit' => $config['previous_commit'], - ] + ], ); $releasesApiUrl = $config['sentry_server'] . '/api/0/organizations/' . $config['organization'] . '/releases/'; $response = Httpie::post( - $releasesApiUrl + $releasesApiUrl, ) ->setopt(CURLOPT_TIMEOUT, 10) ->header('Authorization', sprintf('Bearer %s', $config['token'])) @@ -146,8 +147,8 @@ static function (&$value) use ($config) { 'Sentry: Release of version %s ' . 'for projects: %s created successfully.', $response['version'], - implode(', ', array_column($response['projects'], 'slug')) - ) + implode(', ', array_column($response['projects'], 'slug')), + ), ); $deployData = array_filter( @@ -157,11 +158,11 @@ static function (&$value) use ($config) { 'url' => $config['url'], 'dateStarted' => $config['date_deploy_started'], 'dateFinished' => $config['date_deploy_finished'], - ] + ], ); $response = Httpie::post( - $releasesApiUrl . $response['version'] . '/deploys/' + $releasesApiUrl . $response['version'] . '/deploys/', ) ->setopt(CURLOPT_TIMEOUT, 10) ->header('Authorization', sprintf('Bearer %s', $config['token'])) @@ -177,10 +178,10 @@ static function (&$value) use ($config) { 'Sentry: Deployment %s ' . 'for environment %s created successfully', $response['id'], - $response['environment'] - ) + $response['environment'], + ), ); - } + }, ); function getPreviousReleaseRevision() @@ -257,18 +258,17 @@ function getGitCommitsRefs(): Closure try { if (get('update_code_strategy') === 'archive') { cd('{{deploy_path}}/.dep/repo'); - } - else { + } else { cd('{{release_path}}'); } $result = run(sprintf('git rev-list --pretty="%s" %s', 'format:%H#%an#%ae#%at#%s', $commitRange)); $lines = array_filter( - // limit number of commits for first release with many commits + // limit number of commits for first release with many commits array_map('trim', array_slice(explode("\n", $result), 0, 200)), static function (string $line): bool { return !empty($line) && strpos($line, 'commit') !== 0; - } + }, ); return array_map( @@ -283,7 +283,7 @@ static function (string $line): array { 'timestamp' => date(\DateTime::ATOM, (int) $timestamp), ]; }, - $lines + $lines, ); } catch (\Deployer\Exception\RunException $e) { diff --git a/contrib/slack.php b/contrib/slack.php index 02ce840ac..865120af6 100644 --- a/contrib/slack.php +++ b/contrib/slack.php @@ -61,6 +61,7 @@ ``` */ + namespace Deployer; use Deployer\Utility\Httpie; diff --git a/contrib/supervisord-monitor.php b/contrib/supervisord-monitor.php index 7fa80c1b8..8f78dc133 100644 --- a/contrib/supervisord-monitor.php +++ b/contrib/supervisord-monitor.php @@ -86,6 +86,7 @@ ->select('stage=production'); ``` */ + namespace Deployer; use Deployer\Utility\Httpie; @@ -109,7 +110,7 @@ function supervisordCheckConfig() function supervisordGetBasicAuthToken() { - return 'Basic ' . base64_encode(get('supervisord_basic_auth_user'). ':'. get('supervisord_basic_auth_password')); + return 'Basic ' . base64_encode(get('supervisord_basic_auth_user') . ':' . get('supervisord_basic_auth_password')); } function supervisordIsAuthenticated() @@ -125,7 +126,7 @@ function supervisordIsAuthenticated() function supervisordControlAction($name, $action = 'stop') { $stopResponseInfo = []; - Httpie::post(get('supervisord_uri') . '/control/'.$action.'/localhost/'.$name)->header('Authorization', supervisordGetBasicAuthToken())->send($stopResponseInfo); + Httpie::post(get('supervisord_uri') . '/control/' . $action . '/localhost/' . $name)->header('Authorization', supervisordGetBasicAuthToken())->send($stopResponseInfo); return $stopResponseInfo['http_code'] === 200; } @@ -136,9 +137,9 @@ function supervisordControlAction($name, $action = 'stop') foreach ($names as $name) { $name = trim($name); if (supervisordControlAction($name, 'stop')) { - writeln('Daemon ['.$name.'] stopped'); + writeln('Daemon [' . $name . '] stopped'); if (supervisordControlAction($name, 'start')) { - writeln('Daemon ['.$name.'] started'); + writeln('Daemon [' . $name . '] started'); } } } @@ -153,7 +154,7 @@ function supervisordControlAction($name, $action = 'stop') foreach ($names as $name) { $name = trim($name); if (supervisordControlAction($name, 'stop')) { - writeln('Daemon ['.$name.'] stopped'); + writeln('Daemon [' . $name . '] stopped'); } } } else { @@ -167,7 +168,7 @@ function supervisordControlAction($name, $action = 'stop') foreach ($names as $name) { $name = trim($name); if (supervisordControlAction($name, 'start')) { - writeln('Daemon ['.$name.'] started'); + writeln('Daemon [' . $name . '] started'); } } } else { diff --git a/contrib/telegram.php b/contrib/telegram.php index b415e8c5e..9fa7bd946 100644 --- a/contrib/telegram.php +++ b/contrib/telegram.php @@ -56,7 +56,9 @@ */ + namespace Deployer; + use Deployer\Utility\Httpie; // Title of project @@ -72,7 +74,7 @@ throw new \Exception('Please, configure "telegram_chat_id" parameter.'); }); set('telegram_url', function () { - return 'https://api.telegram.org/bot' . get('telegram_token') . '/sendmessage'; + return 'https://api.telegram.org/bot' . get('telegram_token') . '/sendmessage'; }); // Deploy message @@ -93,12 +95,12 @@ return; } - $telegramUrl = get('telegram_url') . '?' . http_build_query ( - Array ( + $telegramUrl = get('telegram_url') . '?' . http_build_query( + [ 'chat_id' => get('telegram_chat_id'), 'text' => get('telegram_text'), 'parse_mode' => 'Markdown', - ) + ], ); $httpie = Httpie::get($telegramUrl); @@ -112,39 +114,39 @@ ->once() ->hidden(); - desc('Notifies Telegram about deploy finish'); - task('telegram:notify:success', function () { - if (!get('telegram_token', false)) { - warning('No Telegram token configured'); - return; - } - - if (!get('telegram_chat_id', false)) { - warning('No Telegram chat id configured'); - return; - } - - $telegramUrl = get('telegram_url') . '?' . http_build_query ( - Array ( - 'chat_id' => get('telegram_chat_id'), - 'text' => get('telegram_success_text'), - 'parse_mode' => 'Markdown', - ) - ); - - $httpie = Httpie::get($telegramUrl); - - if (get('telegram_proxy', '') !== '') { - $httpie = $httpie->setopt(CURLOPT_PROXY, get('telegram_proxy')); - } - - $httpie->send(); +desc('Notifies Telegram about deploy finish'); +task('telegram:notify:success', function () { + if (!get('telegram_token', false)) { + warning('No Telegram token configured'); + return; + } + + if (!get('telegram_chat_id', false)) { + warning('No Telegram chat id configured'); + return; + } + + $telegramUrl = get('telegram_url') . '?' . http_build_query( + [ + 'chat_id' => get('telegram_chat_id'), + 'text' => get('telegram_success_text'), + 'parse_mode' => 'Markdown', + ], + ); + + $httpie = Httpie::get($telegramUrl); + + if (get('telegram_proxy', '') !== '') { + $httpie = $httpie->setopt(CURLOPT_PROXY, get('telegram_proxy')); + } + + $httpie->send(); }) - ->once() - ->hidden(); + ->once() + ->hidden(); - desc('Notifies Telegram about deploy failure'); - task('telegram:notify:failure', function () { +desc('Notifies Telegram about deploy failure'); +task('telegram:notify:failure', function () { if (!get('telegram_token', false)) { warning('No Telegram token configured'); return; @@ -155,21 +157,21 @@ return; } - $telegramUrl = get('telegram_url') . '?' . http_build_query ( - Array ( - 'chat_id' => get('telegram_chat_id'), - 'text' => get('telegram_failure_text'), - 'parse_mode' => 'Markdown', - ) - ); + $telegramUrl = get('telegram_url') . '?' . http_build_query( + [ + 'chat_id' => get('telegram_chat_id'), + 'text' => get('telegram_failure_text'), + 'parse_mode' => 'Markdown', + ], + ); - $httpie = Httpie::get($telegramUrl); + $httpie = Httpie::get($telegramUrl); - if (get('telegram_proxy', '') !== '') { - $httpie = $httpie->setopt(CURLOPT_PROXY, get('telegram_proxy')); - } + if (get('telegram_proxy', '') !== '') { + $httpie = $httpie->setopt(CURLOPT_PROXY, get('telegram_proxy')); + } - $httpie->send(); + $httpie->send(); }) - ->once() - ->hidden(); + ->once() + ->hidden(); diff --git a/contrib/webpack_encore.php b/contrib/webpack_encore.php index f6c4d9ae8..df71168a0 100644 --- a/contrib/webpack_encore.php +++ b/contrib/webpack_encore.php @@ -16,6 +16,7 @@ after('deploy:update_code', 'webpack_encore:build'); ``` */ + namespace Deployer; require_once __DIR__ . '/npm.php'; diff --git a/contrib/workplace.php b/contrib/workplace.php index 4f164a69c..a95f3de0c 100644 --- a/contrib/workplace.php +++ b/contrib/workplace.php @@ -62,6 +62,7 @@ ``` */ + namespace Deployer; use Deployer\Utility\Httpie; @@ -89,7 +90,7 @@ parse_url(get('workplace_webhook'), PHP_URL_SCHEME), parse_url(get('workplace_webhook'), PHP_URL_HOST), $response['id'], - parse_url(get('workplace_webhook'), PHP_URL_QUERY) + parse_url(get('workplace_webhook'), PHP_URL_QUERY), ); // Replace the webhook with a url that points to the created post set('workplace_webhook', $url); diff --git a/contrib/yammer.php b/contrib/yammer.php index 9b84c4b87..40af743f8 100644 --- a/contrib/yammer.php +++ b/contrib/yammer.php @@ -47,6 +47,7 @@ ``` */ + namespace Deployer; use Deployer\Utility\Httpie; diff --git a/contrib/yarn.php b/contrib/yarn.php index b7acd39b5..aef1952df 100644 --- a/contrib/yarn.php +++ b/contrib/yarn.php @@ -10,6 +10,7 @@ after('deploy:update_code', 'yarn:install'); ``` */ + namespace Deployer; set('bin/yarn', function () { diff --git a/phpcs.xml b/phpcs.xml deleted file mode 100644 index df21cf250..000000000 --- a/phpcs.xml +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - src - - - - - - diff --git a/recipe/cakephp.php b/recipe/cakephp.php index 451d1a995..96ec5c773 100644 --- a/recipe/cakephp.php +++ b/recipe/cakephp.php @@ -1,4 +1,5 @@ hidden(); fail('deploy', 'deploy:failed'); diff --git a/recipe/composer.php b/recipe/composer.php index 4021b3c60..5ad96e38f 100644 --- a/recipe/composer.php +++ b/recipe/composer.php @@ -1,4 +1,5 @@ {{target}}> (release {$releaseName}>)"); }); diff --git a/recipe/deploy/lock.php b/recipe/deploy/lock.php index f436ab728..5ce34b68a 100644 --- a/recipe/deploy/lock.php +++ b/recipe/deploy/lock.php @@ -1,4 +1,5 @@ false, 'options' => ['--relative']] + ['progress_bar' => false, 'options' => ['--relative']], ); // Mark this release as dirty. diff --git a/recipe/deploy/release.php b/recipe/deploy/release.php index 38dc7cb4a..980677097 100644 --- a/recipe/deploy/release.php +++ b/recipe/deploy/release.php @@ -1,8 +1,10 @@ $release (bad)"; - } else if (test("[ -f releases/$release/DIRTY_RELEASE ]")) { + } elseif (test("[ -f releases/$release/DIRTY_RELEASE ]")) { $status = "$release (dirty)"; } else { $status = "$release"; diff --git a/recipe/deploy/rollback.php b/recipe/deploy/rollback.php index f4ec9c158..7afd34d01 100644 --- a/recipe/deploy/rollback.php +++ b/recipe/deploy/rollback.php @@ -1,4 +1,5 @@ '0', - 'GIT_SSH_COMMAND' => get('git_ssh_command') + 'GIT_SSH_COMMAND' => get('git_ssh_command'), ]; start: @@ -104,7 +105,7 @@ // Copy to release_path. if (get('update_code_strategy') === 'archive') { run("$git archive $targetWithDir | tar -x -f - -C {{release_path}} 2>&1"); - } else if (get('update_code_strategy') === 'clone') { + } elseif (get('update_code_strategy') === 'clone') { cd('{{release_path}}'); run("$git clone -l $bare ."); run("$git remote set-url origin $repository", ['env' => $env]); diff --git a/recipe/deploy/vendors.php b/recipe/deploy/vendors.php index b7c8f9a06..0fbef458f 100644 --- a/recipe/deploy/vendors.php +++ b/recipe/deploy/vendors.php @@ -1,4 +1,5 @@ $value) { $keys = []; - for ($i = $iterator->getDepth(); $i > 0; $i --) { + for ($i = $iterator->getDepth(); $i > 0; $i--) { $keys[] = $iterator->getSubIterator($i - 1)->key(); } $keys[] = $key; diff --git a/recipe/drupal8.php b/recipe/drupal8.php index 77c4190ec..151fd6cf3 100644 --- a/recipe/drupal8.php +++ b/recipe/drupal8.php @@ -1,4 +1,5 @@ 0 ) { + if (count(get('magento_themes')) > 0) { $themes = array_is_list(get('magento_themes')) ? get('magento_themes') : array_keys(get('magento_themes')); foreach ($themes as $theme) { $themesToCompile .= ' -t ' . $theme; @@ -246,7 +247,7 @@ function magentoDeployAssetsSplit(string $area) : 'adminhtml'; if ($useDefaultLanguages) { - $themes = '-t '.implode(' -t ', $themes); + $themes = '-t ' . implode(' -t ', $themes); run("{{bin/php}} {{bin/magento}} setup:static-content:deploy -f --area=$staticContentArea --content-version={{content_version}} {{static_deploy_options}} $defaultLanguages $themes -j {{static_content_jobs}}"); return; @@ -378,10 +379,10 @@ function magentoDeployAssetsSplit(string $area) // tasks section desc('Packages all relevant files in an artifact.'); -task('artifact:package', function() { +task('artifact:package', function () { if (!test('[ -f {{artifact_excludes_file}} ]')) { throw new GracefulShutdownException( - "No artifact excludes file provided, provide one at artifacts/excludes or change location" + "No artifact excludes file provided, provide one at artifacts/excludes or change location", ); } run('{{bin/tar}} --exclude-from={{artifact_excludes_file}} -czf {{artifact_path}} -C {{release_or_current_path}} .'); @@ -399,12 +400,12 @@ function magentoDeployAssetsSplit(string $area) }); desc('Clears generated files prior to building.'); -task('build:remove-generated', function() { +task('build:remove-generated', function () { run('rm -rf generated/*'); }); desc('Prepare local artifact build'); -task('build:prepare', function() { +task('build:prepare', function () { if (!currentHost()->get('local')) { throw new GracefulShutdownException('Artifact can only be built locally, you provided a non local host'); } @@ -430,12 +431,12 @@ function magentoDeployAssetsSplit(string $area) desc('Builds an artifact.'); task('artifact:build', [ - 'build:prepare', - 'build:remove-generated', - 'deploy:vendors', - 'magento:compile', - 'magento:deploy:assets', - 'artifact:package', + 'build:prepare', + 'build:remove-generated', + 'deploy:vendors', + 'magento:compile', + 'magento:deploy:assets', + 'artifact:package', ]); // Array of shared files that will be added to the default shared_files without overriding @@ -539,35 +540,35 @@ function magentoDeployAssetsSplit(string $area) desc('Prepares an artifact on the target server'); task('artifact:prepare', [ - 'deploy:info', - 'deploy:setup', - 'deploy:lock', - 'deploy:release', - 'artifact:upload', - 'artifact:extract', - 'deploy:additional-shared', - 'deploy:shared', - 'deploy:writable', + 'deploy:info', + 'deploy:setup', + 'deploy:lock', + 'deploy:release', + 'artifact:upload', + 'artifact:extract', + 'deploy:additional-shared', + 'deploy:shared', + 'deploy:writable', ]); desc('Executes the tasks after artifact is released'); task('artifact:finish', [ - 'magento:cache:flush', - 'cachetool:clear:opcache', - 'deploy:cleanup', - 'deploy:unlock', - 'deploy:success' + 'magento:cache:flush', + 'cachetool:clear:opcache', + 'deploy:cleanup', + 'deploy:unlock', + 'deploy:success', ]); desc('Actually releases the artifact deployment'); task('artifact:deploy', [ - 'artifact:prepare', - 'magento:maintenance:enable-if-needed', - 'magento:config:import', - 'magento:upgrade:db', - 'magento:maintenance:disable', - 'deploy:symlink', - 'artifact:finish', + 'artifact:prepare', + 'magento:maintenance:enable-if-needed', + 'magento:config:import', + 'magento:upgrade:db', + 'magento:maintenance:disable', + 'deploy:symlink', + 'artifact:finish', ]); fail('artifact:deploy', 'deploy:failed'); diff --git a/recipe/pimcore.php b/recipe/pimcore.php index 7ea6f5cb8..ebd337f1c 100644 --- a/recipe/pimcore.php +++ b/recipe/pimcore.php @@ -1,4 +1,5 @@ - - - - - 404 Not Found - - - - - - Deployer - - - - - - - - Not Found - The requested URL was not found on this server. - - - -HTML; + + + + + + 404 Not Found + + + + + + Deployer + + + + + + + + Not Found + The requested URL was not found on this server. + + + + HTML; run("mkdir -p /var/dep/html"); run("echo $'$html' > /var/dep/html/404.html"); })->oncePerNode(); diff --git a/recipe/provision/databases.php b/recipe/provision/databases.php index 4e46331ba..e89745c23 100644 --- a/recipe/provision/databases.php +++ b/recipe/provision/databases.php @@ -1,4 +1,5 @@ set('writable_recursive', true) * ->set('become', 'www-data'); // You might want to change user to execute remote tasks because of access rights of created cache files * ``` - * + * * :::note * Please remember that the installation must be modified so that it can be * [build without database](https://developer.shopware.com/docs/guides/hosting/installation-updates/deployments/build-w-o-db#compiling-the-storefront-without-database). * ::: */ + namespace Deployer; require_once __DIR__ . '/common.php'; diff --git a/recipe/silverstripe.php b/recipe/silverstripe.php index edde919c1..d32549344 100644 --- a/recipe/silverstripe.php +++ b/recipe/silverstripe.php @@ -1,4 +1,5 @@ * diff --git a/src/Command/BlackjackCommand.php b/src/Command/BlackjackCommand.php index 52317c53a..eba45166f 100644 --- a/src/Command/BlackjackCommand.php +++ b/src/Command/BlackjackCommand.php @@ -1,4 +1,6 @@ - * @@ -13,6 +15,7 @@ use Symfony\Component\Console\Output\OutputInterface as Output; use Symfony\Component\Console\Question\ChoiceQuestion; use Symfony\Component\Console\Style\SymfonyStyle; + use function Deployer\Support\array_flatten; class BlackjackCommand extends Command @@ -61,10 +64,10 @@ protected function execute(Input $input, Output $output): int if (md5(strval(getenv('MONEY'))) === '5a7c2f336d0cc43b68951e75cdffe333') { $money += 25; $this->print('You got an extra $25.>'); - } else if (md5(strval(getenv('MONEY'))) === '530029252abcbda4a2a2069036ccc7fc') { + } elseif (md5(strval(getenv('MONEY'))) === '530029252abcbda4a2a2069036ccc7fc') { $money += 100; $this->print('You got an extra $100.>'); - } else if (md5(strval(getenv('MONEY'))) === '1aa827a06ecbfa5d6fa7c62ad245f3a3') { + } elseif (md5(strval(getenv('MONEY'))) === '1aa827a06ecbfa5d6fa7c62ad245f3a3') { $money = 100000; } @@ -89,10 +92,14 @@ protected function execute(Input $input, Output $output): int start: $this->print("You have $$money."); if ($money > 0) { - $bet = (int)$io->ask('Your bet', '5'); - if ($bet <= 0) goto start; - if ($bet > $money) goto start; - } else if ($hasWatch) { + $bet = (int) $io->ask('Your bet', '5'); + if ($bet <= 0) { + goto start; + } + if ($bet > $money) { + goto start; + } + } elseif ($hasWatch) { $answer = $io->askQuestion(new ChoiceQuestion('?', ['leave', '- Here, take my watch! [$25]'], 0)); if ($answer == 'leave') { goto leave; @@ -162,7 +169,7 @@ protected function execute(Input $input, Output $output): int $this->print("You won!>"); $this->print("+$$bet"); $money += $bet; - } else if ($p < $d) { + } elseif ($p < $d) { $this->print("You lose!>"); $this->print("-$$bet"); $money -= $bet; @@ -181,7 +188,7 @@ protected function execute(Input $input, Output $output): int if ($money >= 5) { array_push($choices, 'tip the waitress [$5]'); } - } else if ($money >= 5) { + } elseif ($money >= 5) { array_push($choices, 'order whiskey [$5]'); } @@ -193,12 +200,12 @@ protected function execute(Input $input, Output $output): int if ($answer == 'leave') { goto leave; - } else if ($money >= 5 && $answer == 'order whiskey [$5]') { + } elseif ($money >= 5 && $answer == 'order whiskey [$5]') { $orderWhiskey = true; $this->print('You say:'); $this->print(' - Whiskey, please.'); $money -= 5; - } else if ($money >= 5 && $answer == 'tip the waitress [$5]') { + } elseif ($money >= 5 && $answer == 'tip the waitress [$5]') { $this->print('The waitress says:'); $this->print(' - Thank you, sir!'); $money -= 5; @@ -241,7 +248,7 @@ public static function handValue(array $hand): int { $aces = 0; $value = 0; - foreach ($hand as list($rank)) { + foreach ($hand as [$rank]) { switch ($rank) { case '2': $value += 2; @@ -304,7 +311,7 @@ private function printHand(array $hand, int $offset = 1) { $cards = []; for ($i = 0; $i < count($hand) - $offset; $i++) { - list($rank) = $hand[$i]; + [$rank] = $hand[$i]; $cards[] = [ "┌───", "│" . str_pad($rank, 3), @@ -317,7 +324,7 @@ private function printHand(array $hand, int $offset = 1) } for (; $i < count($hand); $i++) { - list($rank, $suit) = $hand[$i]; + [$rank, $suit] = $hand[$i]; $cards[] = [ "┌───────┐", "│" . str_pad($rank, 7) . "│", @@ -343,50 +350,50 @@ private function printWhiskey(int $whiskeyLevel) if ($whiskeyLevel == 4) { echo << * diff --git a/src/Command/ConfigCommand.php b/src/Command/ConfigCommand.php index 8aee286ff..6db5624fb 100644 --- a/src/Command/ConfigCommand.php +++ b/src/Command/ConfigCommand.php @@ -1,4 +1,6 @@ - * diff --git a/src/Command/CustomOption.php b/src/Command/CustomOption.php index f51af8d77..1d043e3dd 100644 --- a/src/Command/CustomOption.php +++ b/src/Command/CustomOption.php @@ -1,4 +1,6 @@ - * @@ -20,7 +22,7 @@ protected function applyOverrides(array $hosts, array $options) { $override = []; foreach ($options as $option) { - list($name, $value) = explode('=', $option); + [$name, $value] = explode('=', $option); $value = $this->castValueToPhpType(trim($value)); $override[trim($name)] = $value; } diff --git a/src/Command/InitCommand.php b/src/Command/InitCommand.php index 6d98e5bb9..25643ac2c 100644 --- a/src/Command/InitCommand.php +++ b/src/Command/InitCommand.php @@ -1,4 +1,6 @@ - * @@ -32,36 +34,38 @@ protected function configure() protected function execute(InputInterface $input, OutputInterface $output): int { if (getenv('COLORTERM') === 'truecolor') { - $output->write(<<write( + <<write(<<write( + <<[A-Za-z0-9_.\-]+)\//', $repository, $m)) { $org = $m['org']; $tempHostFile = tempnam(sys_get_temp_dir(), 'temp-host-file'); - $php = new PhpProcess(<<blog, PHP_URL_HOST); -file_put_contents('$tempHostFile', \$host); -EOF + $php = new PhpProcess( + <<blog, PHP_URL_HOST); + file_put_contents('$tempHostFile', \$host); + EOF, ); $php->start(); } @@ -146,7 +151,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int $this->telemetry(); $output->writeln(sprintf( 'Successfully created %s', - $recipePath + $recipePath, )); return 0; } @@ -161,34 +166,34 @@ private function php(string $template, string $project, string $repository, arra } return <<getAdditionalConfigs($template); return << * @@ -19,6 +21,7 @@ use Symfony\Component\Console\Input\InputInterface as Input; use Symfony\Component\Console\Input\InputOption as Option; use Symfony\Component\Console\Output\OutputInterface as Output; + use function Deployer\Support\find_config_line; use function Deployer\warning; @@ -46,43 +49,43 @@ protected function configure() 'option', 'o', Option::VALUE_REQUIRED | Option::VALUE_IS_ARRAY, - 'Set configuration option' + 'Set configuration option', ); $this->addOption( 'limit', 'l', Option::VALUE_REQUIRED, - 'How many tasks to run in parallel?' + 'How many tasks to run in parallel?', ); $this->addOption( 'no-hooks', null, Option::VALUE_NONE, - 'Run tasks without after/before hooks' + 'Run tasks without after/before hooks', ); $this->addOption( 'plan', null, Option::VALUE_NONE, - 'Show execution plan' + 'Show execution plan', ); $this->addOption( 'start-from', null, Option::VALUE_REQUIRED, - 'Start execution from this task' + 'Start execution from this task', ); $this->addOption( 'log', null, Option::VALUE_REQUIRED, - 'Write log to a file' + 'Write log to a file', ); $this->addOption( 'profile', null, Option::VALUE_REQUIRED, - 'Write profile to a file' + 'Write profile to a file', ); } diff --git a/src/Command/RunCommand.php b/src/Command/RunCommand.php index 8b60f68c4..07139c733 100644 --- a/src/Command/RunCommand.php +++ b/src/Command/RunCommand.php @@ -1,4 +1,6 @@ - * @@ -15,6 +17,7 @@ use Symfony\Component\Console\Input\InputInterface as Input; use Symfony\Component\Console\Input\InputOption as Option; use Symfony\Component\Console\Output\OutputInterface as Output; + use function Deployer\cd; use function Deployer\get; use function Deployer\has; @@ -36,20 +39,20 @@ protected function configure() $this->addArgument( 'command-to-run', InputArgument::REQUIRED, - 'Command to run on a remote host' + 'Command to run on a remote host', ); parent::configure(); $this->addOption( 'option', 'o', Option::VALUE_REQUIRED | Option::VALUE_IS_ARRAY, - 'Set configuration option' + 'Set configuration option', ); $this->addOption( 'timeout', 't', Option::VALUE_REQUIRED, - 'Command timeout in seconds' + 'Command timeout in seconds', ); } diff --git a/src/Command/SelectCommand.php b/src/Command/SelectCommand.php index 7503e6657..23a07a7c8 100644 --- a/src/Command/SelectCommand.php +++ b/src/Command/SelectCommand.php @@ -1,4 +1,6 @@ - * @@ -55,9 +57,9 @@ protected function selectHosts(Input $input, Output $output): array if (empty($selectExpression)) { if (count($this->deployer->hosts) === 0) { throw new ConfigurationException("No host configured.\nSpecify at least one host: `localhost();`."); - } else if (count($this->deployer->hosts) === 1) { + } elseif (count($this->deployer->hosts) === 1) { $hosts = $this->deployer->hosts->all(); - } else if ($input->isInteractive()) { + } elseif ($input->isInteractive()) { $hostsAliases = []; foreach ($this->deployer->hosts as $host) { $hostsAliases[] = $host->getAlias(); @@ -66,7 +68,7 @@ protected function selectHosts(Input $input, Output $output): array $helper = $this->getHelper('question'); $question = new ChoiceQuestion( 'Select hosts: (comma separated)', - $hostsAliases + $hostsAliases, ); $question->setMultiselect(true); $question->setErrorMessage('There is no "%s" host.'); diff --git a/src/Command/SshCommand.php b/src/Command/SshCommand.php index 31e4d33ac..37b2cf8c2 100644 --- a/src/Command/SshCommand.php +++ b/src/Command/SshCommand.php @@ -1,4 +1,6 @@ - * @@ -44,7 +46,7 @@ protected function configure() $this->addArgument( 'hostname', InputArgument::OPTIONAL, - 'Hostname' + 'Hostname', ); } @@ -74,7 +76,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int $helper = $this->getHelper('question'); $question = new ChoiceQuestion( 'Select host:', - $hostsAliases + $hostsAliases, ); $question->setErrorMessage('There is no "%s" host.'); diff --git a/src/Command/TreeCommand.php b/src/Command/TreeCommand.php index 3357dd889..ba39c7e6a 100644 --- a/src/Command/TreeCommand.php +++ b/src/Command/TreeCommand.php @@ -1,4 +1,6 @@ - * @@ -53,7 +55,7 @@ protected function configure() $this->addArgument( 'task', InputArgument::REQUIRED, - 'Task to display the tree for' + 'Task to display the tree for', ); } @@ -134,7 +136,7 @@ private function addTaskToTree(string $taskName, bool $isLast = false) 'taskName' => $taskName, 'depth' => $this->depth, 'isLast' => $isLast, - 'openDepths' => $this->openGroupDepths + 'openDepths' => $this->openGroupDepths, ]; } diff --git a/src/Command/WorkerCommand.php b/src/Command/WorkerCommand.php index b62954ba2..311692e9b 100644 --- a/src/Command/WorkerCommand.php +++ b/src/Command/WorkerCommand.php @@ -1,4 +1,6 @@ - * @@ -14,6 +16,7 @@ use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Input\InputOption as Option; use Symfony\Component\Console\Output\OutputInterface; + use function Deployer\localhost; class WorkerCommand extends MainCommand diff --git a/src/Component/PharUpdate/Console/Command.php b/src/Component/PharUpdate/Console/Command.php index f63f4e6cd..a3e10e645 100644 --- a/src/Component/PharUpdate/Console/Command.php +++ b/src/Component/PharUpdate/Console/Command.php @@ -1,4 +1,6 @@ -addOption( 'redo', 'r', InputOption::VALUE_NONE, - 'Redownload update if already using current version.' + 'Redownload update if already using current version.', ); if (false === $this->disableUpgrade) { @@ -92,7 +94,7 @@ protected function configure() 'upgrade', 'u', InputOption::VALUE_NONE, - 'Upgrade to next major release, if available.' + 'Upgrade to next major release, if available.', ); } } @@ -104,7 +106,7 @@ protected function execute(InputInterface $input, OutputInterface $output) { if (null === $this->manifestUri) { throw new LogicException( - 'No manifest URI has been configured.' + 'No manifest URI has been configured.', ); } @@ -119,7 +121,7 @@ protected function execute(InputInterface $input, OutputInterface $output) if ($manager->update( $this->getApplication()->getVersion(), $this->disableUpgrade ?: (false === $input->getOption('upgrade')), - $input->getOption('pre') + $input->getOption('pre'), )) { $output->writeln('Update successful!'); } else { diff --git a/src/Component/PharUpdate/Console/Helper.php b/src/Component/PharUpdate/Console/Helper.php index 3e66dc7fa..270c1999c 100644 --- a/src/Component/PharUpdate/Console/Helper.php +++ b/src/Component/PharUpdate/Console/Helper.php @@ -1,4 +1,6 @@ - */ -interface ExceptionInterface -{ -} +interface ExceptionInterface {} diff --git a/src/Component/PharUpdate/Exception/FileException.php b/src/Component/PharUpdate/Exception/FileException.php index 92585250c..8e1f349c4 100644 --- a/src/Component/PharUpdate/Exception/FileException.php +++ b/src/Component/PharUpdate/Exception/FileException.php @@ -1,4 +1,6 @@ - */ -class FileException extends Exception -{ -} +class FileException extends Exception {} diff --git a/src/Component/PharUpdate/Exception/InvalidArgumentException.php b/src/Component/PharUpdate/Exception/InvalidArgumentException.php index 7690c5687..2658c4efb 100644 --- a/src/Component/PharUpdate/Exception/InvalidArgumentException.php +++ b/src/Component/PharUpdate/Exception/InvalidArgumentException.php @@ -1,4 +1,6 @@ - */ -class InvalidArgumentException extends Exception -{ -} +class InvalidArgumentException extends Exception {} diff --git a/src/Component/PharUpdate/Exception/LogicException.php b/src/Component/PharUpdate/Exception/LogicException.php index 1273dcf4a..1c7f5c80e 100644 --- a/src/Component/PharUpdate/Exception/LogicException.php +++ b/src/Component/PharUpdate/Exception/LogicException.php @@ -1,4 +1,6 @@ - */ -class LogicException extends Exception -{ -} +class LogicException extends Exception {} diff --git a/src/Component/PharUpdate/Manager.php b/src/Component/PharUpdate/Manager.php index f7bd52cc9..86ddffc33 100644 --- a/src/Component/PharUpdate/Manager.php +++ b/src/Component/PharUpdate/Manager.php @@ -1,4 +1,6 @@ -manifest->findRecent( $version, $major, - $pre + $pre, ))) { $update->getFile(); $update->copyTo($this->getRunningFile()); diff --git a/src/Component/PharUpdate/Manifest.php b/src/Component/PharUpdate/Manifest.php index a9fa5f767..a03d03d08 100644 --- a/src/Component/PharUpdate/Manifest.php +++ b/src/Component/PharUpdate/Manifest.php @@ -1,4 +1,6 @@ -updates = $updates; } @@ -37,7 +39,7 @@ public function __construct(array $updates = array()) * @param boolean $major Lock to major version? * @param boolean $pre Allow pre-releases? */ - public function findRecent(Version $version, bool $major = false, bool $pre = false):? Update + public function findRecent(Version $version, bool $major = false, bool $pre = false): ?Update { /** @var Update|null */ $current = null; @@ -104,7 +106,7 @@ public static function loadFile(string $file): self */ private static function create(array $decoded): self { - $updates = array(); + $updates = []; foreach ($decoded as $update) { $updates[] = new Update( @@ -112,7 +114,7 @@ private static function create(array $decoded): self $update->sha1, $update->url, Parser::toVersion($update->version), - isset($update->publicKey) ? $update->publicKey : null + $update->publicKey ?? null, ); } @@ -121,9 +123,9 @@ private static function create(array $decoded): self function (Update $a, Update $b) { return Comparator::isGreaterThan( $a->getVersion(), - $b->getVersion() + $b->getVersion(), ) ? 1 : 0; - } + }, ); return new static($updates); diff --git a/src/Component/PharUpdate/Update.php b/src/Component/PharUpdate/Update.php index 7d897a30a..b17509132 100644 --- a/src/Component/PharUpdate/Update.php +++ b/src/Component/PharUpdate/Update.php @@ -1,4 +1,6 @@ -name = $name; $this->publicKey = $key; @@ -95,11 +97,11 @@ public function copyTo(string $file): void { if (null === $this->file) { throw LogicException::create( - 'The update file has not been downloaded.' + 'The update file has not been downloaded.', ); } - $mode = 0755; + $mode = 0o755; if (file_exists($file)) { $mode = fileperms($file) & 511; @@ -167,7 +169,7 @@ public function deleteFile(): void * @throws FileException If the SHA1 checksum differs. * @throws UnexpectedValueException If the Phar is corrupt. */ - public function getFile():? string + public function getFile(): ?string { if (null === $this->file) { unlink($this->file = tempnam(sys_get_temp_dir(), 'upd')); @@ -201,7 +203,7 @@ public function getFile():? string throw FileException::create( 'Mismatch of the SHA1 checksum (%s) of the downloaded file (%s).', $this->sha1, - $sha1 + $sha1, ); } diff --git a/src/Component/PharUpdate/Version/Builder.php b/src/Component/PharUpdate/Version/Builder.php index 71451619e..2319de6a3 100644 --- a/src/Component/PharUpdate/Version/Builder.php +++ b/src/Component/PharUpdate/Version/Builder.php @@ -1,4 +1,6 @@ -build = array(); + $this->build = []; } /** @@ -25,7 +27,7 @@ public function clearBuild(): void */ public function clearPreRelease(): void { - $this->preRelease = array(); + $this->preRelease = []; } /** @@ -50,7 +52,7 @@ public function getVersion(): Version $this->minor, $this->patch, $this->preRelease, - $this->build + $this->build, ); } @@ -66,7 +68,7 @@ public function importComponents(array $components): self if (isset($components[Parser::BUILD])) { $this->build = $components[Parser::BUILD]; } else { - $this->build = array(); + $this->build = []; } if (isset($components[Parser::MAJOR])) { @@ -90,7 +92,7 @@ public function importComponents(array $components): self if (isset($components[Parser::PRE_RELEASE])) { $this->preRelease = $components[Parser::PRE_RELEASE]; } else { - $this->preRelease = array(); + $this->preRelease = []; } return $this; diff --git a/src/Component/PharUpdate/Version/Comparator.php b/src/Component/PharUpdate/Version/Comparator.php index 0cbcd4237..8a0e73739 100644 --- a/src/Component/PharUpdate/Version/Comparator.php +++ b/src/Component/PharUpdate/Version/Comparator.php @@ -1,4 +1,6 @@ -getPatch() < $right->getPatch()): return self::LESS_THAN; - // @codeCoverageIgnoreStart + // @codeCoverageIgnoreStart } // @codeCoverageIgnoreEnd return self::compareIdentifiers( $left->getPreRelease(), - $right->getPreRelease() + $right->getPreRelease(), ); } diff --git a/src/Component/PharUpdate/Version/Dumper.php b/src/Component/PharUpdate/Version/Dumper.php index 4791328ec..88a2e5490 100644 --- a/src/Component/PharUpdate/Version/Dumper.php +++ b/src/Component/PharUpdate/Version/Dumper.php @@ -1,4 +1,6 @@ - $version->getMajor(), Parser::MINOR => $version->getMinor(), Parser::PATCH => $version->getPatch(), Parser::PRE_RELEASE => $version->getPreRelease(), - Parser::BUILD => $version->getBuild() - ); + Parser::BUILD => $version->getBuild(), + ]; } /** @@ -46,7 +48,7 @@ public static function toString(Version $version) : '', $version->getBuild() ? '+' . join('.', $version->getBuild()) - : '' + : '', ); } } diff --git a/src/Component/PharUpdate/Version/Exception/InvalidIdentifierException.php b/src/Component/PharUpdate/Version/Exception/InvalidIdentifierException.php index 39b9f09c6..0768d0bcf 100644 --- a/src/Component/PharUpdate/Version/Exception/InvalidIdentifierException.php +++ b/src/Component/PharUpdate/Version/Exception/InvalidIdentifierException.php @@ -1,4 +1,6 @@ -identifier = $identifier; diff --git a/src/Component/PharUpdate/Version/Exception/InvalidNumberException.php b/src/Component/PharUpdate/Version/Exception/InvalidNumberException.php index afa7af07e..575a1a25a 100644 --- a/src/Component/PharUpdate/Version/Exception/InvalidNumberException.php +++ b/src/Component/PharUpdate/Version/Exception/InvalidNumberException.php @@ -1,4 +1,6 @@ -number = $number; diff --git a/src/Component/PharUpdate/Version/Exception/InvalidStringRepresentationException.php b/src/Component/PharUpdate/Version/Exception/InvalidStringRepresentationException.php index 6839e187f..6946f129d 100644 --- a/src/Component/PharUpdate/Version/Exception/InvalidStringRepresentationException.php +++ b/src/Component/PharUpdate/Version/Exception/InvalidStringRepresentationException.php @@ -1,4 +1,6 @@ -version = $version; diff --git a/src/Component/PharUpdate/Version/Exception/VersionException.php b/src/Component/PharUpdate/Version/Exception/VersionException.php index 457023427..7aa91543c 100644 --- a/src/Component/PharUpdate/Version/Exception/VersionException.php +++ b/src/Component/PharUpdate/Version/Exception/VersionException.php @@ -1,4 +1,6 @@ - */ -class VersionException extends Exception -{ -} +class VersionException extends Exception {} diff --git a/src/Component/PharUpdate/Version/Parser.php b/src/Component/PharUpdate/Version/Parser.php index e33939597..c49b9a93f 100644 --- a/src/Component/PharUpdate/Version/Parser.php +++ b/src/Component/PharUpdate/Version/Parser.php @@ -1,4 +1,6 @@ -importComponents( - self::toComponents($version) + self::toComponents($version), ); } @@ -67,30 +69,30 @@ public static function toComponents(string $version): array } if (false !== strpos($version, '+')) { - list($version, $build) = explode('+', $version); + [$version, $build] = explode('+', $version); $build = explode('.', $build); } if (false !== strpos($version, '-')) { - list($version, $pre) = explode('-', $version); + [$version, $pre] = explode('-', $version); $pre = explode('.', $pre); } - list( + [ $major, $minor, - $patch - ) = explode('.', $version); + $patch, + ] = explode('.', $version); - return array( + return [ self::MAJOR => intval($major), self::MINOR => intval($minor), self::PATCH => intval($patch), - self::PRE_RELEASE => isset($pre) ? $pre : array(), - self::BUILD => isset($build) ? $build : array(), - ); + self::PRE_RELEASE => $pre ?? [], + self::BUILD => $build ?? [], + ]; } /** @@ -109,7 +111,7 @@ public static function toVersion(string $version): Version $components['minor'], $components['patch'], $components['pre'], - $components['build'] + $components['build'], ); } } diff --git a/src/Component/PharUpdate/Version/Validator.php b/src/Component/PharUpdate/Version/Validator.php index 6fcf9965a..febcffb87 100644 --- a/src/Component/PharUpdate/Version/Validator.php +++ b/src/Component/PharUpdate/Version/Validator.php @@ -1,4 +1,6 @@ -build = $build; $this->major = $major; diff --git a/src/Component/Pimple/Container.php b/src/Component/Pimple/Container.php index b4daffde2..423c421e6 100644 --- a/src/Component/Pimple/Container.php +++ b/src/Component/Pimple/Container.php @@ -1,4 +1,6 @@ - * diff --git a/src/Component/Pimple/Exception/ExpectedInvokableException.php b/src/Component/Pimple/Exception/ExpectedInvokableException.php index cd72204bb..f244a0a60 100644 --- a/src/Component/Pimple/Exception/ExpectedInvokableException.php +++ b/src/Component/Pimple/Exception/ExpectedInvokableException.php @@ -1,4 +1,6 @@ - * @@ -15,6 +17,4 @@ * * @author Pascal Luna */ -class ExpectedInvokableException extends \InvalidArgumentException implements ContainerExceptionInterface -{ -} +class ExpectedInvokableException extends \InvalidArgumentException implements ContainerExceptionInterface {} diff --git a/src/Component/Pimple/Exception/FrozenServiceException.php b/src/Component/Pimple/Exception/FrozenServiceException.php index 8721fa1b1..f332c5347 100644 --- a/src/Component/Pimple/Exception/FrozenServiceException.php +++ b/src/Component/Pimple/Exception/FrozenServiceException.php @@ -1,4 +1,6 @@ - * diff --git a/src/Component/Pimple/Exception/InvalidServiceIdentifierException.php b/src/Component/Pimple/Exception/InvalidServiceIdentifierException.php index 481a8cb3e..99358ec76 100644 --- a/src/Component/Pimple/Exception/InvalidServiceIdentifierException.php +++ b/src/Component/Pimple/Exception/InvalidServiceIdentifierException.php @@ -1,4 +1,6 @@ - * diff --git a/src/Component/Pimple/Exception/UnknownIdentifierException.php b/src/Component/Pimple/Exception/UnknownIdentifierException.php index 1d9858c48..d2aa39a1d 100644 --- a/src/Component/Pimple/Exception/UnknownIdentifierException.php +++ b/src/Component/Pimple/Exception/UnknownIdentifierException.php @@ -1,4 +1,6 @@ - * diff --git a/src/Component/ProcessRunner/Printer.php b/src/Component/ProcessRunner/Printer.php index a1f9422a1..cc7967f9b 100644 --- a/src/Component/ProcessRunner/Printer.php +++ b/src/Component/ProcessRunner/Printer.php @@ -1,4 +1,6 @@ - * diff --git a/src/Component/ProcessRunner/ProcessRunner.php b/src/Component/ProcessRunner/ProcessRunner.php index cbd78cdb3..ef73c0a92 100644 --- a/src/Component/ProcessRunner/ProcessRunner.php +++ b/src/Component/ProcessRunner/ProcessRunner.php @@ -1,4 +1,6 @@ - * @@ -78,12 +80,12 @@ public function run(Host $host, string $command, array $config = []): string $command, $process->getExitCode(), $process->getOutput(), - $process->getErrorOutput() + $process->getErrorOutput(), ); } catch (ProcessTimedOutException $exception) { // @phpstan-ignore-line can be thrown but is absent from the phpdoc throw new TimeoutException( $command, - $exception->getExceededTimeout() + $exception->getExceededTimeout(), ); } } diff --git a/src/Component/Ssh/Client.php b/src/Component/Ssh/Client.php index b9e9a9766..71b3e827c 100644 --- a/src/Component/Ssh/Client.php +++ b/src/Component/Ssh/Client.php @@ -1,4 +1,6 @@ - * @@ -17,6 +19,7 @@ use Symfony\Component\Console\Output\OutputInterface; use Symfony\Component\Process\Exception\ProcessTimedOutException; use Symfony\Component\Process\Process; + use function Deployer\Support\parse_home_dir; class Client @@ -68,7 +71,7 @@ public function run(Host $host, string $command, array $config = []): string if ($this->output->isDebug()) { $sshString = $ssh[0]; for ($i = 1; $i < count($ssh); $i++) { - $sshString .= ' ' . escapeshellarg((string)$ssh[$i]); + $sshString .= ' ' . escapeshellarg((string) $ssh[$i]); } $this->output->writeln("[$host] $sshString"); } @@ -99,7 +102,7 @@ public function run(Host $host, string $command, array $config = []): string $this->run($host, "kill -9 -$pid"); throw new TimeoutException( $command, - $exception->getExceededTimeout() + $exception->getExceededTimeout(), ); } @@ -112,7 +115,7 @@ public function run(Host $host, string $command, array $config = []): string $command, $exitCode, $output, - $process->getErrorOutput() + $process->getErrorOutput(), ); } @@ -122,6 +125,6 @@ public function run(Host $host, string $command, array $config = []): string private function parseExitStatus(Process $process): int { preg_match('/\[exit_code:(\d*)]/', $process->getOutput(), $match); - return (int)($match[1] ?? -1); + return (int) ($match[1] ?? -1); } } diff --git a/src/Component/Ssh/IOArguments.php b/src/Component/Ssh/IOArguments.php index 90df28422..d492caa63 100644 --- a/src/Component/Ssh/IOArguments.php +++ b/src/Component/Ssh/IOArguments.php @@ -1,4 +1,6 @@ - * diff --git a/src/Configuration/Configuration.php b/src/Configuration/Configuration.php index abed01a45..ebf62953e 100644 --- a/src/Configuration/Configuration.php +++ b/src/Configuration/Configuration.php @@ -1,4 +1,6 @@ - * @@ -10,6 +12,7 @@ use Deployer\Exception\ConfigurationException; use Deployer\Utility\Httpie; + use function Deployer\Support\array_merge_alternate; use function Deployer\Support\is_closure; use function Deployer\Support\normalize_line_endings; @@ -99,7 +102,7 @@ public function get(string $name, $default = null) if (is_closure($rawValue)) { return $this->values[$name] = $this->parse(call_user_func($rawValue)); } else { - return $this->values[$name]= $this->parse($rawValue); + return $this->values[$name] = $this->parse($rawValue); } } } diff --git a/src/Deployer.php b/src/Deployer.php index be8c9fc10..21963bd7f 100755 --- a/src/Deployer.php +++ b/src/Deployer.php @@ -1,4 +1,6 @@ - * @@ -90,7 +92,7 @@ public function __construct(Application $console) ******************************/ $console->getDefinition()->addOption( - new InputOption('file', 'f', InputOption::VALUE_REQUIRED, 'Recipe file path') + new InputOption('file', 'f', InputOption::VALUE_REQUIRED, 'Recipe file path'), ); $this['console'] = function () use ($console) { @@ -321,7 +323,7 @@ public static function run(string $version, ?string $deployFile) $output->setVerbosity(OutputInterface::VERBOSITY_DEBUG); } self::printException($output, $exception); - + exit(1); } } diff --git a/src/Documentation/ApiGen.php b/src/Documentation/ApiGen.php index ff69d16e5..31793e1eb 100644 --- a/src/Documentation/ApiGen.php +++ b/src/Documentation/ApiGen.php @@ -1,4 +1,6 @@ - * @@ -73,14 +75,14 @@ public function parse(string $source): void public function markdown(): string { $output = << - - + + + -# API Reference + # API Reference -MD; + MD; foreach ($this->fns as $fn) { [ @@ -95,16 +97,16 @@ public function markdown(): string } $output .= << * @@ -8,7 +10,6 @@ namespace Deployer\Documentation; - class DocConfig { /** diff --git a/src/Documentation/DocGen.php b/src/Documentation/DocGen.php index 9712c1116..0e8ee636a 100644 --- a/src/Documentation/DocGen.php +++ b/src/Documentation/DocGen.php @@ -1,4 +1,6 @@ - * @@ -12,6 +14,7 @@ use RecursiveIteratorIterator; use RecursiveRegexIterator; use RegexIterator; + use function Deployer\Support\str_contains as str_contains; class DocGen @@ -133,39 +136,39 @@ public function gen(string $destination): ?string $config = ''; $tasks = ''; $intro = <<recipePath'; -``` + ```php + require '$recipe->recipePath'; + ``` -[Source](/$recipe->recipePath) + [Source](/$recipe->recipePath) -MD; + MD; if (is_framework_recipe($recipe)) { $brandName = framework_brand_name($recipe->recipeName); $typeOfProject = preg_match('/^symfony/i', $recipe->recipeName) ? 'Application' : 'Project'; $title = "How to Deploy a $brandName $typeOfProject"; $intro .= <<group as $taskName) { @@ -191,33 +194,33 @@ public function gen(string $destination): ?string if ($artifactDeployTask !== null && $artifactBuildTask !== null) { $intro .= "In addition the **$brandName** recipe contains an artifact deployment.\n"; $intro .= <<set('local', true); -``` -to your deploy.php or -```yaml -hosts: - localhost: - local: true -``` -to your deploy yaml. - -The [artifact:build](#artifact:build) command of **$brandName** consists of: -MD; + This is a two step process where you first execute + + ```php + bin/dep artifact:build [options] [localhost] + ``` + + to build an artifact, which then is deployed on a server with + + ```php + bin/dep artifact:deploy [host] + ``` + + The `localhost` to build the artifact on has to be declared local, so either add + ```php + localhost() + ->set('local', true); + ``` + to your deploy.php or + ```yaml + hosts: + localhost: + local: true + ``` + to your deploy yaml. + + The [artifact:build](#artifact:build) command of **$brandName** consists of: + MD; $map($artifactBuildTask); $intro .= "\n\n The [artifact:deploy](#artifact:deploy) command of **$brandName** consists of:\n"; @@ -292,20 +295,20 @@ public function gen(string $destination): ?string } $output = << - - + + + -# $title + # $title -$intro -$config -$tasks -MD; + $intro + $config + $tasks + MD; $filePath = "$destination/" . php_to_md($recipe->recipePath); if (!file_exists(dirname($filePath))) { - mkdir(dirname($filePath), 0755, true); + mkdir(dirname($filePath), 0o755, true); } $output = remove_text_emoji($output); file_put_contents($filePath, $output); @@ -315,7 +318,8 @@ public function gen(string $destination): ?string return null; } - public function generateRecipesIndex(string $destination) { + public function generateRecipesIndex(string $destination) + { $index = "# All Recipes\n\n"; $list = []; foreach ($this->recipes as $recipe) { @@ -329,7 +333,8 @@ public function generateRecipesIndex(string $destination) { file_put_contents("$destination/recipe/README.md", $index); } - public function generateContribIndex(string $destination) { + public function generateContribIndex(string $destination) + { $index = "# All Contrib Recipes\n\n"; $list = []; foreach ($this->recipes as $recipe) { diff --git a/src/Documentation/DocRecipe.php b/src/Documentation/DocRecipe.php index 25cbdc3bf..a568cbc51 100644 --- a/src/Documentation/DocRecipe.php +++ b/src/Documentation/DocRecipe.php @@ -1,4 +1,6 @@ - * @@ -105,7 +107,7 @@ public function parse(string $content) } if (count($body) === 1 && preg_match('/throw new/', $body[0])) { $set->comment .= "\n:::info Required\nThrows exception if not set.\n:::\n"; - } else if (count($body) <= 4) { + } elseif (count($body) <= 4) { $set->defaultValue = implode("\n", $body); } else { $set->comment .= "\n:::info Autogenerated\nThe value of this configuration is autogenerated on access.\n:::\n"; @@ -155,7 +157,7 @@ public function parse(string $content) $comment = ''; break; - case 'comment': + case 'comment': if ($match('\*/\s*$')) { $state = 'root'; break; diff --git a/src/Documentation/DocTask.php b/src/Documentation/DocTask.php index 9bce69dd4..600b12f38 100644 --- a/src/Documentation/DocTask.php +++ b/src/Documentation/DocTask.php @@ -1,4 +1,6 @@ - * @@ -35,7 +37,8 @@ class DocTask */ public $lineNumber; - public function mdLink(): string { + public function mdLink(): string + { $md = php_to_md($this->recipePath); $anchor = anchor($this->name); return "[$this->name](/docs/$md#$anchor)"; diff --git a/src/Exception/ConfigurationException.php b/src/Exception/ConfigurationException.php index 46eb86188..91b313d66 100644 --- a/src/Exception/ConfigurationException.php +++ b/src/Exception/ConfigurationException.php @@ -1,4 +1,6 @@ - * @@ -8,6 +10,4 @@ namespace Deployer\Exception; -class ConfigurationException extends \RuntimeException -{ -} +class ConfigurationException extends \RuntimeException {} diff --git a/src/Exception/Exception.php b/src/Exception/Exception.php index f37b92ff4..1aa73becf 100644 --- a/src/Exception/Exception.php +++ b/src/Exception/Exception.php @@ -1,4 +1,6 @@ - * @@ -65,4 +67,3 @@ public function setTaskLineNumber(int $taskLineNumber): void $this->taskLineNumber = $taskLineNumber; } } - diff --git a/src/Exception/GracefulShutdownException.php b/src/Exception/GracefulShutdownException.php index 6b25735db..a5b0bb303 100644 --- a/src/Exception/GracefulShutdownException.php +++ b/src/Exception/GracefulShutdownException.php @@ -1,4 +1,6 @@ - * @@ -21,5 +23,5 @@ */ class GracefulShutdownException extends Exception { - const EXIT_CODE = 42; + public const EXIT_CODE = 42; } diff --git a/src/Exception/HttpieException.php b/src/Exception/HttpieException.php index 793a7ae76..c5a15b117 100644 --- a/src/Exception/HttpieException.php +++ b/src/Exception/HttpieException.php @@ -1,4 +1,6 @@ - * @@ -8,6 +10,4 @@ namespace Deployer\Exception; -class HttpieException extends \RuntimeException -{ -} +class HttpieException extends \RuntimeException {} diff --git a/src/Exception/RunException.php b/src/Exception/RunException.php index 1d5d835ec..3d638df11 100644 --- a/src/Exception/RunException.php +++ b/src/Exception/RunException.php @@ -1,4 +1,6 @@ - * @@ -39,7 +41,7 @@ public function __construct( string $command, int $exitCode, string $output, - string $errorOutput + string $errorOutput, ) { $this->host = $host; $this->command = $command; diff --git a/src/Exception/TimeoutException.php b/src/Exception/TimeoutException.php index 38592b581..06a2c6d1d 100644 --- a/src/Exception/TimeoutException.php +++ b/src/Exception/TimeoutException.php @@ -1,4 +1,6 @@ - * @@ -12,7 +14,7 @@ class TimeoutException extends Exception { public function __construct( string $command, - ?float $timeout + ?float $timeout, ) { $message = sprintf('The command "%s" exceeded the timeout of %s seconds.', $command, $timeout); parent::__construct($message, 1); diff --git a/src/Exception/WillAskUser.php b/src/Exception/WillAskUser.php index 241c55da4..eea4bf733 100644 --- a/src/Exception/WillAskUser.php +++ b/src/Exception/WillAskUser.php @@ -1,4 +1,6 @@ - * @@ -10,7 +12,8 @@ class WillAskUser extends Exception { - public function __construct(string $message) { + public function __construct(string $message) + { parent::__construct($message); } } diff --git a/src/Executor/Master.php b/src/Executor/Master.php index 042246323..8318cc882 100644 --- a/src/Executor/Master.php +++ b/src/Executor/Master.php @@ -1,4 +1,6 @@ - * @@ -24,7 +26,7 @@ function spinner(string $message = ''): string { - $frame = FRAMES[(int) ((new \DateTime)->format('u') / 1e5) % count(FRAMES)]; + $frame = FRAMES[(int) ((new \DateTime())->format('u') / 1e5) % count(FRAMES)]; return " $frame $message\r"; } @@ -59,9 +61,8 @@ public function __construct( InputInterface $input, OutputInterface $output, Server $server, - Messenger $messenger - ) - { + Messenger $messenger, + ) { $this->input = $input; $this->output = $output; $this->server = $server; @@ -75,7 +76,7 @@ public function __construct( */ public function run(array $tasks, array $hosts, ?Planner $plan = null): int { - $globalLimit = (int)$this->input->getOption('limit') ?: count($hosts); + $globalLimit = (int) $this->input->getOption('limit') ?: count($hosts); foreach ($tasks as $task) { if (!$plan) { @@ -94,7 +95,7 @@ public function run(array $tasks, array $hosts, ?Planner $plan = null): int break; } } - } else if ($task->isOncePerNode()) { + } elseif ($task->isOncePerNode()) { $plannedHosts = []; foreach ($hosts as $currentHost) { if (Selector::apply($task->getSelector(), $currentHost)) { diff --git a/src/Executor/Messenger.php b/src/Executor/Messenger.php index 0632ae4a0..b5b3c0cd9 100644 --- a/src/Executor/Messenger.php +++ b/src/Executor/Messenger.php @@ -1,4 +1,6 @@ - * @@ -51,9 +53,9 @@ public function startTask(Task $task): void $this->startTime = round(microtime(true) * 1000); if (getenv('GITHUB_WORKFLOW')) { $this->output->writeln("::group::task {$task->getName()}"); - } else if (getenv('GITLAB_CI')) { + } elseif (getenv('GITLAB_CI')) { $sectionId = md5($task->getName()); - $start = round($this->startTime/1000); + $start = round($this->startTime / 1000); $this->output->writeln("\e[0Ksection_start:{$start}:{$sectionId}\r\e[0K{$task->getName()}"); } else { $this->output->writeln("task> {$task->getName()}"); @@ -78,11 +80,11 @@ public function endTask(Task $task, bool $error = false): void if (getenv('GITHUB_WORKFLOW')) { $this->output->writeln("::endgroup::"); - } else if (getenv('GITLAB_CI')) { + } elseif (getenv('GITLAB_CI')) { $sectionId = md5($task->getName()); - $endTime = round($endTime/1000); + $endTime = round($endTime / 1000); $this->output->writeln("\e[0Ksection_end:{$endTime}:{$sectionId}\r\e[0K"); - } else if ($this->output->isVeryVerbose()) { + } elseif ($this->output->isVeryVerbose()) { $this->output->writeln("done> {$task->getName()} $taskTime"); } if ($error) { diff --git a/src/Executor/Planner.php b/src/Executor/Planner.php index 15b1bfb0f..801b65e43 100644 --- a/src/Executor/Planner.php +++ b/src/Executor/Planner.php @@ -1,4 +1,6 @@ - * diff --git a/src/Executor/Server.php b/src/Executor/Server.php index 81d022bc8..022a5aabf 100644 --- a/src/Executor/Server.php +++ b/src/Executor/Server.php @@ -1,4 +1,6 @@ - * @@ -44,9 +46,8 @@ class Server public function __construct( OutputInterface $output, - Deployer $deployer - ) - { + Deployer $deployer, + ) { $this->output = $output; $this->deployer = $deployer; } @@ -65,7 +66,7 @@ function (ServerRequestInterface $request) { Deployer::printException($this->output, $exception); return new React\Http\Message\Response(500, ['Content-Type' => 'text/plain'], 'Master error: ' . $exception->getMessage()); } - } + }, ); $socket = new React\Socket\Server(0, $this->loop); $server->listen($socket); @@ -78,7 +79,7 @@ private function router(ServerRequestInterface $request): Response $path = $request->getUri()->getPath(); switch ($path) { case '/load': - ['host' => $host] = json_decode((string)$request->getBody(), true); + ['host' => $host] = json_decode((string) $request->getBody(), true); $host = $this->deployer->hosts->get($host); $config = json_encode($host->config()->persist()); @@ -86,7 +87,7 @@ private function router(ServerRequestInterface $request): Response return new Response(200, ['Content-Type' => 'application/json'], $config); case '/save': - ['host' => $host, 'config' => $config] = json_decode((string)$request->getBody(), true); + ['host' => $host, 'config' => $config] = json_decode((string) $request->getBody(), true); $host = $this->deployer->hosts->get($host); $host->config()->update($config); @@ -94,7 +95,7 @@ private function router(ServerRequestInterface $request): Response return new Response(200, ['Content-Type' => 'application/json'], 'true'); case '/proxy': - ['host' => $host, 'func' => $func, 'arguments' => $arguments] = json_decode((string)$request->getBody(), true); + ['host' => $host, 'func' => $func, 'arguments' => $arguments] = json_decode((string) $request->getBody(), true); Context::push(new Context($this->deployer->hosts->get($host))); $answer = call_user_func($func, ...$arguments); diff --git a/src/Executor/Worker.php b/src/Executor/Worker.php index 2aea644ff..264ab2239 100644 --- a/src/Executor/Worker.php +++ b/src/Executor/Worker.php @@ -1,4 +1,6 @@ - * diff --git a/src/Host/Host.php b/src/Host/Host.php index 125c3adcb..c203f7ebd 100644 --- a/src/Host/Host.php +++ b/src/Host/Host.php @@ -1,4 +1,6 @@ - * @@ -13,6 +15,7 @@ use Deployer\Exception\ConfigurationException; use Deployer\Exception\Exception; use Deployer\Task\Context; + use function Deployer\Support\colorize_host; use function Deployer\Support\parse_home_dir; diff --git a/src/Host/HostCollection.php b/src/Host/HostCollection.php index 26c512c08..37ad6ad4e 100644 --- a/src/Host/HostCollection.php +++ b/src/Host/HostCollection.php @@ -1,4 +1,6 @@ - * diff --git a/src/Host/Localhost.php b/src/Host/Localhost.php index 2da827cc3..c758d7e2a 100644 --- a/src/Host/Localhost.php +++ b/src/Host/Localhost.php @@ -1,4 +1,6 @@ - * diff --git a/src/Host/Range.php b/src/Host/Range.php index a51c931b6..db502104d 100644 --- a/src/Host/Range.php +++ b/src/Host/Range.php @@ -1,4 +1,6 @@ - * @@ -10,7 +12,7 @@ class Range { - const PATTERN = '/\[(.+?)\]/'; + public const PATTERN = '/\[(.+?)\]/'; public static function expand(array $hostnames): array { diff --git a/src/Importer/Importer.php b/src/Importer/Importer.php index 82ae6f760..595cb1802 100644 --- a/src/Importer/Importer.php +++ b/src/Importer/Importer.php @@ -1,4 +1,6 @@ - * @@ -16,6 +18,7 @@ use JsonSchema\SchemaStorage; use JsonSchema\Validator; use Symfony\Component\Yaml\Yaml; + use function array_filter; use function array_keys; use function Deployer\after; @@ -31,6 +34,7 @@ use function Deployer\task; use function Deployer\upload; use function substr; + use const ARRAY_FILTER_USE_KEY; class Importer @@ -69,7 +73,7 @@ public static function import($paths) } } }); - } else if (preg_match('/\.ya?ml$/i', $path)) { + } elseif (preg_match('/\.ya?ml$/i', $path)) { self::$recipeFilename = basename($path); self::$recipeSource = file_get_contents($path, true); $root = array_filter(Yaml::parse(self::$recipeSource), static function (string $key) { @@ -128,8 +132,7 @@ protected static function config(array $config) protected static function tasks(array $tasks) { $buildTask = function ($name, $steps) { - $body = function () { - }; + $body = function () {}; $task = task($name, $body); foreach ($steps as $step) { diff --git a/src/Logger/Handler/FileHandler.php b/src/Logger/Handler/FileHandler.php index ca8c0b031..e5eee6d37 100644 --- a/src/Logger/Handler/FileHandler.php +++ b/src/Logger/Handler/FileHandler.php @@ -1,4 +1,6 @@ - * diff --git a/src/Logger/Handler/HandlerInterface.php b/src/Logger/Handler/HandlerInterface.php index f0ab20271..9de250e6b 100644 --- a/src/Logger/Handler/HandlerInterface.php +++ b/src/Logger/Handler/HandlerInterface.php @@ -1,4 +1,6 @@ - * diff --git a/src/Logger/Handler/NullHandler.php b/src/Logger/Handler/NullHandler.php index 3a1df24de..339a587e6 100644 --- a/src/Logger/Handler/NullHandler.php +++ b/src/Logger/Handler/NullHandler.php @@ -1,4 +1,6 @@ - * @@ -10,7 +12,5 @@ class NullHandler implements HandlerInterface { - public function log(string $message): void - { - } + public function log(string $message): void {} } diff --git a/src/Logger/Logger.php b/src/Logger/Logger.php index f2eb3b00a..86567e9e0 100644 --- a/src/Logger/Logger.php +++ b/src/Logger/Logger.php @@ -1,4 +1,6 @@ - * diff --git a/src/Selector/Selector.php b/src/Selector/Selector.php index c9be60472..12d0d543e 100644 --- a/src/Selector/Selector.php +++ b/src/Selector/Selector.php @@ -1,4 +1,6 @@ - * @@ -10,6 +12,7 @@ use Deployer\Host\Host; use Deployer\Host\HostCollection; + use function Deployer\Support\array_all; class Selector @@ -56,7 +59,7 @@ public static function apply(?array $conditions, Host $host): bool foreach ($conditions as $hmm) { $ok = []; - foreach ($hmm as list($op, $var, $value)) { + foreach ($hmm as [$op, $var, $value]) { $ok[] = self::compare($op, $labels[$var] ?? null, $value); } if (count($ok) > 0 && array_all($ok, $isTrue)) { @@ -71,8 +74,8 @@ public static function apply(?array $conditions, Host $host): bool */ private static function compare(string $op, $a, ?string $b): bool { - $matchFunction = function($a, ?string $b) { - foreach ((array)$a as $item) { + $matchFunction = function ($a, ?string $b) { + foreach ((array) $a as $item) { if ($item === $b) { return true; } diff --git a/src/Support/ObjectProxy.php b/src/Support/ObjectProxy.php index 3c8f348e7..856a5e2fe 100644 --- a/src/Support/ObjectProxy.php +++ b/src/Support/ObjectProxy.php @@ -1,4 +1,6 @@ - * diff --git a/src/Support/Reporter.php b/src/Support/Reporter.php index 05e4bfa9b..1066d226e 100644 --- a/src/Support/Reporter.php +++ b/src/Support/Reporter.php @@ -1,4 +1,6 @@ - * @@ -22,24 +24,24 @@ public static function report(array $stats): void $body = json_encode($stats); $length = strlen($body); $php = new PhpProcess(<<start(); } } diff --git a/src/Support/helpers.php b/src/Support/helpers.php index 6378cc42b..7b4ca2daf 100644 --- a/src/Support/helpers.php +++ b/src/Support/helpers.php @@ -1,4 +1,6 @@ - * @@ -87,10 +89,10 @@ function env_stringify(array $array): string { return implode(' ', array_map( function ($key, $value) { - return sprintf("%s=%s", $key, escapeshellarg((string)$value)); + return sprintf("%s=%s", $key, escapeshellarg((string) $value)); }, array_keys($array), - $array + $array, )); } @@ -255,5 +257,5 @@ function colorize_host(string $alias): string function escape_shell_argument(string $argument): string { - return "'".str_replace("'", "'\\''", $argument)."'"; + return "'" . str_replace("'", "'\\''", $argument) . "'"; } diff --git a/src/Task/Context.php b/src/Task/Context.php index c0f0f8d88..e5d33ab31 100644 --- a/src/Task/Context.php +++ b/src/Task/Context.php @@ -1,4 +1,6 @@ - * diff --git a/src/Task/GroupTask.php b/src/Task/GroupTask.php index a43a77eb2..d98a9f751 100644 --- a/src/Task/GroupTask.php +++ b/src/Task/GroupTask.php @@ -1,4 +1,6 @@ - * diff --git a/src/Task/ScriptManager.php b/src/Task/ScriptManager.php index 7757624ea..29e6ef469 100644 --- a/src/Task/ScriptManager.php +++ b/src/Task/ScriptManager.php @@ -1,4 +1,6 @@ - * @@ -9,6 +11,7 @@ namespace Deployer\Task; use Deployer\Exception\Exception; + use function Deployer\Support\array_flatten; class ScriptManager diff --git a/src/Task/Task.php b/src/Task/Task.php index 3a56e9970..e651c80f8 100644 --- a/src/Task/Task.php +++ b/src/Task/Task.php @@ -1,4 +1,6 @@ - * diff --git a/src/Task/TaskCollection.php b/src/Task/TaskCollection.php index eb3c3e0b0..aefe79cef 100644 --- a/src/Task/TaskCollection.php +++ b/src/Task/TaskCollection.php @@ -1,4 +1,6 @@ - * diff --git a/src/Utility/Httpie.php b/src/Utility/Httpie.php index 30a4b52a4..6d487437d 100644 --- a/src/Utility/Httpie.php +++ b/src/Utility/Httpie.php @@ -1,4 +1,6 @@ - * @@ -42,14 +44,14 @@ public function __construct() if (!extension_loaded('curl')) { throw new \Exception( "Please, install curl extension.\n" . - "https://php.net/curl.installation" + "https://php.net/curl.installation", ); } } public static function get(string $url): Httpie { - $http = new self; + $http = new self(); $http->method = 'GET'; $http->url = $url; return $http; @@ -57,24 +59,24 @@ public static function get(string $url): Httpie public static function post(string $url): Httpie { - $http = new self; + $http = new self(); $http->method = 'POST'; $http->url = $url; return $http; } - + public static function patch(string $url): Httpie { - $http = new self; + $http = new self(); $http->method = 'PATCH'; $http->url = $url; return $http; } - + public static function put(string $url): Httpie { - $http = new self; + $http = new self(); $http->method = 'PUT'; $http->url = $url; return $http; @@ -82,12 +84,12 @@ public static function put(string $url): Httpie public static function delete(string $url): Httpie { - $http = new self; + $http = new self(); $http->method = 'DELETE'; $http->url = $url; return $http; } - + public function query(array $params): Httpie { $http = clone $this; @@ -154,7 +156,7 @@ public function nothrow(bool $on = true): Httpie public function send(?array &$info = null): string { - if($this->url === '') { + if ($this->url === '') { throw new \RuntimeException('URL must not be empty to Httpie::send()'); } $ch = curl_init($this->url); @@ -200,7 +202,7 @@ public function getJson() if (json_last_error() !== JSON_ERROR_NONE) { throw new HttpieException( 'JSON Error: ' . json_last_error_msg() . '\n' . - 'Response: ' . $result + 'Response: ' . $result, ); } return $response; diff --git a/src/Utility/Rsync.php b/src/Utility/Rsync.php index 990242ef7..a1f85249c 100644 --- a/src/Utility/Rsync.php +++ b/src/Utility/Rsync.php @@ -1,4 +1,6 @@ - * @@ -16,6 +18,7 @@ use Symfony\Component\Console\Output\OutputInterface; use Symfony\Component\Process\Exception\ProcessFailedException; use Symfony\Component\Process\Process; + use function Deployer\writeln; class Rsync @@ -49,7 +52,7 @@ public function call(Host $host, $source, string $destination, array $config = [ 'options' => [], 'flags' => '-azP', 'progress_bar' => true, - 'display_stats' => false + 'display_stats' => false, ]; $config = array_merge($defaults, $config); @@ -146,7 +149,7 @@ function (string $value) { $commandString, $process->getExitCode(), $process->getOutput(), - $process->getErrorOutput() + $process->getErrorOutput(), ); } finally { if ($progressBar) { diff --git a/src/functions.php b/src/functions.php index 651ad5423..0a286a2e2 100644 --- a/src/functions.php +++ b/src/functions.php @@ -1,4 +1,6 @@ - * @@ -29,6 +31,7 @@ use Symfony\Component\Console\Question\ChoiceQuestion; use Symfony\Component\Console\Question\ConfirmationQuestion; use Symfony\Component\Console\Question\Question; + use function Deployer\Support\array_merge_alternate; use function Deployer\Support\env_stringify; use function Deployer\Support\is_closure; @@ -297,7 +300,7 @@ function fail(string $task, $do) function option(string $name, $shortcut = null, ?int $mode = null, string $description = '', $default = null): void { Deployer::get()->inputDefinition->addOption( - new InputOption($name, $shortcut, $mode, $description, $default) + new InputOption($name, $shortcut, $mode, $description, $default), ); } @@ -823,7 +826,7 @@ function askHiddenResponse(string $message): string } if (Deployer::isWorker()) { - return (string)Deployer::proxyCallToMaster(currentHost(), __FUNCTION__, ...func_get_args()); + return (string) Deployer::proxyCallToMaster(currentHost(), __FUNCTION__, ...func_get_args()); } /** @var QuestionHelper */ @@ -837,7 +840,7 @@ function askHiddenResponse(string $message): string $question->setHidden(true); $question->setHiddenFallback(false); - return (string)$helper->ask(input(), output(), $question); + return (string) $helper->ask(input(), output(), $question); } function input(): InputInterface @@ -904,7 +907,7 @@ function remoteEnv(): array $vars = []; $data = run('env'); foreach (explode("\n", $data) as $line) { - list($name, $value) = explode('=', $line, 2); + [$name, $value] = explode('=', $line, 2); $vars[$name] = $value; } return $vars; diff --git a/tests/bootstrap.php b/tests/bootstrap.php index 6835938bd..b5191cef6 100644 --- a/tests/bootstrap.php +++ b/tests/bootstrap.php @@ -1,4 +1,5 @@ excludeDirectory('/project/tests'); $outputCoverage = new CodeCoverage( - (new Selector)->forLineCoverage($filter), - $filter + (new Selector())->forLineCoverage($filter), + $filter, ); $coverageReports = glob("/tmp/ccov/*.php"); @@ -37,4 +39,3 @@ $cloverReport->process($outputCoverage, $outputFile); echo "Clover report file written to {$outputFile}\n"; - diff --git a/tests/e2e/coverage/coverage-start.php b/tests/e2e/coverage/coverage-start.php index 538669856..98448acfb 100644 --- a/tests/e2e/coverage/coverage-start.php +++ b/tests/e2e/coverage/coverage-start.php @@ -1,4 +1,6 @@ -forLineCoverage($filter), - $filter + (new Selector())->forLineCoverage($filter), + $filter, ); $outputDir = '/tmp/ccov'; @@ -34,13 +36,15 @@ /** @var string|null */ private $coverageName; - public function __construct(CodeCoverage $coverage, PHPReport $report, string $outputDir) { + public function __construct(CodeCoverage $coverage, PHPReport $report, string $outputDir) + { $this->coverage = $coverage; $this->report = $report; $this->outputDir = $outputDir; } - public function start():void { + public function start(): void + { register_shutdown_function([$this, 'stop']); $coverageName = uniqid('coverage_'); @@ -48,13 +52,11 @@ public function start():void { $this->coverage->start($this->coverageName); } - public function stop():void { + public function stop(): void + { $this->coverage->stop(); $outputFile = $this->outputDir . "/{$this->coverageName}.php"; $this->report->process($this->coverage, $outputFile); } })->start(); - - - diff --git a/tests/e2e/recipe/functions.php b/tests/e2e/recipe/functions.php index e3eaa3c43..642690b6a 100644 --- a/tests/e2e/recipe/functions.php +++ b/tests/e2e/recipe/functions.php @@ -1,4 +1,6 @@ - 1 ] ); + run("php -r 'while(true){}'", [ 'timeout' => 1 ]); } catch (TimeoutException $e) { $ps = run("if ps aux | grep '[p]hp -r while(true){}'; then echo still running; else echo +timeout; fi"); if ($ps != '+timeout') { @@ -17,4 +18,3 @@ } } }); - diff --git a/tests/joy/HostDefaultConfigTest.php b/tests/joy/HostDefaultConfigTest.php index 3cfdacc33..302b1522f 100644 --- a/tests/joy/HostDefaultConfigTest.php +++ b/tests/joy/HostDefaultConfigTest.php @@ -1,4 +1,6 @@ - * @@ -13,15 +15,15 @@ class HostDefaultConfigTest extends JoyTest protected function recipe(): string { return <<<'PHP' -getPort(); - writeln(empty($port) ? 'empty' : "port:$port"); -}); -PHP; + task('test', function () { + $port = currentHost()->getPort(); + writeln(empty($port) ? 'empty' : "port:$port"); + }); + PHP; } public function testOnFunc() diff --git a/tests/joy/JoyTest.php b/tests/joy/JoyTest.php index 5d95df15c..d9ef5d0c3 100644 --- a/tests/joy/JoyTest.php +++ b/tests/joy/JoyTest.php @@ -12,6 +12,7 @@ use Symfony\Component\Console\Application; use Symfony\Component\Console\Output\OutputInterface; use Symfony\Component\Console\Tester\ApplicationTester; + use const __TEMP_DIR__; abstract class JoyTest extends TestCase @@ -65,7 +66,7 @@ protected function dep(string $task, array $args = []): int $task, 'selector' => 'all', '--file' => $recipe, - '--limit' => 1 + '--limit' => 1, ], $args), [ 'verbosity' => OutputInterface::VERBOSITY_VERBOSE, 'interactive' => false, diff --git a/tests/joy/OnFuncTest.php b/tests/joy/OnFuncTest.php index f2d6bb1f7..1fc6142e3 100644 --- a/tests/joy/OnFuncTest.php +++ b/tests/joy/OnFuncTest.php @@ -13,26 +13,26 @@ class OnFuncTest extends JoyTest protected function recipe(): string { return <<<'PHP' -once(); -PHP; + once(); + PHP; } public function testOnFunc() diff --git a/tests/legacy/AbstractTest.php b/tests/legacy/AbstractTest.php index bc8a08590..803b93108 100644 --- a/tests/legacy/AbstractTest.php +++ b/tests/legacy/AbstractTest.php @@ -64,7 +64,7 @@ protected function dep(string $recipe, string $task) $task, 'selector' => 'all', '-f' => $recipe, - '-l' => 1 + '-l' => 1, ], [ 'verbosity' => Output::VERBOSITY_VERBOSE, 'interactive' => false, diff --git a/tests/legacy/CurrentPathTest.php b/tests/legacy/CurrentPathTest.php index 96b7c49e4..55259c08e 100644 --- a/tests/legacy/CurrentPathTest.php +++ b/tests/legacy/CurrentPathTest.php @@ -11,7 +11,7 @@ class CurrentPathTest extends AbstractTest { - const RECIPE = __DIR__ . '/recipe/deploy.php'; + public const RECIPE = __DIR__ . '/recipe/deploy.php'; public function testDeployWithDifferentCurrentPath() { diff --git a/tests/legacy/DeployTest.php b/tests/legacy/DeployTest.php index e62079d22..33bed7e5d 100644 --- a/tests/legacy/DeployTest.php +++ b/tests/legacy/DeployTest.php @@ -11,7 +11,7 @@ class DeployTest extends AbstractTest { - const RECIPE = __DIR__ . '/recipe/deploy.php'; + public const RECIPE = __DIR__ . '/recipe/deploy.php'; public function testDeploy() { diff --git a/tests/legacy/EnvTest.php b/tests/legacy/EnvTest.php index 27b4c0552..797577d6d 100644 --- a/tests/legacy/EnvTest.php +++ b/tests/legacy/EnvTest.php @@ -9,7 +9,7 @@ class EnvTest extends AbstractTest { - const RECIPE = __DIR__ . '/recipe/env.php'; + public const RECIPE = __DIR__ . '/recipe/env.php'; public function testOnce() { diff --git a/tests/legacy/OncePerNodeTest.php b/tests/legacy/OncePerNodeTest.php index b42c88229..1e78d3393 100644 --- a/tests/legacy/OncePerNodeTest.php +++ b/tests/legacy/OncePerNodeTest.php @@ -9,7 +9,7 @@ class OncePerNodeTest extends AbstractTest { - const RECIPE = __DIR__ . '/recipe/once_per_node.php'; + public const RECIPE = __DIR__ . '/recipe/once_per_node.php'; public function testOnce() { diff --git a/tests/legacy/OnceTest.php b/tests/legacy/OnceTest.php index 540a21a36..f50f539ea 100644 --- a/tests/legacy/OnceTest.php +++ b/tests/legacy/OnceTest.php @@ -9,7 +9,7 @@ class OnceTest extends AbstractTest { - const RECIPE = __DIR__ . '/recipe/once.php'; + public const RECIPE = __DIR__ . '/recipe/once.php'; public function testOnce() { diff --git a/tests/legacy/ParallelTest.php b/tests/legacy/ParallelTest.php index 4f84f66c5..8938ef8f8 100644 --- a/tests/legacy/ParallelTest.php +++ b/tests/legacy/ParallelTest.php @@ -11,7 +11,7 @@ class ParallelTest extends AbstractTest { - const RECIPE = __DIR__ . '/recipe/parallel.php'; + public const RECIPE = __DIR__ . '/recipe/parallel.php'; public static function setUpBeforeClass(): void { @@ -31,7 +31,7 @@ public function testWorker() $this->tester->run([ 'echo', '-f' => self::RECIPE, - 'selector' => 'all' + 'selector' => 'all', ], [ 'verbosity' => Output::VERBOSITY_NORMAL, ]); @@ -69,7 +69,7 @@ public function testOption() [ 'verbosity' => Output::VERBOSITY_DEBUG, 'interactive' => false, - ] + ], ); $display = $this->tester->getDisplay(); @@ -84,7 +84,7 @@ public function testCachedHostConfig() $this->tester->run([ 'cache_config_test', '-f' => self::RECIPE, - 'selector' => 'all' + 'selector' => 'all', ], [ 'verbosity' => Output::VERBOSITY_NORMAL, ]); @@ -101,7 +101,7 @@ public function testHostConfigFromCallback() $this->tester->run([ 'host_config_from_callback', '-f' => self::RECIPE, - 'selector' => 'all' + 'selector' => 'all', ], [ 'verbosity' => Output::VERBOSITY_NORMAL, ]); diff --git a/tests/legacy/SelectTest.php b/tests/legacy/SelectTest.php index ccb6b43b0..f1ba9485d 100644 --- a/tests/legacy/SelectTest.php +++ b/tests/legacy/SelectTest.php @@ -11,7 +11,7 @@ class SelectTest extends AbstractTest { - const RECIPE = __DIR__ . '/recipe/select.php'; + public const RECIPE = __DIR__ . '/recipe/select.php'; public function testSelect() { @@ -19,7 +19,7 @@ public function testSelect() $this->tester->run([ 'test', '-f' => self::RECIPE, - 'selector' => 'prod' + 'selector' => 'prod', ], [ 'verbosity' => Output::VERBOSITY_DEBUG, ]); diff --git a/tests/legacy/UpdateCodeTest.php b/tests/legacy/UpdateCodeTest.php index cd2018d5b..7798c4d26 100644 --- a/tests/legacy/UpdateCodeTest.php +++ b/tests/legacy/UpdateCodeTest.php @@ -11,7 +11,7 @@ class UpdateCodeTest extends AbstractTest { - const RECIPE = __DIR__ . '/recipe/update_code.php'; + public const RECIPE = __DIR__ . '/recipe/update_code.php'; public function testDeployWithDifferentUpdateCodeTask() { diff --git a/tests/legacy/YamlTest.php b/tests/legacy/YamlTest.php index f4854d079..d1895453a 100644 --- a/tests/legacy/YamlTest.php +++ b/tests/legacy/YamlTest.php @@ -11,7 +11,7 @@ class YamlTest extends AbstractTest { - const RECIPE = __DIR__ . '/recipe/deploy.yaml'; + public const RECIPE = __DIR__ . '/recipe/deploy.yaml'; public function testDeploy() { @@ -20,7 +20,7 @@ public function testDeploy() $this->tester->run([ 'deploy', 'selector' => 'all', - '-f' => self::RECIPE + '-f' => self::RECIPE, ], [ 'verbosity' => Output::VERBOSITY_VERBOSE, 'interactive' => false, diff --git a/tests/legacy/recipe/deploy.php b/tests/legacy/recipe/deploy.php index 23d4907ae..170056097 100644 --- a/tests/legacy/recipe/deploy.php +++ b/tests/legacy/recipe/deploy.php @@ -13,7 +13,7 @@ ]); set('shared_files', [ '.env', - 'config/test.yaml' + 'config/test.yaml', ]); set('keep_releases', 3); set('http_user', false); @@ -23,7 +23,7 @@ task('deploy', [ 'deploy:prepare', 'deploy:vendors', - 'deploy:publish' + 'deploy:publish', ]); // Mock vendors installation to speed up tests. @@ -37,7 +37,7 @@ task('deploy:fail', [ 'deploy:prepare', 'fail', - 'deploy:publish' + 'deploy:publish', ]); task('fail', function () { diff --git a/tests/legacy/recipe/parallel.php b/tests/legacy/recipe/parallel.php index f95c125e8..3bb94b864 100644 --- a/tests/legacy/recipe/parallel.php +++ b/tests/legacy/recipe/parallel.php @@ -44,6 +44,5 @@ set('host_level_callback_config', 'from global'); task('host_config_from_callback', function () { - writeln('config value is {{host_level_callback_config}}'); + writeln('config value is {{host_level_callback_config}}'); }); - diff --git a/tests/src/Command/BlackjackCommandTest.php b/tests/src/Command/BlackjackCommandTest.php index 6faa6331a..c4f941ed8 100644 --- a/tests/src/Command/BlackjackCommandTest.php +++ b/tests/src/Command/BlackjackCommandTest.php @@ -5,7 +5,6 @@ class BlackjackCommandTest extends TestCase { - public function testHandValue() { self::assertEquals(3, BlackjackCommand::handValue([['3']])); diff --git a/tests/src/Component/Pimple/PimpleTest.php b/tests/src/Component/Pimple/PimpleTest.php index fb6eed1da..8a30435b6 100644 --- a/tests/src/Component/Pimple/PimpleTest.php +++ b/tests/src/Component/Pimple/PimpleTest.php @@ -1,4 +1,6 @@ - * * For the full copyright and license information, please view the LICENSE @@ -14,6 +16,7 @@ use PHPUnit\Framework\TestCase; use ReflectionProperty; use RuntimeException; + use function extension_loaded; class PimpleTest extends TestCase @@ -263,8 +266,7 @@ public function testExtendValidatesKeyIsPresent() $this->expectExceptionMessage('Identifier "foo" is not defined.'); $pimple = new Container(); - $pimple->extend('foo', function () { - }); + $pimple->extend('foo', function () {}); } /** @@ -276,8 +278,7 @@ public function testLegacyExtendValidatesKeyIsPresent() $this->expectExceptionMessage('Identifier "foo" is not defined.'); $pimple = new Container(); - $pimple->extend('foo', function () { - }); + $pimple->extend('foo', function () {}); } public function testKeys() @@ -359,8 +360,7 @@ public function testExtendFailsForKeysNotContainingServiceDefinitions($service) $pimple = new Container(); $pimple['foo'] = $service; - $pimple->extend('foo', function () { - }); + $pimple->extend('foo', function () {}); } /** @@ -374,8 +374,7 @@ public function testLegacyExtendFailsForKeysNotContainingServiceDefinitions($ser $pimple = new Container(); $pimple['foo'] = $service; - $pimple->extend('foo', function () { - }); + $pimple->extend('foo', function () {}); } /** @@ -403,8 +402,7 @@ public function testExtendFailsForInvalidServiceDefinitions($service) { $this->expectException(\TypeError::class); $pimple = new Container(); - $pimple['foo'] = function () { - }; + $pimple['foo'] = function () {}; $pimple->extend('foo', $service); } @@ -416,8 +414,7 @@ public function testLegacyExtendFailsForInvalidServiceDefinitions($service) { $this->expectException(\TypeError::class); $pimple = new Container(); - $pimple['foo'] = function () { - }; + $pimple['foo'] = function () {}; $pimple->extend('foo', $service); } @@ -432,8 +429,7 @@ public function testExtendFailsIfFrozenServiceIsNonInvokable() }; $foo = $pimple['foo']; - $pimple->extend('foo', function () { - }); + $pimple->extend('foo', function () {}); } public function testExtendFailsIfFrozenServiceIsInvokable() @@ -447,8 +443,7 @@ public function testExtendFailsIfFrozenServiceIsInvokable() }; $foo = $pimple['foo']; - $pimple->extend('foo', function () { - }); + $pimple->extend('foo', function () {}); } /** @@ -588,9 +583,7 @@ public function __invoke($value = null) class NonInvokable { - public function __call($a, $b) - { - } + public function __call($a, $b) {} } class Service diff --git a/tests/src/Component/Ssh/IOArgumentsTest.php b/tests/src/Component/Ssh/IOArgumentsTest.php index 4a722cde1..61d039e61 100644 --- a/tests/src/Component/Ssh/IOArgumentsTest.php +++ b/tests/src/Component/Ssh/IOArgumentsTest.php @@ -20,15 +20,15 @@ public function testCollect() new InputOption('plan', null, InputOption::VALUE_NONE, 'Show execution plan'), new InputOption('start-from', null, InputOption::VALUE_REQUIRED, 'Start execution from this task'), new InputOption('log', null, InputOption::VALUE_REQUIRED, 'Write log to a file'), - new InputOption('profile', null, InputOption::VALUE_REQUIRED, 'Write profile to a file',), - new InputOption('ansi', null, InputOption::VALUE_OPTIONAL, 'Force ANSI output',), + new InputOption('profile', null, InputOption::VALUE_REQUIRED, 'Write profile to a file', ), + new InputOption('ansi', null, InputOption::VALUE_OPTIONAL, 'Force ANSI output', ), ]); $args = IOArguments::collect( new ArgvInput(['deploy', '-o', 'env=prod', '--ansi', '-l1'], $definition), - new ConsoleOutput(OutputInterface::VERBOSITY_DEBUG, false) + new ConsoleOutput(OutputInterface::VERBOSITY_DEBUG, false), ); - self::assertEquals(['--option' ,'env=prod', '--limit', '1', '-vvv'], $args); + self::assertEquals(['--option','env=prod', '--limit', '1', '-vvv'], $args); } } diff --git a/tests/src/FunctionsTest.php b/tests/src/FunctionsTest.php index b7431ed6e..4d1a06cab 100644 --- a/tests/src/FunctionsTest.php +++ b/tests/src/FunctionsTest.php @@ -17,6 +17,7 @@ use Symfony\Component\Console\Application; use Symfony\Component\Console\Input\Input; use Symfony\Component\Console\Output\Output; + use function Deployer\localhost; class FunctionsTest extends TestCase @@ -69,8 +70,7 @@ public function testLocalhost() public function testTask() { - task('task', function () { - }); + task('task', function () {}); $task = $this->deployer->tasks->get('task'); self::assertInstanceOf(Task::class, $task); @@ -158,7 +158,7 @@ public function testWithinRestoresWorkingPathInCaseOfException() public function testWithinReturningValue() { $output = within('/foo', function () { - return 'bar'; + return 'bar'; }); self::assertEquals('bar', $output); diff --git a/tests/src/Importer/ImporterTest.php b/tests/src/Importer/ImporterTest.php index 1f03602db..890471411 100644 --- a/tests/src/Importer/ImporterTest.php +++ b/tests/src/Importer/ImporterTest.php @@ -1,4 +1,5 @@ hosts->has('production')); diff --git a/tests/src/Support/HelpersTest.php b/tests/src/Support/HelpersTest.php index 0dc15d97e..dea76b150 100644 --- a/tests/src/Support/HelpersTest.php +++ b/tests/src/Support/HelpersTest.php @@ -38,7 +38,7 @@ public function testArrayMergeAlternate() ]); $config = array_merge_alternate($config, [ - 'extra' + 'extra', ]); self::assertEquals([ diff --git a/tests/src/Task/TaskTest.php b/tests/src/Task/TaskTest.php index 57ce09df6..df8d47a52 100644 --- a/tests/src/Task/TaskTest.php +++ b/tests/src/Task/TaskTest.php @@ -9,6 +9,7 @@ use Deployer\Host\Host; use PHPUnit\Framework\TestCase; + use function Deployer\invoke; use function Deployer\task;
The requested URL was not found on this server.