composeer update

This commit is contained in:
2019-06-23 11:49:01 +00:00
parent fc2380d68c
commit e9efe70112
327 changed files with 5194 additions and 2278 deletions

View File

@@ -0,0 +1 @@
patreon: s_bergmann

View File

@@ -6,8 +6,6 @@ php:
- 7.3
- 7.4snapshot
sudo: false
before_install:
- composer self-update
- composer clear-cache

View File

@@ -2,6 +2,12 @@
All notable changes are documented in this file using the [Keep a CHANGELOG](http://keepachangelog.com/) principles.
## [2.1.2] - 2019-06-07
### Fixed
* Fixed [#21](https://github.com/sebastianbergmann/php-timer/pull/3352): Formatting of memory consumption does not work on 32bit systems
## [2.1.1] - 2019-02-20
### Changed
@@ -24,6 +30,7 @@ All notable changes are documented in this file using the [Keep a CHANGELOG](htt
* This component is no longer supported on PHP 5.3, PHP 5.4, PHP 5.5, PHP 5.6, and PHP 7.0
[2.1.2]: https://github.com/sebastianbergmann/diff/compare/2.1.1...2.1.2
[2.1.1]: https://github.com/sebastianbergmann/diff/compare/2.1.0...2.1.1
[2.1.0]: https://github.com/sebastianbergmann/diff/compare/2.0.0...2.1.0
[2.0.0]: https://github.com/sebastianbergmann/diff/compare/1.0.9...2.0.0

View File

@@ -44,17 +44,15 @@ final class Timer
return \microtime(true) - \array_pop(self::$startTimes);
}
public static function bytesToString(int $bytes): string
public static function bytesToString(float $bytes): string
{
foreach (self::$sizes as $unit => $value) {
if ($bytes >= $value) {
$size = \sprintf('%.2f', $bytes >= 1024 ? $bytes / $value : $bytes);
return $size . ' ' . $unit;
return \sprintf('%.2f %s', $bytes >= 1024 ? $bytes / $value : $bytes, $unit);
}
}
return $bytes . ' byte' . ($bytes !== 1 ? 's' : '');
return $bytes . ' byte' . ((int) $bytes !== 1 ? 's' : '');
}
public static function secondsToTimeString(float $time): string

View File

@@ -112,7 +112,7 @@ final class TimerTest extends TestCase
/**
* @dataProvider bytesProvider
*/
public function testCanFormatBytesAsString(string $string, int $bytes): void
public function testCanFormatBytesAsString(string $string, float $bytes): void
{
$this->assertEquals($string, Timer::bytesToString($bytes));
}