Skip to content

Commit

Permalink
[10.x] Printing Name of The Method that Calls `ensureIntlExtensionIsI…
Browse files Browse the repository at this point in the history
…nstalled` in `Number` class. (#49660)

* code

* formatting according to style-ci

* moving the logic for inside the if condition

* Update Number.php

---------

Co-authored-by: Taylor Otwell <[email protected]>
  • Loading branch information
devajmeireles and taylorotwell authored Jan 12, 2024
1 parent 7dff807 commit 534872c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Illuminate/Support/Number.php
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,9 @@ public static function useLocale(string $locale)
protected static function ensureIntlExtensionIsInstalled()
{
if (! extension_loaded('intl')) {
throw new RuntimeException('The "intl" PHP extension is required to use this method.');
$method = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 2)[1]['function'];

throw new RuntimeException('The "intl" PHP extension is required to use the ['.$method.'] method.');
}
}
}

0 comments on commit 534872c

Please sign in to comment.