diff --git a/.phive/phars.xml b/.phive/phars.xml index 8bad0db..7a060a0 100644 --- a/.phive/phars.xml +++ b/.phive/phars.xml @@ -4,4 +4,5 @@ + diff --git a/.php-cs-fixer.dist.php b/.php-cs-fixer.dist.php new file mode 100644 index 0000000..29895a6 --- /dev/null +++ b/.php-cs-fixer.dist.php @@ -0,0 +1,12 @@ +in(__DIR__ . '/src') + ->in(__DIR__ . '/test'); + +return (new \PhpCsFixer\Config()) + ->setCacheFile('var/cache/php-cs-fixer') + ->setFinder($finder) + ->setRules(['@PER-CS' => true]); diff --git a/composer.json b/composer.json index fd16556..7158d51 100644 --- a/composer.json +++ b/composer.json @@ -73,15 +73,15 @@ } }, "scripts": { - "post-install-cmd": "phive --no-progress install --force-accept-unsigned --trust-gpg-keys C00543248C87FB13,4AA394086372C20A,CF1A108D0E7AE720,51C67305FFC2E5C0", + "post-install-cmd": "phive --no-progress install --force-accept-unsigned --trust-gpg-keys C00543248C87FB13,4AA394086372C20A,CF1A108D0E7AE720,51C67305FFC2E5C0,E82B2FB314E9906E", "analyse": [ "@analyse:phplint", "@analyse:phpstan", - "@analyse:phpcs", + "@analyse:phpcsfixer", "@analyse:compatibilitycheck" ], "analyse:compatibilitycheck": "./vendor/bin/phpcs --standard=./phpcs.compatibilitycheck.xml", - "analyse:phpcs": "./vendor/bin/phpcs", + "analyse:phpcsfixer": "./tools/php-cs-fixer check --diff --show-progress=dots", "analyse:phplint": "./tools/phplint", "analyse:phpstan": "./tools/phpstan analyse", "cs-fix": [ @@ -89,10 +89,8 @@ ], "cs-fix:phpcbf": "./vendor/bin/phpcbf", "report": [ - "@report:phpcs", "@report:phpstan" ], - "report:phpcs": "./vendor/bin/phpcs || exit 0", "report:phpstan": "./tools/phpstan analyse --no-progress --no-ansi --no-interaction --error-format=checkstyle > ./var/log/phpstan-report.xml || exit 0", "test": [ "@test:phpunit" diff --git a/composer.lock b/composer.lock index 61762e9..9653a75 100644 --- a/composer.lock +++ b/composer.lock @@ -8,16 +8,16 @@ "packages": [ { "name": "symfony/filesystem", - "version": "v7.1.1", + "version": "v7.1.2", "source": { "type": "git", "url": "https://github.com/symfony/filesystem.git", - "reference": "802e87002f919296c9f606457d9fa327a0b3d6b2" + "reference": "92a91985250c251de9b947a14bb2c9390b1a562c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/filesystem/zipball/802e87002f919296c9f606457d9fa327a0b3d6b2", - "reference": "802e87002f919296c9f606457d9fa327a0b3d6b2", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/92a91985250c251de9b947a14bb2c9390b1a562c", + "reference": "92a91985250c251de9b947a14bb2c9390b1a562c", "shasum": "" }, "require": { @@ -54,7 +54,7 @@ "description": "Provides basic utilities for the filesystem", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/filesystem/tree/v7.1.1" + "source": "https://github.com/symfony/filesystem/tree/v7.1.2" }, "funding": [ { @@ -70,20 +70,20 @@ "type": "tidelift" } ], - "time": "2024-05-31T14:57:53+00:00" + "time": "2024-06-28T10:03:55+00:00" }, { "name": "symfony/polyfill-ctype", - "version": "v1.29.0", + "version": "v1.30.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-ctype.git", - "reference": "ef4d7e442ca910c4764bce785146269b30cb5fc4" + "reference": "0424dff1c58f028c451efff2045f5d92410bd540" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/ef4d7e442ca910c4764bce785146269b30cb5fc4", - "reference": "ef4d7e442ca910c4764bce785146269b30cb5fc4", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/0424dff1c58f028c451efff2045f5d92410bd540", + "reference": "0424dff1c58f028c451efff2045f5d92410bd540", "shasum": "" }, "require": { @@ -133,7 +133,7 @@ "portable" ], "support": { - "source": "https://github.com/symfony/polyfill-ctype/tree/v1.29.0" + "source": "https://github.com/symfony/polyfill-ctype/tree/v1.30.0" }, "funding": [ { @@ -149,20 +149,20 @@ "type": "tidelift" } ], - "time": "2024-01-29T20:11:03+00:00" + "time": "2024-05-31T15:07:36+00:00" }, { "name": "symfony/polyfill-mbstring", - "version": "v1.29.0", + "version": "v1.30.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "9773676c8a1bb1f8d4340a62efe641cf76eda7ec" + "reference": "fd22ab50000ef01661e2a31d850ebaa297f8e03c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/9773676c8a1bb1f8d4340a62efe641cf76eda7ec", - "reference": "9773676c8a1bb1f8d4340a62efe641cf76eda7ec", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/fd22ab50000ef01661e2a31d850ebaa297f8e03c", + "reference": "fd22ab50000ef01661e2a31d850ebaa297f8e03c", "shasum": "" }, "require": { @@ -213,7 +213,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.29.0" + "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.30.0" }, "funding": [ { @@ -229,7 +229,7 @@ "type": "tidelift" } ], - "time": "2024-01-29T20:11:03+00:00" + "time": "2024-06-19T12:30:46+00:00" } ], "packages-dev": [ @@ -1847,16 +1847,16 @@ }, { "name": "phpunit/php-code-coverage", - "version": "10.1.14", + "version": "10.1.15", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "e3f51450ebffe8e0efdf7346ae966a656f7d5e5b" + "reference": "5da8b1728acd1e6ffdf2ff32ffbdfd04307f26ae" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/e3f51450ebffe8e0efdf7346ae966a656f7d5e5b", - "reference": "e3f51450ebffe8e0efdf7346ae966a656f7d5e5b", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/5da8b1728acd1e6ffdf2ff32ffbdfd04307f26ae", + "reference": "5da8b1728acd1e6ffdf2ff32ffbdfd04307f26ae", "shasum": "" }, "require": { @@ -1913,7 +1913,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues", "security": "https://github.com/sebastianbergmann/php-code-coverage/security/policy", - "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/10.1.14" + "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/10.1.15" }, "funding": [ { @@ -1921,7 +1921,7 @@ "type": "github" } ], - "time": "2024-03-12T15:33:41+00:00" + "time": "2024-06-29T08:25:15+00:00" }, { "name": "phpunit/php-file-iterator", @@ -2168,16 +2168,16 @@ }, { "name": "phpunit/phpunit", - "version": "10.5.20", + "version": "10.5.24", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "547d314dc24ec1e177720d45c6263fb226cc2ae3" + "reference": "5f124e3e3e561006047b532fd0431bf5bb6b9015" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/547d314dc24ec1e177720d45c6263fb226cc2ae3", - "reference": "547d314dc24ec1e177720d45c6263fb226cc2ae3", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/5f124e3e3e561006047b532fd0431bf5bb6b9015", + "reference": "5f124e3e3e561006047b532fd0431bf5bb6b9015", "shasum": "" }, "require": { @@ -2249,7 +2249,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/phpunit/issues", "security": "https://github.com/sebastianbergmann/phpunit/security/policy", - "source": "https://github.com/sebastianbergmann/phpunit/tree/10.5.20" + "source": "https://github.com/sebastianbergmann/phpunit/tree/10.5.24" }, "funding": [ { @@ -2265,7 +2265,7 @@ "type": "tidelift" } ], - "time": "2024-04-24T06:32:35+00:00" + "time": "2024-06-20T13:09:54+00:00" }, { "name": "psr/container", @@ -2449,12 +2449,12 @@ "source": { "type": "git", "url": "https://github.com/Roave/SecurityAdvisories.git", - "reference": "2e530fa2b00d046ceb5660f3139af583170ea7f9" + "reference": "27714b56f04815b654c3805502ab77207505ac19" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Roave/SecurityAdvisories/zipball/2e530fa2b00d046ceb5660f3139af583170ea7f9", - "reference": "2e530fa2b00d046ceb5660f3139af583170ea7f9", + "url": "https://api.github.com/repos/Roave/SecurityAdvisories/zipball/27714b56f04815b654c3805502ab77207505ac19", + "reference": "27714b56f04815b654c3805502ab77207505ac19", "shasum": "" }, "conflict": { @@ -2462,8 +2462,8 @@ "admidio/admidio": "<4.2.13", "adodb/adodb-php": "<=5.20.20|>=5.21,<=5.21.3", "aheinze/cockpit": "<2.2", - "aimeos/ai-client-html": ">=2020.04.1,<2020.10.27|>=2021.04.1,<2021.10.21|>=2022.04.1,<2022.10.12|>=2023.04.1,<2023.10.14|>=2024.04.1,<2024.04.4", - "aimeos/aimeos-core": "<2024.04.7", + "aimeos/ai-client-html": ">=2020.04.1,<2020.10.27|>=2021.04.1,<2021.10.22|>=2022.04.1,<2022.10.13|>=2023.04.1,<2023.10.15|>=2024.04.1,<2024.04.7", + "aimeos/aimeos-core": ">=2022.04.1,<2022.10.17|>=2023.04.1,<2023.10.17|>=2024.04.1,<2024.04.7", "aimeos/aimeos-typo3": "<19.10.12|>=20,<20.10.5", "airesvsg/acf-to-rest-api": "<=3.1", "akaunting/akaunting": "<2.1.13", @@ -2680,7 +2680,7 @@ "gos/web-socket-bundle": "<1.10.4|>=2,<2.6.1|>=3,<3.3", "gree/jose": "<2.2.1", "gregwar/rst": "<1.0.3", - "grumpydictator/firefly-iii": "<6.1.7", + "grumpydictator/firefly-iii": "<6.1.17", "gugoan/economizzer": "<=0.9.0.0-beta1", "guzzlehttp/guzzle": "<6.5.8|>=7,<7.4.5", "guzzlehttp/psr7": "<1.9.1|>=2,<2.4.5", @@ -2737,6 +2737,7 @@ "jsdecena/laracom": "<2.0.9", "jsmitty12/phpwhois": "<5.1", "juzaweb/cms": "<=3.4", + "jweiland/events2": "<8.3.8|>=9,<9.0.6", "kazist/phpwhois": "<=4.2.6", "kelvinmo/simplexrd": "<3.1.1", "kevinpapst/kimai2": "<1.16.7", @@ -2807,7 +2808,7 @@ "mojo42/jirafeau": "<4.4", "mongodb/mongodb": ">=1,<1.9.2", "monolog/monolog": ">=1.8,<1.12", - "moodle/moodle": "<4.3.4", + "moodle/moodle": "<4.3.5|>=4.4.0.0-beta,<4.4.1", "mos/cimage": "<0.7.19", "movim/moxl": ">=0.8,<=0.10", "movingbytes/social-network": "<=1.2.1", @@ -2844,12 +2845,12 @@ "october/cms": "<1.0.469|==1.0.469|==1.0.471|==1.1.1", "october/october": "<=3.4.4", "october/rain": "<1.0.472|>=1.1,<1.1.2", - "october/system": "<1.0.476|>=1.1,<1.1.12|>=2,<2.2.34|>=3,<3.5.2", + "october/system": "<1.0.476|>=1.1,<1.1.12|>=2,<2.2.34|>=3,<3.5.15", "omeka/omeka-s": "<4.0.3", "onelogin/php-saml": "<2.10.4", "oneup/uploader-bundle": ">=1,<1.9.3|>=2,<2.1.5", "open-web-analytics/open-web-analytics": "<1.7.4", - "opencart/opencart": "<=3.0.3.7|>=4,<4.0.2.3-dev", + "opencart/opencart": "<=3.0.3.9|>=4", "openid/php-openid": "<2.3", "openmage/magento-lts": "<20.5", "opensolutions/vimbadmin": "<=3.0.15", @@ -3000,7 +3001,7 @@ "slim/slim": "<2.6", "slub/slub-events": "<3.0.3", "smarty/smarty": "<4.5.3|>=5,<5.1.1", - "snipe/snipe-it": "<=6.2.2", + "snipe/snipe-it": "<6.4.2", "socalnick/scn-social-auth": "<1.15.2", "socialiteproviders/steam": "<1.1", "spatie/browsershot": "<3.57.4", @@ -3013,6 +3014,7 @@ "statamic/cms": "<4.46|>=5.3,<5.6.2", "stormpath/sdk": "<9.9.99", "studio-42/elfinder": "<2.1.62", + "studiomitte/friendlycaptcha": "<0.1.4", "subhh/libconnect": "<7.0.8|>=8,<8.1", "sukohi/surpass": "<1", "sulu/form-bundle": ">=2,<2.5.3", @@ -3079,7 +3081,7 @@ "thorsten/phpmyfaq": "<3.2.2", "tikiwiki/tiki-manager": "<=17.1", "timber/timber": ">=0.16.6,<1.23.1|>=1.24,<1.24.1|>=2,<2.1", - "tinymce/tinymce": "<7", + "tinymce/tinymce": "<7.2", "tinymighty/wiki-seo": "<1.2.2", "titon/framework": "<9.9.99", "tobiasbg/tablepress": "<=2.0.0.0-RC1", @@ -3244,7 +3246,7 @@ "type": "tidelift" } ], - "time": "2024-06-13T20:04:44+00:00" + "time": "2024-06-26T15:05:17+00:00" }, { "name": "sanmai/later", @@ -3312,16 +3314,16 @@ }, { "name": "sanmai/pipeline", - "version": "v6.10", + "version": "v6.11", "source": { "type": "git", "url": "https://github.com/sanmai/pipeline.git", - "reference": "cbd2ea30ba8bef596b8dad1adb9c92fb2987e430" + "reference": "a5fa2a6c6ca93efa37e7c24aab72f47448a6b110" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sanmai/pipeline/zipball/cbd2ea30ba8bef596b8dad1adb9c92fb2987e430", - "reference": "cbd2ea30ba8bef596b8dad1adb9c92fb2987e430", + "url": "https://api.github.com/repos/sanmai/pipeline/zipball/a5fa2a6c6ca93efa37e7c24aab72f47448a6b110", + "reference": "a5fa2a6c6ca93efa37e7c24aab72f47448a6b110", "shasum": "" }, "require": { @@ -3365,7 +3367,7 @@ "description": "General-purpose collections pipeline", "support": { "issues": "https://github.com/sanmai/pipeline/issues", - "source": "https://github.com/sanmai/pipeline/tree/v6.10" + "source": "https://github.com/sanmai/pipeline/tree/v6.11" }, "funding": [ { @@ -3373,7 +3375,7 @@ "type": "github" } ], - "time": "2024-03-16T01:33:30+00:00" + "time": "2024-06-15T03:11:19+00:00" }, { "name": "sebastian/cli-parser", @@ -4546,16 +4548,16 @@ }, { "name": "symfony/console", - "version": "v7.1.1", + "version": "v7.1.2", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "9b008f2d7b21c74ef4d0c3de6077a642bc55ece3" + "reference": "0aa29ca177f432ab68533432db0de059f39c92ae" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/9b008f2d7b21c74ef4d0c3de6077a642bc55ece3", - "reference": "9b008f2d7b21c74ef4d0c3de6077a642bc55ece3", + "url": "https://api.github.com/repos/symfony/console/zipball/0aa29ca177f432ab68533432db0de059f39c92ae", + "reference": "0aa29ca177f432ab68533432db0de059f39c92ae", "shasum": "" }, "require": { @@ -4619,7 +4621,7 @@ "terminal" ], "support": { - "source": "https://github.com/symfony/console/tree/v7.1.1" + "source": "https://github.com/symfony/console/tree/v7.1.2" }, "funding": [ { @@ -4635,7 +4637,7 @@ "type": "tidelift" } ], - "time": "2024-05-31T14:57:53+00:00" + "time": "2024-06-28T10:03:55+00:00" }, { "name": "symfony/deprecation-contracts", @@ -4770,16 +4772,16 @@ }, { "name": "symfony/polyfill-intl-grapheme", - "version": "v1.29.0", + "version": "v1.30.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-intl-grapheme.git", - "reference": "32a9da87d7b3245e09ac426c83d334ae9f06f80f" + "reference": "64647a7c30b2283f5d49b874d84a18fc22054b7a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/32a9da87d7b3245e09ac426c83d334ae9f06f80f", - "reference": "32a9da87d7b3245e09ac426c83d334ae9f06f80f", + "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/64647a7c30b2283f5d49b874d84a18fc22054b7a", + "reference": "64647a7c30b2283f5d49b874d84a18fc22054b7a", "shasum": "" }, "require": { @@ -4828,7 +4830,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.29.0" + "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.30.0" }, "funding": [ { @@ -4844,20 +4846,20 @@ "type": "tidelift" } ], - "time": "2024-01-29T20:11:03+00:00" + "time": "2024-05-31T15:07:36+00:00" }, { "name": "symfony/polyfill-intl-normalizer", - "version": "v1.29.0", + "version": "v1.30.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-intl-normalizer.git", - "reference": "bc45c394692b948b4d383a08d7753968bed9a83d" + "reference": "a95281b0be0d9ab48050ebd988b967875cdb9fdb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/bc45c394692b948b4d383a08d7753968bed9a83d", - "reference": "bc45c394692b948b4d383a08d7753968bed9a83d", + "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/a95281b0be0d9ab48050ebd988b967875cdb9fdb", + "reference": "a95281b0be0d9ab48050ebd988b967875cdb9fdb", "shasum": "" }, "require": { @@ -4909,7 +4911,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.29.0" + "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.30.0" }, "funding": [ { @@ -4925,20 +4927,20 @@ "type": "tidelift" } ], - "time": "2024-01-29T20:11:03+00:00" + "time": "2024-05-31T15:07:36+00:00" }, { "name": "symfony/polyfill-php73", - "version": "v1.29.0", + "version": "v1.30.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php73.git", - "reference": "21bd091060673a1177ae842c0ef8fe30893114d2" + "reference": "ec444d3f3f6505bb28d11afa41e75faadebc10a1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/21bd091060673a1177ae842c0ef8fe30893114d2", - "reference": "21bd091060673a1177ae842c0ef8fe30893114d2", + "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/ec444d3f3f6505bb28d11afa41e75faadebc10a1", + "reference": "ec444d3f3f6505bb28d11afa41e75faadebc10a1", "shasum": "" }, "require": { @@ -4985,7 +4987,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php73/tree/v1.29.0" + "source": "https://github.com/symfony/polyfill-php73/tree/v1.30.0" }, "funding": [ { @@ -5001,20 +5003,20 @@ "type": "tidelift" } ], - "time": "2024-01-29T20:11:03+00:00" + "time": "2024-05-31T15:07:36+00:00" }, { "name": "symfony/polyfill-php80", - "version": "v1.29.0", + "version": "v1.30.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php80.git", - "reference": "87b68208d5c1188808dd7839ee1e6c8ec3b02f1b" + "reference": "77fa7995ac1b21ab60769b7323d600a991a90433" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/87b68208d5c1188808dd7839ee1e6c8ec3b02f1b", - "reference": "87b68208d5c1188808dd7839ee1e6c8ec3b02f1b", + "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/77fa7995ac1b21ab60769b7323d600a991a90433", + "reference": "77fa7995ac1b21ab60769b7323d600a991a90433", "shasum": "" }, "require": { @@ -5065,7 +5067,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php80/tree/v1.29.0" + "source": "https://github.com/symfony/polyfill-php80/tree/v1.30.0" }, "funding": [ { @@ -5081,20 +5083,20 @@ "type": "tidelift" } ], - "time": "2024-01-29T20:11:03+00:00" + "time": "2024-05-31T15:07:36+00:00" }, { "name": "symfony/polyfill-php81", - "version": "v1.29.0", + "version": "v1.30.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php81.git", - "reference": "c565ad1e63f30e7477fc40738343c62b40bc672d" + "reference": "3fb075789fb91f9ad9af537c4012d523085bd5af" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php81/zipball/c565ad1e63f30e7477fc40738343c62b40bc672d", - "reference": "c565ad1e63f30e7477fc40738343c62b40bc672d", + "url": "https://api.github.com/repos/symfony/polyfill-php81/zipball/3fb075789fb91f9ad9af537c4012d523085bd5af", + "reference": "3fb075789fb91f9ad9af537c4012d523085bd5af", "shasum": "" }, "require": { @@ -5141,7 +5143,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php81/tree/v1.29.0" + "source": "https://github.com/symfony/polyfill-php81/tree/v1.30.0" }, "funding": [ { @@ -5157,7 +5159,7 @@ "type": "tidelift" } ], - "time": "2024-01-29T20:11:03+00:00" + "time": "2024-06-19T12:30:46+00:00" }, { "name": "symfony/process", @@ -5305,16 +5307,16 @@ }, { "name": "symfony/string", - "version": "v7.1.1", + "version": "v7.1.2", "source": { "type": "git", "url": "https://github.com/symfony/string.git", - "reference": "60bc311c74e0af215101235aa6f471bcbc032df2" + "reference": "14221089ac66cf82e3cf3d1c1da65de305587ff8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/string/zipball/60bc311c74e0af215101235aa6f471bcbc032df2", - "reference": "60bc311c74e0af215101235aa6f471bcbc032df2", + "url": "https://api.github.com/repos/symfony/string/zipball/14221089ac66cf82e3cf3d1c1da65de305587ff8", + "reference": "14221089ac66cf82e3cf3d1c1da65de305587ff8", "shasum": "" }, "require": { @@ -5372,7 +5374,7 @@ "utf8" ], "support": { - "source": "https://github.com/symfony/string/tree/v7.1.1" + "source": "https://github.com/symfony/string/tree/v7.1.2" }, "funding": [ { @@ -5388,7 +5390,7 @@ "type": "tidelift" } ], - "time": "2024-06-04T06:40:14+00:00" + "time": "2024-06-28T09:27:18+00:00" }, { "name": "thecodingmachine/safe", diff --git a/phpcs.xml.dist b/phpcs.xml.dist deleted file mode 100644 index 1ae9151..0000000 --- a/phpcs.xml.dist +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - - - - - - src/ - test/ - - - - - - - - - - diff --git a/src/AtooloRuntime.php b/src/AtooloRuntime.php index 1587169..916c264 100644 --- a/src/AtooloRuntime.php +++ b/src/AtooloRuntime.php @@ -19,7 +19,7 @@ class AtooloRuntime */ public function __construct( private readonly string $projectDir, - private readonly array $options + private readonly array $options, ) { $executors = []; @@ -28,7 +28,7 @@ public function __construct( static function (string $executorClass) { return new $executorClass(); }, - $packageOptions['executor'] ?? [] + $packageOptions['executor'] ?? [], ); } $this->executor = array_merge(...$executors); diff --git a/src/Composer/ComposerJson.php b/src/Composer/ComposerJson.php index b4662c5..ff075cd 100644 --- a/src/Composer/ComposerJson.php +++ b/src/Composer/ComposerJson.php @@ -24,7 +24,7 @@ public function __construct( private readonly Composer $composer, string $composerJsonFile, private readonly JsonManipulator $manipulator, - private array $jsonContent = [] + private array $jsonContent = [], ) { $this->jsonFile = new JsonFile($composerJsonFile); } @@ -62,7 +62,7 @@ public function addAutoloadFile(string $autoloadFile): bool file_put_contents( $this->jsonFile->getPath(), - $this->manipulator->getContents() + $this->manipulator->getContents(), ); $this->updateAutoloadConfig(); @@ -88,7 +88,7 @@ public function removeAutoloadFile(string $autoloadFile): bool } file_put_contents( $this->jsonFile->getPath(), - $this->manipulator->getContents() + $this->manipulator->getContents(), ); $this->updateAutoloadConfig(); @@ -99,7 +99,7 @@ public function removeAutoloadFile(string $autoloadFile): bool public function updateAutoloadConfig(): void { $this->composer->getPackage()->setAutoload( - $this->jsonContent['autoload'] ?? [] + $this->jsonContent['autoload'] ?? [], ); } } diff --git a/src/Composer/ComposerJsonFactory.php b/src/Composer/ComposerJsonFactory.php index ce4bde6..8656a5f 100644 --- a/src/Composer/ComposerJsonFactory.php +++ b/src/Composer/ComposerJsonFactory.php @@ -13,13 +13,13 @@ class ComposerJsonFactory { public function create( Composer $composer, - string $composerJsonFile + string $composerJsonFile, ): ComposerJson { $composerJsonRealPath = realpath($composerJsonFile); if ($composerJsonRealPath === false) { throw new RuntimeException( - "Failed to resolve composer.json file: $composerJsonFile" + "Failed to resolve composer.json file: $composerJsonFile", ); } @@ -29,7 +29,7 @@ public function create( $composer, $composerJsonRealPath, new JsonManipulator($content), - $jsonContent + $jsonContent, ); } @@ -41,7 +41,7 @@ private function loadContent(string $composerJsonFile): string $content = @file_get_contents($composerJsonFile); if ($content === false) { throw new RuntimeException( - "Failed to read composer.json file: $composerJsonFile" + "Failed to read composer.json file: $composerJsonFile", ); } return $content; @@ -61,12 +61,12 @@ private function parseJson(string $composerJsonFile, string $content): array $content, true, 512, - JSON_THROW_ON_ERROR + JSON_THROW_ON_ERROR, ); if (!is_array($jsonContent)) { throw new JsonException( - "Failed to parse composer.json file: $composerJsonFile" + "Failed to parse composer.json file: $composerJsonFile", ); } diff --git a/src/Composer/ComposerPlugin.php b/src/Composer/ComposerPlugin.php index 908bfbb..3ee801f 100644 --- a/src/Composer/ComposerPlugin.php +++ b/src/Composer/ComposerPlugin.php @@ -29,7 +29,7 @@ class ComposerPlugin implements PluginInterface, EventSubscriberInterface public function __construct( ?ComposerJsonFactory $composerJsonFactory = null, - ?RuntimeFileFactory $runtimeFileFactory = null + ?RuntimeFileFactory $runtimeFileFactory = null, ) { $this->composerJsonFactory = $composerJsonFactory ?? new ComposerJsonFactory(); @@ -46,7 +46,7 @@ public static function getSubscribedEvents() $method = 'updateRuntime'; $priority = 1; return [ - ScriptEvents::PRE_AUTOLOAD_DUMP => [$method, $priority] + ScriptEvents::PRE_AUTOLOAD_DUMP => [$method, $priority], ]; } @@ -58,11 +58,11 @@ public function activate(Composer $composer, IOInterface $io): void $this->io = $io; $this->composerJson = $this->composerJsonFactory->create( $composer, - Factory::getComposerFile() + Factory::getComposerFile(), ); $this->runtimeFile = $this->runtimeFileFactory->create( $composer, - dirname($this->composerJson->getPath()) + dirname($this->composerJson->getPath()), ); self::$activated = true; } @@ -76,7 +76,7 @@ public function updateRuntime(): void { $this->runtimeFile->updateRuntimeFile($this->io); $this->composerJson->addAutoloadFile( - $this->runtimeFile->getRuntimeFilePath() + $this->runtimeFile->getRuntimeFilePath(), ); } @@ -89,7 +89,7 @@ public function uninstall(Composer $composer, IOInterface $io) { $this->runtimeFile->removeRuntimeFile($this->io); $this->composerJson->removeAutoloadFile( - $this->runtimeFile->getRuntimeFilePath() + $this->runtimeFile->getRuntimeFilePath(), ); } } diff --git a/src/Composer/RuntimeFile.php b/src/Composer/RuntimeFile.php index 7a439d9..9093daa 100644 --- a/src/Composer/RuntimeFile.php +++ b/src/Composer/RuntimeFile.php @@ -18,9 +18,8 @@ class RuntimeFile public function __construct( private readonly Composer $composer, - private readonly string $projectDir - ) { - } + private readonly string $projectDir, + ) {} public function getRuntimeFilePath(): string { @@ -39,7 +38,7 @@ public function updateRuntimeFile(IOInterface $io): void $projectDir = $this->getProjectDir(); $rootRuntimeOptions = $this->getPackageRuntimeOptions( - $this->composer->getPackage() + $this->composer->getPackage(), ); $runtimeClass = $rootRuntimeOptions['class'] ?? AtooloRuntime::class; @@ -50,7 +49,7 @@ public function updateRuntimeFile(IOInterface $io): void if ($runtimeTemplate === false) { throw new RuntimeException( 'Failed to read runtime template file: ' - . $runtimeTemplateFile + . $runtimeTemplateFile, ); } $code = strtr($runtimeTemplate, [ @@ -82,13 +81,13 @@ private function getVendorDir(): string if (!is_string($vendorDir)) { throw new RuntimeException( 'Unable to determine the vendor directory: ' - . print_r($vendorDir, true) + . print_r($vendorDir, true), ); } $vendorDir = realpath($vendorDir); if ($vendorDir === false) { throw new RuntimeException( - 'Unable to determine the vendor directory.' + 'Unable to determine the vendor directory.', ); } @@ -105,7 +104,7 @@ private function getRuntimeOptions(): array $packages = array_merge( $repo->getPackages(), - [$this->composer->getPackage()] + [$this->composer->getPackage()], ); foreach ($packages as $package) { $packageOptions = $this->getPackageRuntimeOptions($package); @@ -128,7 +127,7 @@ private function getRuntimeTemplateFile(): string /** @var RuntimeRootPackageOptions $rootPackageOptions */ $rootPackageOptions = $this->getPackageRuntimeOptions( - $this->composer->getPackage() + $this->composer->getPackage(), ); $runtimeTemplateFile = $rootPackageOptions['template'] ?? null; if ($runtimeTemplateFile === null) { @@ -144,8 +143,8 @@ private function getRuntimeTemplateFile(): string 'File "%s" defined under ' . '"extra.atoolo.runtime.template"' . ' in your composer.json not found.', - $runtimeTemplateFile - ) + $runtimeTemplateFile, + ), ); } diff --git a/src/Composer/RuntimeFileFactory.php b/src/Composer/RuntimeFileFactory.php index 0f06f2c..3902e2c 100644 --- a/src/Composer/RuntimeFileFactory.php +++ b/src/Composer/RuntimeFileFactory.php @@ -10,7 +10,7 @@ class RuntimeFileFactory { public function create( Composer $composer, - string $projectDir + string $projectDir, ): RuntimeFile { return new RuntimeFile($composer, $projectDir); } diff --git a/src/Executor/IniSetter.php b/src/Executor/IniSetter.php index ac92070..511a6d8 100644 --- a/src/Executor/IniSetter.php +++ b/src/Executor/IniSetter.php @@ -17,9 +17,8 @@ class IniSetter implements RuntimeExecutor private $alreadySet = []; public function __construct( - private readonly Platform $platform = new Platform() - ) { - } + private readonly Platform $platform = new Platform(), + ) {} /** * @param RuntimeOptions $options @@ -40,7 +39,7 @@ public function execute(string $projectDir, array $options): void if ($value !== null) { $settings[$key] = [ 'value' => $value, - 'package' => $package + 'package' => $package, ]; } } @@ -52,7 +51,7 @@ public function execute(string $projectDir, array $options): void $package = $setting['package']; throw new RuntimeException( "[atoolo.runtime.init.set]: " - . "Failed to set $key to $value for, package: $package" + . "Failed to set $key to $value for, package: $package", ); } } @@ -66,7 +65,7 @@ public function execute(string $projectDir, array $options): void private function validate( string $package, string $key, - mixed $value + mixed $value, ): bool|float|int|string|null { if ($value === null) { @@ -76,7 +75,7 @@ private function validate( if (is_scalar($value) === false) { throw new RuntimeException( "[atoolo.runtime.init.set]: " - . "Value for $key in package $package must be scalar" + . "Value for $key in package $package must be scalar", ); } @@ -88,20 +87,20 @@ private function validate( $package = $this->alreadySet[$key]['package']; throw new RuntimeException( "[atoolo.runtime.init.set]: " - . "$key is already set to '$existsValue', package: $package" + . "$key is already set to '$existsValue', package: $package", ); } if (ini_set($key, $value) === false) { throw new RuntimeException( "[atoolo.runtime.init.set]: " - . "Failed to set $key to $value for, package: $package" + . "Failed to set $key to $value for, package: $package", ); } $this->alreadySet[$key] = [ 'value' => $value, - 'package' => $package + 'package' => $package, ]; return $value; diff --git a/src/Executor/Platform.php b/src/Executor/Platform.php index e3bc2a1..c20864a 100644 --- a/src/Executor/Platform.php +++ b/src/Executor/Platform.php @@ -16,7 +16,7 @@ public function umask(int $umask): int public function setIni( string $name, - bool|float|int|string $value + bool|float|int|string $value, ): false|string { return ini_set($name, $value); } diff --git a/src/Executor/UmaskSetter.php b/src/Executor/UmaskSetter.php index b4328ee..c9568f8 100644 --- a/src/Executor/UmaskSetter.php +++ b/src/Executor/UmaskSetter.php @@ -17,9 +17,8 @@ class UmaskSetter implements RuntimeExecutor private ?array $alreadySet = null; public function __construct( - private readonly Platform $platform = new Platform() - ) { - } + private readonly Platform $platform = new Platform(), + ) {} public function execute(string $projectDir, array $options): void { @@ -44,11 +43,11 @@ private function validate(string $package, mixed $value): false|int throw new RuntimeException( "[atoolo.runtime.umask]: ' . 'umask must be an integer: " - . $value + . $value, ); } - $umask = (int)$value; + $umask = (int) $value; if ($this->alreadySet !== null) { $existsValue = $this->alreadySet['value']; @@ -59,13 +58,13 @@ private function validate(string $package, mixed $value): false|int throw new RuntimeException( "[atoolo.runtime.umask]: ' . 'umask is already set to $existsValue ' - . ' for package $package" + . ' for package $package", ); } $this->alreadySet = [ 'value' => $umask, - 'package' => $package + 'package' => $package, ]; return $umask; diff --git a/src/Executor/UserValidator.php b/src/Executor/UserValidator.php index 6eb8024..0a5131b 100644 --- a/src/Executor/UserValidator.php +++ b/src/Executor/UserValidator.php @@ -30,7 +30,7 @@ private function getValidUsers(array $options): array if (!is_array($users)) { throw new RuntimeException( "[atoolo.runtime.users]: ' - . 'users from package $package should be an array: $users" + . 'users from package $package should be an array: $users", ); } @@ -40,7 +40,7 @@ private function getValidUsers(array $options): array // owner (name) of the current script $validUser[] = get_current_user(); // owner (uid) of the current script - $validUser[] = (string)getmyuid(); + $validUser[] = (string) getmyuid(); continue; } $validUser[] = $user; @@ -65,7 +65,7 @@ private function validateUser(array $validUsers): void "[atoolo.runtime.users]: " . "The current user '$processUser'" . " is not valid. Valid users are: " - . implode(', ', $validUsers) + . implode(', ', $validUsers), ); } } diff --git a/test/AtooloRuntimeTest.php b/test/AtooloRuntimeTest.php index baf59d9..2d91f90 100644 --- a/test/AtooloRuntimeTest.php +++ b/test/AtooloRuntimeTest.php @@ -26,7 +26,7 @@ public function testExecute(): void $runtime->run(); $this->assertTrue( AtooloRuntimeTestExecutor::$executed, - 'The executor should have been executed' + 'The executor should have been executed', ); } } diff --git a/test/Composer/ComposerJsonFactoryTest.php b/test/Composer/ComposerJsonFactoryTest.php index 01e9e92..11682c0 100644 --- a/test/Composer/ComposerJsonFactoryTest.php +++ b/test/Composer/ComposerJsonFactoryTest.php @@ -26,7 +26,7 @@ public function setUp(): void if (is_dir($this->testDir) === false) { if (mkdir($this->testDir, 0777, true) === false) { throw new RuntimeException( - 'Failed to create directory: ' . $this->testDir + 'Failed to create directory: ' . $this->testDir, ); } } @@ -38,15 +38,15 @@ public function testCreateWithValidComposerFile(): void $composer = $this->createStub(Composer::class); $composerJson = $factory->create( $composer, - $this->resourceDir . '/valid-composer.json' + $this->resourceDir . '/valid-composer.json', ); $this->assertEquals( [ 'name' => 'atoolo/runtime', - 'description' => 'valid composer.json test file' + 'description' => 'valid composer.json test file', ], $composerJson->getJsonContent(), - 'Unexpected JSON content' + 'Unexpected JSON content', ); } @@ -57,7 +57,7 @@ public function testCreateWithInvalidComposerFile(): void $this->expectException(RuntimeException::class); $factory->create( $composer, - $this->resourceDir . '/notfound.json' + $this->resourceDir . '/notfound.json', ); } @@ -75,7 +75,7 @@ public function testCreateWithNonReadableFile(): void $factory = new ComposerJsonFactory(); $factory->create( $composer, - $nonReadableFile + $nonReadableFile, ); } finally { chmod($nonReadableFile, 0644); @@ -90,7 +90,7 @@ public function testCreateWithInvalidJson(): void $factory = new ComposerJsonFactory(); $factory->create( $composer, - $this->resourceDir . '/string.txt' + $this->resourceDir . '/string.txt', ); } } diff --git a/test/Composer/ComposerJsonTest.php b/test/Composer/ComposerJsonTest.php index 492a012..46f5955 100644 --- a/test/Composer/ComposerJsonTest.php +++ b/test/Composer/ComposerJsonTest.php @@ -24,7 +24,7 @@ public function setUp(): void if (is_dir($this->testDir) === false) { if (mkdir($this->testDir, 0777, true) === false) { throw new RuntimeException( - 'Failed to create directory: ' . $this->testDir + 'Failed to create directory: ' . $this->testDir, ); } } @@ -37,7 +37,7 @@ private function createComposerJson( $composer = $this->createStub(Composer::class); return $factory->create( $composer, - $composerFilePath + $composerFilePath, ); } @@ -48,7 +48,7 @@ public function testGetPath(): void self::assertEquals( realpath($composerFilePath), $composerJson->getPath(), - 'Failed to resolve composer.json file: composer.json' + 'Failed to resolve composer.json file: composer.json', ); } @@ -59,10 +59,10 @@ public function testGetJsonContent(): void $this->assertEquals( [ 'name' => 'atoolo/runtime', - 'description' => 'valid composer.json test file' + 'description' => 'valid composer.json test file', ], $composerJson->getJsonContent(), - 'Unexpected JSON content' + 'Unexpected JSON content', ); } @@ -71,8 +71,8 @@ public function testAddAutoloadFile(): void $file = $this->createTestFile( 'composer-add-autoload-file.json', [ - 'name' => 'atoolo/runtime' - ] + 'name' => 'atoolo/runtime', + ], ); $composerJson = $this->createComposerJson($file); @@ -81,8 +81,8 @@ public function testAddAutoloadFile(): void $expected = [ 'name' => 'atoolo/runtime', 'autoload' => [ - 'files' => ['vendor/test.php'] - ] + 'files' => ['vendor/test.php'], + ], ]; $this->assertEquals( @@ -91,9 +91,9 @@ public function testAddAutoloadFile(): void file_get_contents($file), true, 512, - JSON_THROW_ON_ERROR + JSON_THROW_ON_ERROR, ), - 'Failed to add autoload file to composer.json' + 'Failed to add autoload file to composer.json', ); } @@ -104,9 +104,9 @@ public function testAddAutoloadFileWithExistsFile(): void [ 'name' => 'atoolo/runtime', 'autoload' => [ - 'files' => ['vendor/test.php'] - ] - ] + 'files' => ['vendor/test.php'], + ], + ], ); $composerJson = $this->createComposerJson($file); @@ -115,8 +115,8 @@ public function testAddAutoloadFileWithExistsFile(): void $expected = [ 'name' => 'atoolo/runtime', 'autoload' => [ - 'files' => ['vendor/test.php'] - ] + 'files' => ['vendor/test.php'], + ], ]; $this->assertEquals( @@ -125,9 +125,9 @@ public function testAddAutoloadFileWithExistsFile(): void file_get_contents($file), true, 512, - JSON_THROW_ON_ERROR + JSON_THROW_ON_ERROR, ), - 'Failed to add autoload file to composer.json' + 'Failed to add autoload file to composer.json', ); } @@ -138,16 +138,16 @@ public function testRemoveAutoloadFile(): void [ 'name' => 'atoolo/runtime', 'autoload' => [ - 'files' => ['vendor/test.php'] - ] - ] + 'files' => ['vendor/test.php'], + ], + ], ); $composerJson = $this->createComposerJson($file); $composerJson->removeAutoloadFile('vendor/test.php'); $expected = [ 'name' => 'atoolo/runtime', - 'autoload' => [] + 'autoload' => [], ]; $this->assertEquals( @@ -156,9 +156,9 @@ public function testRemoveAutoloadFile(): void file_get_contents($file), true, 512, - JSON_THROW_ON_ERROR + JSON_THROW_ON_ERROR, ), - 'Failed to add autoload file to composer.json' + 'Failed to add autoload file to composer.json', ); } @@ -168,8 +168,8 @@ public function testRemoveAutoloadFileWithoutFile(): void 'composer-remove-autoload-file.json', [ 'name' => 'atoolo/runtime', - 'autoload' => [] - ] + 'autoload' => [], + ], ); $composerJson = $this->createComposerJson($file); @@ -177,7 +177,7 @@ public function testRemoveAutoloadFileWithoutFile(): void $expected = [ 'name' => 'atoolo/runtime', - 'autoload' => [] + 'autoload' => [], ]; $this->assertEquals( @@ -186,9 +186,9 @@ public function testRemoveAutoloadFileWithoutFile(): void file_get_contents($file), true, 512, - JSON_THROW_ON_ERROR + JSON_THROW_ON_ERROR, ), - 'Failed to add autoload file to composer.json' + 'Failed to add autoload file to composer.json', ); } @@ -202,9 +202,9 @@ public function testRemoveAutoloadFileWithOtherAutoloads(): void 'files' => [ 'test/abc.php', 'vendor/test.php', - ] - ] - ] + ], + ], + ], ); $composerJson = $this->createComposerJson($file); @@ -214,9 +214,9 @@ public function testRemoveAutoloadFileWithOtherAutoloads(): void 'name' => 'atoolo/runtime', 'autoload' => [ 'files' => [ - 'test/abc.php' - ] - ] + 'test/abc.php', + ], + ], ]; $this->assertEquals( @@ -225,9 +225,9 @@ public function testRemoveAutoloadFileWithOtherAutoloads(): void file_get_contents($file), true, 512, - JSON_THROW_ON_ERROR + JSON_THROW_ON_ERROR, ), - 'Failed to add autoload file to composer.json' + 'Failed to add autoload file to composer.json', ); } @@ -236,7 +236,7 @@ private function createTestFile(string $filenname, array $content): string $file = $this->testDir . '/' . $filenname; file_put_contents( $file, - json_encode($content, JSON_THROW_ON_ERROR) + json_encode($content, JSON_THROW_ON_ERROR), ); return $file; diff --git a/test/Composer/ComposerPluginTest.php b/test/Composer/ComposerPluginTest.php index 323f830..782f673 100644 --- a/test/Composer/ComposerPluginTest.php +++ b/test/Composer/ComposerPluginTest.php @@ -29,7 +29,7 @@ public function testGetSubscribedEventsWithDeactivated(): void $this->assertEquals( [], ComposerPlugin::getSubscribedEvents(), - 'Failed to return empty array' + 'Failed to return empty array', ); } @@ -44,13 +44,13 @@ public function testGetSubscribedEventsWithActivated(): void $method = 'updateRuntime'; $priority = 1; $exprected = [ - ScriptEvents::PRE_AUTOLOAD_DUMP => [$method, $priority] + ScriptEvents::PRE_AUTOLOAD_DUMP => [$method, $priority], ]; $this->assertEquals( $exprected, ComposerPlugin::getSubscribedEvents(), - 'Failed to return empty array' + 'Failed to return empty array', ); } @@ -63,7 +63,7 @@ public function testUpdateRuntime(): void $runtimeFileFactory = $this->createStub(RuntimeFileFactory::class); $plugin = new ComposerPlugin( $composerJsonFactory, - $runtimeFileFactory + $runtimeFileFactory, ); $runtimeFile = $this->createMock(RuntimeFile::class); @@ -90,7 +90,7 @@ public function testUninstall(): void $runtimeFileFactory = $this->createStub(RuntimeFileFactory::class); $plugin = new ComposerPlugin( $composerJsonFactory, - $runtimeFileFactory + $runtimeFileFactory, ); $runtimeFile = $this->createMock(RuntimeFile::class); diff --git a/test/Composer/RuntimeFileFactoryTest.php b/test/Composer/RuntimeFileFactoryTest.php index 0e1f682..f1ed256 100644 --- a/test/Composer/RuntimeFileFactoryTest.php +++ b/test/Composer/RuntimeFileFactoryTest.php @@ -19,7 +19,7 @@ public function testCreate(): void $composer = $this->createStub(Composer::class); $runtimeFile = $factory->create( $composer, - '' + '', ); self::assertInstanceOf(RuntimeFile::class, $runtimeFile); } diff --git a/test/Composer/RuntimeFileTest.php b/test/Composer/RuntimeFileTest.php index 82fc926..3235b45 100644 --- a/test/Composer/RuntimeFileTest.php +++ b/test/Composer/RuntimeFileTest.php @@ -42,7 +42,7 @@ public function setUp(): void if (is_dir($dir) === false) { if (mkdir($dir, 0777, true) === false) { throw new RuntimeException( - 'Failed to create directory: ' . $dir + 'Failed to create directory: ' . $dir, ); } } @@ -62,7 +62,7 @@ public function setUp(): void $this->composer->method('getRepositoryManager') ->willReturn($this->repositoryManager); $this->localRepository = $this->createStub( - InstalledRepositoryInterface::class + InstalledRepositoryInterface::class, ); $this->repositoryManager->method('getLocalRepository') ->willReturn($this->localRepository); @@ -74,7 +74,7 @@ public function testGetRuntimeFile(): void self::assertEquals( 'vendor/atoolo_runtime.php', $runtimeFile->getRuntimeFilePath(), - 'Failed to get runtime file path' + 'Failed to get runtime file path', ); } @@ -106,9 +106,9 @@ public function testCreateRuntimeFile(): void 'atoolo' => [ 'runtime' => [ 'template' => $runtimeFileTemplate, - 'option' => 'B' - ] - ] + 'option' => 'B', + ], + ], ]); $composer->method('getPackage') ->willReturn($rootPackage); @@ -136,7 +136,7 @@ public function testCreateRuntimeFile(): void EOF, file_get_contents($runtimeFile), - 'Unexpected runtime file content' + 'Unexpected runtime file content', ); } @@ -152,7 +152,7 @@ public function testNonStringVendorDir(): void $runtimeFile = new RuntimeFile( $composer, - $this->testDir + $this->testDir, ); $this->expectException(RuntimeException::class); $runtimeFile->updateRuntimeFile($io); @@ -170,7 +170,7 @@ public function testInvalidVendorDir(): void $runtimeFile = new RuntimeFile( $composer, - $this->testDir + $this->testDir, ); $this->expectException(RuntimeException::class); $runtimeFile->updateRuntimeFile($io); @@ -184,20 +184,20 @@ public function testUpdateRuntimeFile(): void 'test/package', [ 'atoolo' => [ - 'runtime' => ['option' => 'A'] - ] - ] + 'runtime' => ['option' => 'A'], + ], + ], ); $packageWithoutExtra = $this->createPackage( 'test/package', - [] + [], ); $this->localRepository->method('getPackages') ->willReturn([ $package, - $packageWithoutExtra + $packageWithoutExtra, ]); $rootPackage = $this->createStub(RootPackageInterface::class); @@ -206,28 +206,28 @@ public function testUpdateRuntimeFile(): void $rootPackage->method('getExtra') ->willReturn([ 'atoolo' => [ - 'runtime' => ['option' => 'B'] - ] + 'runtime' => ['option' => 'B'], + ], ]); $this->composer->method('getPackage') ->willReturn($rootPackage); $runtimeFile = new RuntimeFile( $this->composer, - $this->testDir + $this->testDir, ); $runtimeFile->updateRuntimeFile($io); $content = file_get_contents($this->runtimeFile); $expectedOptions = var_export([ 'test/package' => ['option' => 'A'], - 'test/root-package' => ['option' => 'B'] + 'test/root-package' => ['option' => 'B'], ], true); $this->assertStringContainsString( $expectedOptions, $content, - 'Failed to update runtime file' + 'Failed to update runtime file', ); } @@ -240,14 +240,14 @@ public function testUpdateRuntimeFileWithNonNestedProjectDir(): void $runtimeFile = new RuntimeFile( $this->composer, - realpath($this->testDir . '/vendor') + realpath($this->testDir . '/vendor'), ); $runtimeFile->updateRuntimeFile($io); $content = file_get_contents($this->runtimeFile); $this->assertStringContainsString( ' __' . 'DIR__', $content, - 'Failed to update runtime file' + 'Failed to update runtime file', ); } @@ -260,15 +260,15 @@ public function testUpdateRuntimeFileWithInvalidTemplateFile(): void $rootPackage->method('getExtra') ->willReturn([ 'atoolo' => [ - 'runtime' => ['template' => 'invalid-path'] - ] + 'runtime' => ['template' => 'invalid-path'], + ], ]); $this->composer->method('getPackage') ->willReturn($rootPackage); $runtimeFile = new RuntimeFile( $this->composer, - $this->testDir + $this->testDir, ); $this->expectException(InvalidArgumentException::class); @@ -287,8 +287,8 @@ public function testUpdateRuntimeFileWithUnreadableTemplateFile(): void $rootPackage->method('getExtra') ->willReturn([ 'atoolo' => [ - 'runtime' => ['template' => 'nonreadable.template'] - ] + 'runtime' => ['template' => 'nonreadable.template'], + ], ]); $this->composer->method('getPackage') ->willReturn($rootPackage); @@ -297,7 +297,7 @@ public function testUpdateRuntimeFileWithUnreadableTemplateFile(): void $runtimeFile = new RuntimeFile( $this->composer, - $this->testDir + $this->testDir, ); @@ -321,12 +321,12 @@ public function testRemoveRuntimeFile(): void touch($file); $runtimeFile = new RuntimeFile( $this->composer, - $this->testDir + $this->testDir, ); $runtimeFile->removeRuntimeFile($io); $this->assertFileDoesNotExist( $file, - 'Failed to remove runtime file' + 'Failed to remove runtime file', ); } diff --git a/test/Executor/IniSetterTest.php b/test/Executor/IniSetterTest.php index 59aec87..bba79bc 100644 --- a/test/Executor/IniSetterTest.php +++ b/test/Executor/IniSetterTest.php @@ -27,10 +27,10 @@ public function testSetIni(): void 'package1' => [ 'ini' => [ 'set' => [ - 'user_agent' => 'Test' - ] - ] - ] + 'user_agent' => 'Test', + ], + ], + ], ]); } @@ -49,17 +49,17 @@ public function testSetIniTwiceWithSameValueAgain(): void 'package1' => [ 'ini' => [ 'set' => [ - 'user_agent' => 'Test' - ] - ] + 'user_agent' => 'Test', + ], + ], ], 'package2' => [ 'ini' => [ 'set' => [ - 'user_agent' => 'Test' - ] - ] - ] + 'user_agent' => 'Test', + ], + ], + ], ]); } @@ -72,17 +72,17 @@ public function testSetIniTwiceWithDifferentValues(): void 'package1' => [ 'ini' => [ 'set' => [ - 'user_agent' => 'Test' - ] - ] + 'user_agent' => 'Test', + ], + ], ], 'package2' => [ 'ini' => [ 'set' => [ - 'user_agent' => 'Test2' - ] - ] - ] + 'user_agent' => 'Test2', + ], + ], + ], ]); } @@ -94,10 +94,10 @@ public function testSetIniSystemDirective(): void 'package1' => [ 'ini' => [ 'set' => [ - 'allow_url_fopen' => 0 - ] - ] - ] + 'allow_url_fopen' => 0, + ], + ], + ], ]); } @@ -109,10 +109,10 @@ public function testSetIniWithNonScalar(): void 'package1' => [ 'ini' => [ 'set' => [ - 'user_agent' => ['non' => 'scalar'] - ] - ] - ] + 'user_agent' => ['non' => 'scalar'], + ], + ], + ], ]); } @@ -128,10 +128,10 @@ public function testSetIniWithNull(): void 'package1' => [ 'ini' => [ 'set' => [ - 'user_agent' => null - ] - ] - ] + 'user_agent' => null, + ], + ], + ], ]); } @@ -149,10 +149,10 @@ public function testSetIniFailed(): void 'package1' => [ 'ini' => [ 'set' => [ - 'user_agent' => 'Test' - ] - ] - ] + 'user_agent' => 'Test', + ], + ], + ], ]); } } diff --git a/test/Executor/UmaskSetterTest.php b/test/Executor/UmaskSetterTest.php index de3ab6f..334a639 100644 --- a/test/Executor/UmaskSetterTest.php +++ b/test/Executor/UmaskSetterTest.php @@ -28,8 +28,8 @@ public function testSetUmask(): void ->willReturn(123); $umaskSetter->execute('', [ 'package1' => [ - 'umask' => '0123' - ] + 'umask' => '0123', + ], ]); } @@ -46,7 +46,7 @@ public function testSetUmaskWithoutUmask(): void $umaskSetter->execute('', [ 'package1' => [ - ] + ], ]); } @@ -65,11 +65,11 @@ public function testSetUmaskTwiceWithSameValue(): void $umaskSetter->execute('', [ 'package1' => [ - 'umask' => '0123' + 'umask' => '0123', ], 'package2' => [ - 'umask' => '0123' - ] + 'umask' => '0123', + ], ]); } @@ -81,11 +81,11 @@ public function testSetUmaskTwiceWithDifferentValues(): void $this->expectException(RuntimeException::class); $umaskSetter->execute('', [ 'package1' => [ - 'umask' => '0123' + 'umask' => '0123', ], 'package2' => [ - 'umask' => '0456' - ] + 'umask' => '0456', + ], ]); } @@ -95,7 +95,7 @@ public function testSetUmaskWithNonNumericValue(): void $this->expectException(RuntimeException::class); $umaskSetter->execute('', [ 'package1' => [ - 'umask' => 'abc' + 'umask' => 'abc', ], ]); } diff --git a/test/Executor/UserValidatorTest.php b/test/Executor/UserValidatorTest.php index 9079e00..9b11dca 100644 --- a/test/Executor/UserValidatorTest.php +++ b/test/Executor/UserValidatorTest.php @@ -18,8 +18,8 @@ public function testValidateUserWithInvalidUser(): void $this->expectException(RuntimeException::class); $userValidator->execute('', [ 'package1' => [ - 'users' => ['abc'] - ] + 'users' => ['abc'], + ], ]); } @@ -31,8 +31,8 @@ public function testValidateUser(): void $this->expectNotToPerformAssertions(); $userValidator->execute('', [ 'package1' => [ - 'users' => [$processUser] - ] + 'users' => [$processUser], + ], ]); } @@ -42,7 +42,7 @@ public function testValidateUserWithoutUser(): void $this->expectNotToPerformAssertions(); $userValidator->execute('', [ 'package1' => [ - ] + ], ]); } @@ -52,8 +52,8 @@ public function testValidateUserWithNonArray(): void $this->expectException(RuntimeException::class); $userValidator->execute('', [ 'package1' => [ - 'users' => 'non-array' - ] + 'users' => 'non-array', + ], ]); } @@ -63,8 +63,8 @@ public function testValidateUserWithScriptOwner(): void $this->expectNotToPerformAssertions(); $userValidator->execute('', [ 'package1' => [ - 'users' => ['{SCRIPT_OWNER}'] - ] + 'users' => ['{SCRIPT_OWNER}'], + ], ]); } }