Fix scan-app-data conversion #34283#35037
Closed
mgoeppl wants to merge 1 commit intonextcloud:masterfrom
Closed
Conversation
Fixes nextcloud#34283 Signed-off-by: Moritz Göppl <24495490+mgoeppl@users.noreply.github.com>
| $secs = round($this->execTime); | ||
| # convert seconds into HH:MM:SS form | ||
| return sprintf('%02d:%02d:%02d', ($secs / 3600), ($secs / 60 % 60), $secs % 60); | ||
| return sprintf('%02d:%02d:%02d', intdiv($secs, 3600), intdiv($secs, 60) % 60, $secs % 60); |
Check failure
Code scanning / Psalm
InvalidScalarArgument
| $secs = round($this->execTime); | ||
| # convert seconds into HH:MM:SS form | ||
| return sprintf('%02d:%02d:%02d', ($secs / 3600), ($secs / 60 % 60), $secs % 60); | ||
| return sprintf('%02d:%02d:%02d', intdiv($secs, 3600), intdiv($secs, 60) % 60, $secs % 60); |
Check failure
Code scanning / Psalm
InvalidScalarArgument
Contributor
|
Hey 👋 Thanks for your pull request. Should work, but our static code analysis will complain about it: https://psalm.dev/r/6dface78cb round always returns a float and intdiv expects an integer. |
kesselb
reviewed
Nov 8, 2022
| @@ -239,7 +239,7 @@ protected function showSummary($headers, $rows, OutputInterface $output) { | |||
| protected function formatExecTime() { | |||
| $secs = round($this->execTime); | |||
Contributor
There was a problem hiding this comment.
Suggested change
| $secs = round($this->execTime); | |
| $secs = (int)round($this->execTime); |
To make psalm happy 🐘
Contributor
|
@mgoeppl any update here? :) |
8 tasks
Member
|
Superseded by #35935. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #34283