composer-update-patch

This commit is contained in:
Manish Verma
2016-11-03 05:44:29 +05:30
parent 2dca47f5a4
commit 5d49d384a0
5118 changed files with 51603 additions and 122575 deletions

View File

@@ -3,25 +3,44 @@
use Illuminate\Support\Facades\App;
use libphonenumber\PhoneNumberFormat;
if (!function_exists('phone_format')) {
/**
* Formats a phone number and country for display.
*
* @param string $phone
* @param string $country
* @param int|null $format
* @return string
*/
function phone_format($phone, $country = null, $format = PhoneNumberFormat::INTERNATIONAL)
{
$lib = App::make('libphonenumber');
if (! function_exists('phone_format')) {
/**
* Get the PhoneNumberUtil or format a phone number for display.
*
* @return \libphonenumber\PhoneNumberUtil|string
*/
function phone()
{
$lib = App::make('libphonenumber');
if (!$country) {
$country = App::getLocale();
}
if (! $arguments = func_get_args()) {
return $lib;
}
$phoneNumber = $lib->parse($phone, $country);
$phone = $arguments[0];
$country = isset($arguments[1]) ? $arguments[1] : App::getLocale();
$format = isset($arguments[2]) ? $arguments[2] : PhoneNumberFormat::INTERNATIONAL;
return $lib->format($phoneNumber, $format);
}
return $lib->format(
$lib->parse($phone, $country),
$format
);
}
}
if (! function_exists('phone_format')) {
/**
* Formats a phone number and country for display.
*
* @param string $phone
* @param string $country
* @param int|null $format
* @return string
*
* @deprecated 2.8.0
*/
function phone_format($phone, $country = null, $format = PhoneNumberFormat::INTERNATIONAL)
{
return phone($phone, $country, $format);
}
}