Skip to content

Commit

Permalink
Update code style reversal for native_constant_invocation
Browse files Browse the repository at this point in the history
  • Loading branch information
paulbalandan committed Jun 1, 2021
1 parent d08dfc3 commit e144cd7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ All notable changes to this library will be documented in this file.

This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [v1.3.3](https://github.com/NexusPHP/tachycardia/compare/v1.3.2...v1.3.3) - 2021-06-01

- Updated code style reversal for `native_constant_invocation`

## [v1.3.2](https://github.com/NexusPHP/tachycardia/compare/v1.3.1...v1.3.2) - 2021-06-01

- Mark as draft the contents generated by the automated release script
Expand Down
6 changes: 3 additions & 3 deletions src/Tachycardia.php
Original file line number Diff line number Diff line change
Expand Up @@ -419,18 +419,18 @@ private function formTime(float $seconds): string
$second = number_format($second, $this->precision);

if (preg_match('/^(\d+)(\.\d+)?/', $second, $matches) === 1) {
$second = str_pad($matches[1], 2, '0', \STR_PAD_LEFT) . ($matches[2] ?? '');
$second = str_pad($matches[1], 2, '0', STR_PAD_LEFT) . ($matches[2] ?? '');
}

$minute = '00';
$hour = '00';

if ($seconds > 60) {
$minute = str_pad((string) floor(($seconds % 3600) / 60), 2, '0', \STR_PAD_LEFT);
$minute = str_pad((string) floor(($seconds % 3600) / 60), 2, '0', STR_PAD_LEFT);
}

if ($seconds > 3600) {
$hour = str_pad((string) floor(($seconds % 86400) / 3600), 2, '0', \STR_PAD_LEFT);
$hour = str_pad((string) floor(($seconds % 86400) / 3600), 2, '0', STR_PAD_LEFT);
}

return sprintf('%s:%s:%s', $hour, $minute, $second);
Expand Down

0 comments on commit e144cd7

Please sign in to comment.