add mutation score badge #21
Annotations
10 warnings
PHP8.3 - ubuntu-latest:
src/ByteUnit.php#L92
Escaped Mutant for Mutator "LessThan":
--- Original
+++ New
@@ @@
*/
public function lowerThan(ByteUnit $unit) : bool
{
- return $this->value < $unit->value;
+ return $this->value <= $unit->value;
}
/**
* Get place difference to unit.
|
PHP8.3 - ubuntu-latest:
src/ByteUnit.php#L122
Escaped Mutant for Mutator "PublicVisibility":
--- Original
+++ New
@@ @@
/**
* Get current byte unit case weight.
*/
- public function getWeight() : int
+ protected function getWeight() : int
{
return $this->getAttribute()->weight;
}
|
PHP8.3 - ubuntu-latest:
src/ByteUnit.php#L138
Escaped Mutant for Mutator "ProtectedVisibility":
--- Original
+++ New
@@ @@
/**
* Get ByteUnit attribute from current backed case.
*/
- protected function getAttribute() : AsByteUnit
+ private function getAttribute() : AsByteUnit
{
$reflection = new \ReflectionEnumBackedCase($this, $this->name);
$reflectionAttributes = $reflection->getAttributes(AsByteUnit::class);
|
PHP8.3 - ubuntu-latest:
src/ByteUnitConverter.php#L46
Escaped Mutant for Mutator "DecrementInteger":
--- Original
+++ New
@@ @@
/**
* Create new instance converting from value and unit to bytes for conversions.
*/
- public static function from(int|float|string $value, ByteUnit $unit, int $precision = 2) : static
+ public static function from(int|float|string $value, ByteUnit $unit, int $precision = 1) : static
{
return new static(static::toBytesFromUnit((string) $value, $unit, $precision));
}
|
PHP8.3 - ubuntu-latest:
src/ByteUnitConverter.php#L46
Escaped Mutant for Mutator "IncrementInteger":
--- Original
+++ New
@@ @@
/**
* Create new instance converting from value and unit to bytes for conversions.
*/
- public static function from(int|float|string $value, ByteUnit $unit, int $precision = 2) : static
+ public static function from(int|float|string $value, ByteUnit $unit, int $precision = 3) : static
{
return new static(static::toBytesFromUnit((string) $value, $unit, $precision));
}
|
PHP8.3 - ubuntu-latest:
src/ByteUnitConverter.php#L48
Escaped Mutant for Mutator "CastString":
--- Original
+++ New
@@ @@
*/
public static function from(int|float|string $value, ByteUnit $unit, int $precision = 2) : static
{
- return new static(static::toBytesFromUnit((string) $value, $unit, $precision));
+ return new static(static::toBytesFromUnit($value, $unit, $precision));
}
/**
* Converts from specified unit to bytes.
|
PHP8.3 - ubuntu-latest:
src/ByteUnitConverter.php#L56
Escaped Mutant for Mutator "DecrementInteger":
--- Original
+++ New
@@ @@
*
* @throws \Exception
*/
- public static function toBytesFromUnit(string $value, ByteUnit $unit, int $precision = 2) : string
+ public static function toBytesFromUnit(string $value, ByteUnit $unit, int $precision = 1) : string
{
// saves the noop on bytes from any metric system
if ($unit->value === '1') {
|
PHP8.3 - ubuntu-latest:
src/ByteUnitConverter.php#L56
Escaped Mutant for Mutator "IncrementInteger":
--- Original
+++ New
@@ @@
*
* @throws \Exception
*/
- public static function toBytesFromUnit(string $value, ByteUnit $unit, int $precision = 2) : string
+ public static function toBytesFromUnit(string $value, ByteUnit $unit, int $precision = 3) : string
{
// saves the noop on bytes from any metric system
if ($unit->value === '1') {
|
PHP8.3 - ubuntu-latest:
src/ByteUnitConverter.php#L56
Escaped Mutant for Mutator "PublicVisibility":
--- Original
+++ New
@@ @@
*
* @throws \Exception
*/
- public static function toBytesFromUnit(string $value, ByteUnit $unit, int $precision = 2) : string
+ protected static function toBytesFromUnit(string $value, ByteUnit $unit, int $precision = 2) : string
{
// saves the noop on bytes from any metric system
if ($unit->value === '1') {
|
PHP8.3 - ubuntu-latest:
src/ByteUnitConverter.php#L63
Escaped Mutant for Mutator "BCMath":
--- Original
+++ New
@@ @@
if ($unit->value === '1') {
return $value;
}
- return bcmul(self::numberFormat($value), $unit->asNumber(), $precision);
+ return (string) (self::numberFormat($value) * $unit->asNumber());
}
/**
* Like PHP's number_format function but without thousands separator.
|