Skip to content

Commit

Permalink
Removed intval() usage.
Browse files Browse the repository at this point in the history
  • Loading branch information
Hugo Rafael Azevedo committed May 31, 2019
1 parent 6ee0ce8 commit 2943cc6
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/Scalar/AbstractReadString.php
Original file line number Diff line number Diff line change
Expand Up @@ -233,8 +233,8 @@ public function count(string $search, int $start = 0, int $length = null): int
protected function validateStartAndLength(int $start, ?int $length): void
{
// Calculates the absolute values for validations.
$absStart = \intval(\abs($start));
$absLength = \intval(\abs($length));
$absStart = (int) \abs($start);
$absLength = (int) \abs($length);

// Validates the starting value.
if ($absStart > $this->length()) {
Expand Down
2 changes: 1 addition & 1 deletion src/Scalar/AbstractWriteInteger.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,6 @@ protected function doMultiply(int $value): int
*/
protected function doDivide(int $value): int
{
return \intval($this->value / $value);
return ((int) ($this->value / $value));
}
}
2 changes: 1 addition & 1 deletion src/Scalar/ImmutableInteger.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public static function fromString(string $number): ImmutableInteger
}

return new ImmutableInteger(
\intval($number)
((int) $number)
);
}

Expand Down
2 changes: 1 addition & 1 deletion src/Scalar/MutableInteger.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public static function fromString(string $number): MutableInteger
}

return new MutableInteger(
\intval($number)
((int) $number)
);
}

Expand Down
2 changes: 1 addition & 1 deletion src/Scalar/ReadonlyInteger.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public static function fromString(string $number): ReadonlyInteger
}

return new ReadonlyInteger(
\intval($number)
((int) $number)
);
}

Expand Down

0 comments on commit 2943cc6

Please sign in to comment.