Skip to content

Commit

Permalink
PhpStan erros
Browse files Browse the repository at this point in the history
  • Loading branch information
janbarasek committed Apr 14, 2020
1 parent c843e83 commit b600f35
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Entity/SmartNumber.php
Original file line number Diff line number Diff line change
Expand Up @@ -308,12 +308,12 @@ private function setFractionHelper(string $float, float $tolerance = 1.e-8): arr
*/
private function shortFractionHelper(string $x, string $y, int $level = 0): array
{
if ($y === 0 || preg_match('/^0+(\.0+)?$/', $y)) {
if ($y === '0' || preg_match('/^0+(\.0+)?$/', $y)) {
throw new NumberException('Can not division fraction [' . $x . ' / ' . $y . '] by zero.');
}

if (Validators::isNumericInt($x) === false || Validators::isNumericInt($y) === false) {
return [$this->setFractionHelper((string) ($x / $y)), '1'];
return $this->setFractionHelper((string) ($x / $y));
}

$originalX = $x;
Expand All @@ -325,7 +325,7 @@ private function shortFractionHelper(string $x, string $y, int $level = 0): arra
}

if ($x % $y === 0) {
return [$x / $y, 1];
return [(string) (int) ($x / $y), '1'];
}

foreach (Cache::primaries() as $primary) {
Expand Down

0 comments on commit b600f35

Please sign in to comment.