From 11501925955ac9f1ae5fe0389ff3b132667a2aca Mon Sep 17 00:00:00 2001 From: Jan Nedbal Date: Tue, 23 Jan 2024 16:33:40 +0100 Subject: [PATCH] Update shipmonk/phpstan-rules and composer-normalize --- composer.json | 4 +- composer.lock | 232 ++++++++++++++++++++----------------- src/MigrationRun.php | 2 +- tests/MigrationRunTest.php | 23 ++++ 4 files changed, 152 insertions(+), 109 deletions(-) create mode 100644 tests/MigrationRunTest.php diff --git a/composer.json b/composer.json index 147b09e..f10af9d 100644 --- a/composer.json +++ b/composer.json @@ -34,8 +34,8 @@ "config": { "allow-plugins": { "dealerdirect/phpcodesniffer-composer-installer": true, - "ocramius/package-versions": true, - "ergebnis/composer-normalize": true + "ergebnis/composer-normalize": true, + "ocramius/package-versions": true }, "sort-packages": true }, diff --git a/composer.lock b/composer.lock index 829da85..3288490 100644 --- a/composer.lock +++ b/composer.lock @@ -2145,40 +2145,41 @@ }, { "name": "ergebnis/composer-normalize", - "version": "2.37.0", + "version": "2.41.1", "source": { "type": "git", "url": "https://github.com/ergebnis/composer-normalize.git", - "reference": "25d0fa13545452208fe21216608ed62b637e40f0" + "reference": "01eb2d9b8623828ec2264f54d7782a25558d27b2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/ergebnis/composer-normalize/zipball/25d0fa13545452208fe21216608ed62b637e40f0", - "reference": "25d0fa13545452208fe21216608ed62b637e40f0", + "url": "https://api.github.com/repos/ergebnis/composer-normalize/zipball/01eb2d9b8623828ec2264f54d7782a25558d27b2", + "reference": "01eb2d9b8623828ec2264f54d7782a25558d27b2", "shasum": "" }, "require": { "composer-plugin-api": "^2.0.0", - "ergebnis/json": "^1.0.1", - "ergebnis/json-normalizer": "^4.2.0", - "ergebnis/json-printer": "^3.3.0", + "ergebnis/json": "^1.1.0", + "ergebnis/json-normalizer": "^4.4.1", + "ergebnis/json-printer": "^3.4.0", "ext-json": "*", "justinrainbow/json-schema": "^5.2.12", "localheinz/diff": "^1.1.1", - "php": "~8.1.0 || ~8.2.0" + "php": "~8.1.0 || ~8.2.0 || ~8.3.0" }, "require-dev": { - "composer/composer": "^2.6.3", - "ergebnis/license": "^2.2.0", - "ergebnis/php-cs-fixer-config": "^5.15.1", - "ergebnis/phpunit-slow-test-detector": "^2.3.0", + "composer/composer": "^2.6.6", + "ergebnis/license": "^2.4.0", + "ergebnis/php-cs-fixer-config": "~6.14.0", + "ergebnis/phpunit-slow-test-detector": "^2.7.0", "fakerphp/faker": "^1.23.0", - "infection/infection": "~0.27.0", - "phpunit/phpunit": "^10.3.4", + "infection/infection": "~0.27.9", + "phpunit/phpunit": "^10.5.3", "psalm/plugin-phpunit": "~0.18.4", - "rector/rector": "~0.18.3", - "symfony/filesystem": "^6.0.13", - "vimeo/psalm": "^5.15.0" + "rector/rector": "~0.18.12", + "roave/backward-compatibility-check": "^8.4.0", + "symfony/filesystem": "^6.4.0", + "vimeo/psalm": "^5.17.0" }, "type": "composer-plugin", "extra": { @@ -2201,7 +2202,8 @@ "authors": [ { "name": "Andreas Möller", - "email": "am@localheinz.com" + "email": "am@localheinz.com", + "homepage": "https://localheinz.com" } ], "description": "Provides a composer plugin for normalizing composer.json.", @@ -2217,36 +2219,37 @@ "security": "https://github.com/ergebnis/composer-normalize/blob/main/.github/SECURITY.md", "source": "https://github.com/ergebnis/composer-normalize" }, - "time": "2023-09-15T09:25:45+00:00" + "time": "2023-12-14T09:37:52+00:00" }, { "name": "ergebnis/json", - "version": "1.0.1", + "version": "1.1.0", "source": { "type": "git", "url": "https://github.com/ergebnis/json.git", - "reference": "d66ea30060856d0729a4aa319a02752519ca63a0" + "reference": "9f2b9086c43b189d7044a5b6215a931fb6e9125d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/ergebnis/json/zipball/d66ea30060856d0729a4aa319a02752519ca63a0", - "reference": "d66ea30060856d0729a4aa319a02752519ca63a0", + "url": "https://api.github.com/repos/ergebnis/json/zipball/9f2b9086c43b189d7044a5b6215a931fb6e9125d", + "reference": "9f2b9086c43b189d7044a5b6215a931fb6e9125d", "shasum": "" }, "require": { - "php": "^8.0" + "php": "~8.1.0 || ~8.2.0 || ~8.3.0" }, "require-dev": { "ergebnis/composer-normalize": "^2.29.0", - "ergebnis/data-provider": "^1.2.0", - "ergebnis/license": "^2.1.0", - "ergebnis/php-cs-fixer-config": "^5.0.0", - "ergebnis/phpstan-rules": "^1.0.0", - "fakerphp/faker": "^1.20.0", - "infection/infection": "~0.26.16", - "phpunit/phpunit": "^9.5.27", + "ergebnis/data-provider": "^3.0.0", + "ergebnis/license": "^2.2.0", + "ergebnis/php-cs-fixer-config": "^6.6.0", + "ergebnis/phpunit-slow-test-detector": "^2.3.0", + "fakerphp/faker": "^1.23.0", + "infection/infection": "~0.27.4", + "phpunit/phpunit": "^10.4.1", "psalm/plugin-phpunit": "~0.18.4", - "vimeo/psalm": "^5.1.0" + "rector/rector": "~0.18.5", + "vimeo/psalm": "^5.15.0" }, "type": "library", "extra": { @@ -2267,7 +2270,8 @@ "authors": [ { "name": "Andreas Möller", - "email": "am@localheinz.com" + "email": "am@localheinz.com", + "homepage": "https://localheinz.com" } ], "description": "Provides a Json value object for representing a valid JSON string.", @@ -2277,47 +2281,49 @@ ], "support": { "issues": "https://github.com/ergebnis/json/issues", + "security": "https://github.com/ergebnis/json/blob/main/.github/SECURITY.md", "source": "https://github.com/ergebnis/json" }, - "time": "2022-12-10T22:38:50+00:00" + "time": "2023-10-10T07:57:48+00:00" }, { "name": "ergebnis/json-normalizer", - "version": "4.2.0", + "version": "4.4.1", "source": { "type": "git", "url": "https://github.com/ergebnis/json-normalizer.git", - "reference": "7d06355857dc5fad96e8b296996f26150dfab299" + "reference": "d28f36af9763ee6bc4e2a2390c0348963df7881b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/ergebnis/json-normalizer/zipball/7d06355857dc5fad96e8b296996f26150dfab299", - "reference": "7d06355857dc5fad96e8b296996f26150dfab299", + "url": "https://api.github.com/repos/ergebnis/json-normalizer/zipball/d28f36af9763ee6bc4e2a2390c0348963df7881b", + "reference": "d28f36af9763ee6bc4e2a2390c0348963df7881b", "shasum": "" }, "require": { - "ergebnis/json": "^1.0.1", + "ergebnis/json": "^1.1.0", "ergebnis/json-pointer": "^3.2.0", - "ergebnis/json-printer": "^3.3.0", - "ergebnis/json-schema-validator": "^4.0.0", + "ergebnis/json-printer": "^3.4.0", + "ergebnis/json-schema-validator": "^4.1.0", "ext-json": "*", "justinrainbow/json-schema": "^5.2.12", - "php": "~8.1.0 || ~8.2.0" + "php": "~8.1.0 || ~8.2.0 || ~8.3.0" }, "require-dev": { - "composer/semver": "^3.2.1", - "ergebnis/data-provider": "^2.0.0", - "ergebnis/license": "^2.1.0", - "ergebnis/php-cs-fixer-config": "^5.11.0", - "ergebnis/phpunit-slow-test-detector": "^2.3.0", + "composer/semver": "^3.4.0", + "ergebnis/data-provider": "^3.2.0", + "ergebnis/license": "^2.4.0", + "ergebnis/php-cs-fixer-config": "~6.14.0", + "ergebnis/phpunit-slow-test-detector": "^2.7.0", "fakerphp/faker": "^1.23.0", - "infection/infection": "~0.27.0", - "phpunit/phpunit": "^10.2.3", + "infection/infection": "~0.27.9", + "phpunit/phpunit": "^10.5.3", "psalm/plugin-phpunit": "~0.18.4", - "rector/rector": "~0.17.2", - "symfony/filesystem": "^6.3.1", - "symfony/finder": "^6.3.0", - "vimeo/psalm": "^5.13.1" + "rector/rector": "~0.18.12", + "roave/backward-compatibility-check": "^8.4.0", + "symfony/filesystem": "^6.4.0", + "symfony/finder": "^6.4.0", + "vimeo/psalm": "^5.17.0" }, "suggest": { "composer/semver": "If you want to use ComposerJsonNormalizer or VersionConstraintNormalizer" @@ -2335,7 +2341,8 @@ "authors": [ { "name": "Andreas Möller", - "email": "am@localheinz.com" + "email": "am@localheinz.com", + "homepage": "https://localheinz.com" } ], "description": "Provides generic and vendor-specific normalizers for normalizing JSON documents.", @@ -2346,37 +2353,40 @@ ], "support": { "issues": "https://github.com/ergebnis/json-normalizer/issues", + "security": "https://github.com/ergebnis/json-normalizer/blob/main/.github/SECURITY.md", "source": "https://github.com/ergebnis/json-normalizer" }, - "time": "2023-07-09T16:22:57+00:00" + "time": "2023-12-14T09:30:24+00:00" }, { "name": "ergebnis/json-pointer", - "version": "3.2.0", + "version": "3.3.0", "source": { "type": "git", "url": "https://github.com/ergebnis/json-pointer.git", - "reference": "861516ff5afa1aa8905fdf3361315909523a1bf8" + "reference": "8e517faefc06b7c761eaa041febef51a9375819a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/ergebnis/json-pointer/zipball/861516ff5afa1aa8905fdf3361315909523a1bf8", - "reference": "861516ff5afa1aa8905fdf3361315909523a1bf8", + "url": "https://api.github.com/repos/ergebnis/json-pointer/zipball/8e517faefc06b7c761eaa041febef51a9375819a", + "reference": "8e517faefc06b7c761eaa041febef51a9375819a", "shasum": "" }, "require": { - "php": "^8.0" + "php": "~8.1.0 || ~8.2.0 || ~8.3.0" }, "require-dev": { - "ergebnis/composer-normalize": "^2.28.3", - "ergebnis/data-provider": "^1.2.0", - "ergebnis/license": "^2.1.0", - "ergebnis/php-cs-fixer-config": "^5.0.0", - "fakerphp/faker": "^1.20.0", - "infection/infection": "~0.26.16", - "phpunit/phpunit": "^9.5.26", - "psalm/plugin-phpunit": "~0.18.3", - "vimeo/psalm": "^4.30" + "ergebnis/composer-normalize": "^2.29.0", + "ergebnis/data-provider": "^3.0.0", + "ergebnis/license": "^2.2.0", + "ergebnis/php-cs-fixer-config": "~6.7.0", + "ergebnis/phpunit-slow-test-detector": "^2.3.0", + "fakerphp/faker": "^1.23.0", + "infection/infection": "~0.27.4", + "phpunit/phpunit": "^10.4.1", + "psalm/plugin-phpunit": "~0.18.4", + "rector/rector": "~0.18.5", + "vimeo/psalm": "^5.15.0" }, "type": "library", "extra": { @@ -2397,7 +2407,8 @@ "authors": [ { "name": "Andreas Möller", - "email": "am@localheinz.com" + "email": "am@localheinz.com", + "homepage": "https://localheinz.com" } ], "description": "Provides JSON pointer as a value object.", @@ -2409,37 +2420,40 @@ ], "support": { "issues": "https://github.com/ergebnis/json-pointer/issues", + "security": "https://github.com/ergebnis/json-pointer/blob/main/.github/SECURITY.md", "source": "https://github.com/ergebnis/json-pointer" }, - "time": "2022-11-28T17:03:31+00:00" + "time": "2023-10-10T14:41:06+00:00" }, { "name": "ergebnis/json-printer", - "version": "3.3.0", + "version": "3.4.0", "source": { "type": "git", "url": "https://github.com/ergebnis/json-printer.git", - "reference": "18920367473b099633f644f0ca6dc8794345148f" + "reference": "05841593d72499de4f7ce4034a237c77e470558f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/ergebnis/json-printer/zipball/18920367473b099633f644f0ca6dc8794345148f", - "reference": "18920367473b099633f644f0ca6dc8794345148f", + "url": "https://api.github.com/repos/ergebnis/json-printer/zipball/05841593d72499de4f7ce4034a237c77e470558f", + "reference": "05841593d72499de4f7ce4034a237c77e470558f", "shasum": "" }, "require": { "ext-json": "*", "ext-mbstring": "*", - "php": "^8.0" + "php": "~8.1.0 || ~8.2.0 || ~8.3.0" }, "require-dev": { - "ergebnis/license": "^2.0.0", - "ergebnis/php-cs-fixer-config": "^4.11.0", - "fakerphp/faker": "^1.20.0", - "infection/infection": "~0.26.6", - "phpunit/phpunit": "^9.5.26", - "psalm/plugin-phpunit": "~0.18.3", - "vimeo/psalm": "^4.30.0" + "ergebnis/license": "^2.2.0", + "ergebnis/php-cs-fixer-config": "^6.6.0", + "ergebnis/phpunit-slow-test-detector": "^2.3.0", + "fakerphp/faker": "^1.23.0", + "infection/infection": "~0.27.3", + "phpunit/phpunit": "^10.4.1", + "psalm/plugin-phpunit": "~0.18.4", + "rector/rector": "~0.18.5", + "vimeo/psalm": "^5.15.0" }, "type": "library", "autoload": { @@ -2454,7 +2468,8 @@ "authors": [ { "name": "Andreas Möller", - "email": "am@localheinz.com" + "email": "am@localheinz.com", + "homepage": "https://localheinz.com" } ], "description": "Provides a JSON printer, allowing for flexible indentation.", @@ -2466,41 +2481,44 @@ ], "support": { "issues": "https://github.com/ergebnis/json-printer/issues", + "security": "https://github.com/ergebnis/json-printer/blob/main/.github/SECURITY.md", "source": "https://github.com/ergebnis/json-printer" }, - "time": "2022-11-28T10:27:43+00:00" + "time": "2023-10-10T07:42:48+00:00" }, { "name": "ergebnis/json-schema-validator", - "version": "4.0.0", + "version": "4.1.0", "source": { "type": "git", "url": "https://github.com/ergebnis/json-schema-validator.git", - "reference": "a6166272ac5691a9bc791f185841e5f92a6d4723" + "reference": "d568ed85d1cdc2e49d650c2fc234dc2516f3f25b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/ergebnis/json-schema-validator/zipball/a6166272ac5691a9bc791f185841e5f92a6d4723", - "reference": "a6166272ac5691a9bc791f185841e5f92a6d4723", + "url": "https://api.github.com/repos/ergebnis/json-schema-validator/zipball/d568ed85d1cdc2e49d650c2fc234dc2516f3f25b", + "reference": "d568ed85d1cdc2e49d650c2fc234dc2516f3f25b", "shasum": "" }, "require": { - "ergebnis/json": "^1.0.0", + "ergebnis/json": "^1.0.1", "ergebnis/json-pointer": "^3.2.0", "ext-json": "*", "justinrainbow/json-schema": "^5.2.12", - "php": "^8.0" + "php": "~8.1.0 || ~8.2.0 || ~8.3.0" }, "require-dev": { "ergebnis/composer-normalize": "^2.21.0", - "ergebnis/data-provider": "^1.2.0", - "ergebnis/license": "^2.1.0", - "ergebnis/php-cs-fixer-config": "~5.0.0", - "fakerphp/faker": "^1.20.0", - "infection/infection": "~0.26.16", - "phpunit/phpunit": "~9.5.27", + "ergebnis/data-provider": "^3.0.0", + "ergebnis/license": "^2.2.0", + "ergebnis/php-cs-fixer-config": "~6.6.0", + "ergebnis/phpunit-slow-test-detector": "^2.3.0", + "fakerphp/faker": "^1.23.0", + "infection/infection": "~0.27.4", + "phpunit/phpunit": "^10.4.1", "psalm/plugin-phpunit": "~0.18.4", - "vimeo/psalm": "^5.1.0" + "rector/rector": "~0.18.5", + "vimeo/psalm": "^5.15.0" }, "type": "library", "extra": { @@ -2521,7 +2539,8 @@ "authors": [ { "name": "Andreas Möller", - "email": "am@localheinz.com" + "email": "am@localheinz.com", + "homepage": "https://localheinz.com" } ], "description": "Provides a JSON schema validator, building on top of justinrainbow/json-schema.", @@ -2533,9 +2552,10 @@ ], "support": { "issues": "https://github.com/ergebnis/json-schema-validator/issues", + "security": "https://github.com/ergebnis/json-schema-validator/blob/main/.github/SECURITY.md", "source": "https://github.com/ergebnis/json-schema-validator" }, - "time": "2022-12-10T14:50:15+00:00" + "time": "2023-10-10T14:16:57+00:00" }, { "name": "justinrainbow/json-schema", @@ -4491,16 +4511,16 @@ }, { "name": "shipmonk/phpstan-rules", - "version": "2.9.1", + "version": "2.11.1", "source": { "type": "git", "url": "https://github.com/shipmonk-rnd/phpstan-rules.git", - "reference": "a566cfdb4567a3627d9a85c7b0da94a3074775af" + "reference": "3c286cecafb1c4399a16392f9f0d86c56c4965c6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/shipmonk-rnd/phpstan-rules/zipball/a566cfdb4567a3627d9a85c7b0da94a3074775af", - "reference": "a566cfdb4567a3627d9a85c7b0da94a3074775af", + "url": "https://api.github.com/repos/shipmonk-rnd/phpstan-rules/zipball/3c286cecafb1c4399a16392f9f0d86c56c4965c6", + "reference": "3c286cecafb1c4399a16392f9f0d86c56c4965c6", "shasum": "" }, "require": { @@ -4542,9 +4562,9 @@ ], "support": { "issues": "https://github.com/shipmonk-rnd/phpstan-rules/issues", - "source": "https://github.com/shipmonk-rnd/phpstan-rules/tree/2.9.1" + "source": "https://github.com/shipmonk-rnd/phpstan-rules/tree/2.11.1" }, - "time": "2023-09-26T12:55:42+00:00" + "time": "2023-12-22T11:51:20+00:00" }, { "name": "slevomat/coding-standard", diff --git a/src/MigrationRun.php b/src/MigrationRun.php index 31b419d..49db0d6 100644 --- a/src/MigrationRun.php +++ b/src/MigrationRun.php @@ -41,7 +41,7 @@ public function getPhase(): string public function getDuration(): float { return ($this->finishedAt->getTimestamp() - $this->startedAt->getTimestamp()) - + ($this->finishedAt->format('u') - $this->startedAt->format('u')) / 1_000_000; + + ((int) $this->finishedAt->format('u') - (int) $this->startedAt->format('u')) / 1_000_000; } public function getStartedAt(): DateTimeImmutable diff --git a/tests/MigrationRunTest.php b/tests/MigrationRunTest.php new file mode 100644 index 0000000..c5ea014 --- /dev/null +++ b/tests/MigrationRunTest.php @@ -0,0 +1,23 @@ +getDuration()); + } + +}