Skip to content

Commit

Permalink
feat: add base argument to Stringable->toInteger()
Browse files Browse the repository at this point in the history
  • Loading branch information
adamczykpiotr authored Jan 13, 2024
1 parent 47af503 commit c6275db
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/Illuminate/Support/Stringable.php
Original file line number Diff line number Diff line change
Expand Up @@ -1281,11 +1281,13 @@ public function toString()
/**
* Get the underlying string value as an integer.
*
* @param int $base
*
* @return int
*/
public function toInteger()
public function toInteger($base = 10)
{
return intval($this->value);
return intval($this->value, $base);
}

/**
Expand Down

0 comments on commit c6275db

Please sign in to comment.