From 3db2304fc6c63c42fb4aed63bfa88401f7ba49a7 Mon Sep 17 00:00:00 2001 From: jrfnl Date: Thu, 3 Jun 2021 06:05:46 +0200 Subject: [PATCH] PHP 8.1 | Fix "Implicit conversion from non-compatible float" deprecation notice As reported in 9931. Unfortunately I gave not been able to track down the input which is causing the notices to be thrown, which is why I haven't added a test case to the unit tests. Would be great if someone would known the exact input to use for those. The issue (and fix) can be verified by using the "quick preview" option and choosing `git.master` with this code sample: https://3v4l.org/1fr2g --- src/Composer/Platform/Version.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Composer/Platform/Version.php b/src/Composer/Platform/Version.php index 15b2fdb95..61b3b5669 100644 --- a/src/Composer/Platform/Version.php +++ b/src/Composer/Platform/Version.php @@ -97,7 +97,7 @@ class Version return sprintf( '%d.%d.%d', $versionId / ($base * $base), - ($versionId / $base) % $base, + (int) ($versionId / $base) % $base, $versionId % $base ); }