Skip to content

Commit

Permalink
Refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
alexeybob committed Jun 6, 2018
1 parent 76c60b3 commit 89393c8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 19 deletions.
22 changes: 3 additions & 19 deletions src/Helpers/CommonHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

use Illuminate\Filesystem\Filesystem;

/**
* @author Alexey Bob <alexey.bob@gmail.com>
*/
if (! function_exists('__ab')) {
/**
* Translate the given message.
Expand Down Expand Up @@ -65,23 +68,4 @@ function trans_choice_ab($key, $number, array $replace = [], $locale = null)

return trans_choice($key, $number, $replace, $locale);
}
}


if (! function_exists('locale_country')) {
/**
* Get country by locale.
*
* @param string $locale
*
* @return string
*/
function locale_country(string $locale)
{
$data = [
'en' => 'gb'
];

return isset($data[$locale]) ? $data[$locale] : $locale;
}
}
4 changes: 4 additions & 0 deletions src/Rules/Locale.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@
use Illuminate\Contracts\Validation\Rule;
use Illuminate\Filesystem\Filesystem;


/**
* @author Alexey Bob <alexey.bob@gmail.com>
*/
class Locale implements Rule
{
/**
Expand Down

0 comments on commit 89393c8

Please sign in to comment.