Skip to content

Commit

Permalink
[10.x] feat: add base argument to Stringable->toInteger() (#49670)
Browse files Browse the repository at this point in the history
* feat: add base argument to Stringable->toInteger()

* fix: StyleCi
  • Loading branch information
adamczykpiotr committed Jan 13, 2024
1 parent 47af503 commit f812cf9
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/Illuminate/Support/Stringable.php
Expand Up @@ -1281,11 +1281,12 @@ 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 f812cf9

Please sign in to comment.