diff --git a/src/Phing/Type/Selector/DateSelector.php b/src/Phing/Type/Selector/DateSelector.php index 269de6a496..5ffae2f757 100644 --- a/src/Phing/Type/Selector/DateSelector.php +++ b/src/Phing/Type/Selector/DateSelector.php @@ -99,7 +99,7 @@ public function getSeconds() */ public function setMillis($millis) { - $this->setSeconds((int) $millis / 1000); + $this->setSeconds((float) $millis / 1000); } /** diff --git a/src/Phing/Util/SizeHelper.php b/src/Phing/Util/SizeHelper.php index 9a04db7d67..5ddca8cea2 100644 --- a/src/Phing/Util/SizeHelper.php +++ b/src/Phing/Util/SizeHelper.php @@ -58,7 +58,7 @@ public static function fromHumanToBytes(string $human): float /** * Convert from bytes to any other valid unit. */ - public static function fromBytesTo(int $bytes, string $unit): float + public static function fromBytesTo(float $bytes, string $unit): float { $multiple = self::findUnitMultiple($unit); @@ -95,7 +95,7 @@ protected static function parseHuman(string $human): array /** * Finds the value in bytes of a single "unit". */ - protected static function findUnitMultiple(string $unit): int + protected static function findUnitMultiple(string $unit): float { foreach (self::IEC as $exponent => $choices) { if (in_array(strtolower($unit), array_map('strtolower', $choices))) { diff --git a/tests/Phing/Type/Selector/DateSelectorTest.php b/tests/Phing/Type/Selector/DateSelectorTest.php index 5dc6ab2f9f..4a9900df29 100644 --- a/tests/Phing/Type/Selector/DateSelectorTest.php +++ b/tests/Phing/Type/Selector/DateSelectorTest.php @@ -187,7 +187,7 @@ public function testSecondsGranularitySixtySeconds(): void $this->assertFileExists($this->outputDir . basename($file), $offset . ' file missing from output directory'); } - foreach ($outOfWindowFiles as $file) { + foreach ($outOfWindowFiles as $offset => $file) { $this->assertFileDoesNotExist($this->outputDir . basename($file), $offset . ' file unexpected in output directory'); } } diff --git a/tests/Phing/Util/SizeHelperTest.php b/tests/Phing/Util/SizeHelperTest.php index bb788d50f8..4079361ddf 100644 --- a/tests/Phing/Util/SizeHelperTest.php +++ b/tests/Phing/Util/SizeHelperTest.php @@ -115,7 +115,7 @@ public function invalidFromHumanToBytesProvider(): array /** * @dataProvider fromBytesToProvider */ - public function testFromBytesTo(int $bytes, string $unit, float $expected): void + public function testFromBytesTo(float $bytes, string $unit, float $expected): void { $converted = SizeHelper::fromBytesTo($bytes, $unit); $this->assertSame($expected, $converted);